Linux command
az-deployment 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Create a resource group deployment
az deployment group create --resource-group [rg_name] --template-file [template.json]
Deploy with parameters file
az deployment group create --resource-group [rg_name] --template-file [template.json] --parameters [parameters.json]
Deploy a Bicep file
az deployment group create --resource-group [rg_name] --template-file [main.bicep]
Validate a deployment
az deployment group validate --resource-group [rg_name] --template-file [template.json]
Show deployment details
az deployment group show --resource-group [rg_name] --name [deployment_name]
List deployments
az deployment group list --resource-group [rg_name]
Delete a deployment
az deployment group delete --resource-group [rg_name] --name [deployment_name]
Deploy at subscription scope
az deployment sub create --location [eastus] --template-file [template.json]
说明
az deployment is a subcommand of the Azure CLI that manages Azure Resource Manager (ARM) deployments. It deploys infrastructure as code using ARM templates (JSON) or Bicep files to create and update Azure resources. Deployments can target different scopes: resource group, subscription, management group, or tenant. The template defines resources to create, their properties, and dependencies. Parameters allow customization without modifying templates. Deployment modes include incremental (add/update resources) and complete (remove resources not in template). What-if operations preview changes before deployment.
参数
- group create
- Deploy at resource group scope.
- group validate
- Validate template without deploying.
- group show
- Show deployment details.
- group list
- List deployments in a resource group.
- group delete
- Remove deployment history entry.
- group what-if
- Preview deployment changes.
- sub create
- Deploy at subscription scope.
- mg create
- Deploy at management group scope.
- tenant create
- Deploy at tenant scope.
- --resource-group _rg_
- Target resource group.
- --template-file _file_
- Path to ARM template or Bicep file.
- --template-uri _uri_
- URL to template file.
- --parameters _params_
- Parameter values (file path or inline).
- --name _name_
- Deployment name.
- --mode _mode_
- Incremental or Complete.
- --location _region_
- Required for subscription-scope deployments.
- --confirm-with-what-if
- Show what-if and prompt before deploying.
FAQ
What is the az-deployment command used for?
az deployment is a subcommand of the Azure CLI that manages Azure Resource Manager (ARM) deployments. It deploys infrastructure as code using ARM templates (JSON) or Bicep files to create and update Azure resources. Deployments can target different scopes: resource group, subscription, management group, or tenant. The template defines resources to create, their properties, and dependencies. Parameters allow customization without modifying templates. Deployment modes include incremental (add/update resources) and complete (remove resources not in template). What-if operations preview changes before deployment.
How do I run a basic az-deployment example?
Run `az deployment group create --resource-group [rg_name] --template-file [template.json]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does group create do in az-deployment?
Deploy at resource group scope.