Azure Arm (7) Arm Template-Edit with Visual Studio

Source: Internet
Author: User
Tags install azure sdk azure sdk

Windows Azure Platform Family of articles Catalog

The arm Template described earlier is used to edit the JSON file using a text editor.

Text describes how to use visual Studio to edit a JSON Template.

This article uses visual Studio with Update 3 for editing and installs Azure SDK 2.9.

If the reader is using Visual Studio 2013 and Azure SDK 2.9, the interface of the large department is similar to that of the author. I strongly recommend that you install the latest Visual Studio and Azure SDK.

Premise:

1. Install visual Studio with Update 3

2. Install Azure SDK 2.9

1. Run visual Studio with Update 3

2. Create an Azure Resource group project. Such as:

  

  

3. Templates Select Blank Template

  

  

4. After the project is created, does not contain any items, we select Templates, double-click Azuredeploy.json

  

  

5. Shown as JSON Outline, we can add new resource, click on resources, mail, add new Resource. Such as:

6. In the Popup interface, enter the storage account and then the yarn-dyed Storage account name (must be in lowercase English), such as:

  

7. Modify the Azuredeploy.json file in the Visual Studio project as follows:

{    "$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",    "contentversion":"1.0.0.0",  "Parameters": {          "Leinewstoragetype": {            "type":"string",            "DefaultValue":"Standard_lrs",            "allowedvalues": [              "Standard_lrs",              "Standard_zrs",              "Standard_grs",              "Standard_ragrs",              "Premium_lrs"            ]          },          "Storageaccounts_leistorageaccount_name": {            "DefaultValue":"Leistorageaccount",            "type":"String"          }  },    "variables": {            },    "Resources": [      {        "name":"[Parameters (' Storageaccounts_leistorageaccount_name ')]",        "type":"microsoft.storage/storageaccounts",        " Location":"[ResourceGroup (). Location]",        "apiversion":"2015-06-15",        "DependsOn": [],        "Tags": {          "DisplayName":"Leinewstorage"        },        "Properties": {          "AccountType":"[Parameters (' Leinewstoragetype ')]"        }      }    ],    "outputs": {    }}

8. Modify the Azuredeploy.parameters.json file to read as follows:

{    "$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",    "contentversion":"1.0.0.0",  "Parameters": {    "Storageaccounts_leistorageaccount_name": {      "value":"Leinewstorageaccount"    }  }}

Finally, publish through Azure PowerShell with the following command:

# Sign InWrite-host"Logging in ..."; ADD-azurermaccount-environmentname Azurechinacloud;#Select SubscriptionWrite-host"Selecting Subscription ' $subscriptionId '"; Select-azurermsubscription-subscriptionid$subscriptionId;#Create resource GroupNew-azurermresourcegroup-name$resourceGroupName-location$resourceGroupLocation#Deploy templateNew-azurermresourcegroupdeployment-resourcegroupname"[Resourcegroupname]"-templatefile"[FilePath]"-templateparameterfile ["Parameterfilepath"];

Reference:https://azure.microsoft.com/en-us/documentation/articles/ vs-azure-tools-resource-groups-deployment-projects-create-deploy/

  

Azure Arm (7) Arm Template-Edit with Visual Studio

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.