1
votes

I want to create resource group and deploy resource using ARM template from visual Studio

When I tried the following example by copying the script and put it in my Visual Studio. When I try to run the Deployment template comes out blank.

https://docs.microsoft.com/en-us/azure/azure-resource-manager/deploy-to-subscription#create-resource-group-and-deploy-resources enter image description here

How do i run this the arm template?

2
it's bit strange but if I copy same same content of "azuredeploy.json" into new file azuredeploy1.json ( by adding this new file of type "Azure resource manager deployment template".. by right click on solution ), it detects all contents correctly and shows up as deployment template.. I will try to find out the reasonRahul Ruikar

2 Answers

1
votes

Schema that is used in your example uses "subscription level schema"

https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#

As per https://docs.microsoft.com/en-us/azure/azure-resource-manager/deploy-to-subscription

To deploy templates at the subscription level, you use Azure CLI and Azure PowerShell.

I used this schema "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" I used this default schema..and it detects that file as "deployment template"

1
votes

Currently VS doesn't handle subscription level deployment templates. VS won't deploy them via the UI and if the schema is set properly it won't even recognize it as an ARM template.