In this post, I will show you how to deploy an Azure JSON template from the Azure Portal using the (still in preview) Templates feature.
Note: This feature is still in preview so some functionality might change, and it is in the Azure Portal, so names and locations will change after this article is published.
Uploading a JSON Template
I am going to upload an Azure JSON template file that I previously created in the post Deploying Multiple Resources Using an Azure JSON File. Open the JSON file in VS Code and then log into the Azure Portal using your browser. Navigate to Templates in the Azure Portal and click Add.
You are asked to enter a name and description for the new template. I suggest that you version your new template; you will create new versions to change functionality and fix bugs, and you will want the ability to switch between versions.Click OK and move onto to ARM Template; here you will find a default blank template that we will overwrite. Select all of the code and delete it. Switch to VS Code, select your template and copy it into the clipboard. Switch back to the browser and paste your desired template into the window. Click OK.
The Azure Portal will perform a quick validation – this is little more than a syntax check and does not validate that a deployment can take place.
Click Add and your template will be saved; wait for a notification to say that the template has been successfully saved. You should see your new template when you click the Refresh action in the Templates blade.
Deploying a Template in the Azure Portal
Browse to your template in the Templates blade. Click the Deploy action in the new template.
Note: The Custom Deployment blade was recently changed (quite a bit), and it will probably change again after this article is published.
The Custom Deployment blade appears. This screen allows you to select the subscription, resource group (new or existing) and region that you want to deploy into. Each of the parameters from the JSON file appears under settings. Any default values are pre-entered for you, and you can enter/modify parameter values to customize your deployment. Remember that some items, such as storage accounts, require globally unique names, and some items, such as networks, should be unique in your organization (to allow routing between on-premises and/or cloud networks).It’s easy to miss a mandatory checkbox. If you scroll down to the bottom of the blade, you will find Microsoft’s terms and conditions. You must indicate your agreement by checking the I Agree To The Terms And Conditions Stated Above checkbox to be allowed to complete the deployment. Check the box if your organization is happy with Microsoft’s requirements, and click Purchase.
Azure will validate (as much as it can) the deployment that will take place and start deploying your JSON template, which you can monitor in the new/existing resource group.