Distribuera en mall med kommando raden i Azure Stack hubbDeploy a template with the command line in Azure Stack Hub
Du kan använda Azures kommando rads gränssnitt (CLI) för att distribuera Azure Resource Manager mallar i Azure Stack Hub.You can use the Azure command-line interface (CLI) to deploy Azure Resource Manager templates in Azure Stack Hub. Azure Resource Manager mallar distribuerar och konfigurerar resurser för din app i en enda, samordnad åtgärd.Azure Resource Manager templates deploy and set up resources for your app in a single, coordinated action.
Distribuera mallenDeploy template
- Bläddra i AzureStack – snabb start-mallar lagrings platsen och hitta mallen 101-Create-Storage-Account .Browse the AzureStack-QuickStart-Templates repo and find the 101-create-storage-account template. Spara mallen (
azuredeploy.json
) och parametervärdena på(azuredeploy.parameters.json
en plats på den lokala enheten, till exempelC:\templates\
Save the template (azuredeploy.json
) and parameter files(azuredeploy.parameters.json
) to a location on your local drive suchC:\templates\
- Navigera till den mapp där du laddade ned filerna.Navigate to the folder into which you downloaded the files.
- Installera och Anslut till Azure Stack hubb med Azure CLI.Install and connect to Azure Stack Hub with Azure CLI.
- Uppdatera regionen och platsen i följande kommando.Update the region and location in the following command. Använd
local
för parametern location om du använder ASDK.Uselocal
for the location parameter if you are using the ASDK. Distribuera mallen:To deploy the template:az group create --name testDeploy --location local az group deployment create --resource-group testDeploy --template-file ./azuredeploy.json --parameters ./azuredeploy.parameters.json
Det här kommandot distribuerar mallen till resurs gruppen testDeploy i Azure Stack Hub-instansen.This command deploys the template to the resource group testDeploy in your Azure Stack Hub instance.
Verifiera distribution av mallValidate template deployment
Om du vill granska resurs gruppen och lagrings kontot kör du följande CLI-kommandon:To review the resource group and storage account, run the following CLI commands:
az group list
az storage account list
Nästa stegNext steps
Lär dig hur du distribuerar mallar med PowerShell.Learn how to deploy templates using PowerShell.