Deploy template powershell




















For the installation instructions, see:. If you're using Azure CLI, make sure you have version 2. The commands shown in this tutorial will not work if you're using earlier versions. To check your installed version, use: az --version.

Name the file azuredeploy and select the json file extension. The complete name of the file is azuredeploy. Save the file to your workstation. Select a path that is easy to remember because you'll provide that path later when deploying the template. This template doesn't deploy any resources.

We're starting with a blank template so you can get familiar with the steps to deploy a template while minimizing the chance of something going wrong. The CLI examples in this article are written for the Bash shell. If you have multiple Azure subscriptions, select the subscription you want to use. Replace SubscriptionName with your subscription name. You can also use the subscription ID instead of the subscription name. When you deploy a template, you specify a resource group that will contain the resources.

Use the resource group you created. Give a name to the deployment so you can easily identify it in the deployment history. For convenience, also create a variable that stores the path to the template file. This variable makes it easier for you to run the deployment commands because you don't have to retype the path every time you deploy.

To run this deployment command, you must have the latest version of Azure CLI. The deployment command returns results. Before deploying your template, you can preview the changes the template will make to your environment.

Use the what-if operation to verify that the template makes the changes that you expect. What-if also validates the template for errors. To pass inline parameters, provide the names of the parameter with the New-AzResourceGroupDeployment command. For example, to pass a string and array to a template, use:. You can also get the contents of file and provide that content as an inline parameter.

Getting a parameter value from a file is helpful when you need to provide configuration values. For example, you can provide cloud-init values for a Linux virtual machine. If you need to pass in an array of objects, create hash tables in PowerShell and add them to an array. Pass that array as a parameter during deployment. Rather than passing parameters as inline values in your script, you may find it easier to use a JSON file that contains the parameter values.

The parameter file can be a local file or an external file with an accessible URI. For more information about the parameter file, see Create Resource Manager parameter file. To pass an external parameter file, use the TemplateParameterUri parameter:. Skip to content. Star 6. Code Issues Pull requests Security Insights. Permalink master. Branches Tags. Could not load branches. Could not load tags. Raw Blame. Open with Desktop View raw View blame. The resources are defined in a Resource Manager template.

You signed in with another tab or window. One for the dev environment and one for the production environment. To run this deployment command, you must have the latest version of Azure CLI.

If the deployment failed, use the verbose switch to get information about the resources being created. Use the debug switch to get more information for debugging. Congratulations, you've finished this introduction to deploying templates to Azure. Let us know if you have any comments and suggestions in the feedback section. Deploy a local template. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.

Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Note If the deployment failed, use the verbose switch to get information about the resources being created. Submit and view feedback for This product This page. View all page feedback.



0コメント

  • 1000 / 1000