title | description | author | ms.topic | ms.date | ms.author | ms.reviewer | ms.lastreviewed |
---|---|---|---|---|---|---|---|
Deploy a template with the command line in Azure Stack Hub |
Learn how to use the Azure cross-platform command-line interface (CLI) to deploy templates to Azure Stack Hub. |
sethmanheim |
article |
2/1/2021 |
sethm |
unknown |
05/09/2019 |
You can use the Azure command-line interface (CLI) to deploy Azure Resource Manager templates in Azure Stack Hub. Azure Resource Manager templates deploy and set up resources for your app in a single, coordinated action.
- Browse the AzureStack-QuickStart-Templates repo and find the 101-create-storage-account template. Save the template (
azuredeploy.json
) and parameter files(azuredeploy.parameters.json
) to a location on your local drive suchC:\templates\
- Navigate to the folder into which you downloaded the files.
- Install and connect to Azure Stack Hub with Azure CLI.
- Update the region and location in the following command. Use
local
for the location parameter if you are using the ASDK. To deploy the template:az group create --name testDeploy --location local az deployment group create --resource-group testDeploy --template-file ./azuredeploy.json --parameters ./azuredeploy.parameters.json
This command deploys the template to the resource group testDeploy in your Azure Stack Hub instance.
To review the resource group and storage account, run the following CLI commands:
az group list
az storage account list
Learn how to deploy templates using PowerShell.