用于 Azure Monitor 的资源管理器模板示例Resource Manager template samples for Azure Monitor

可以使用 Azure 资源管理器模板大规模部署和配置 Azure Monitor。Azure Monitor can be deployed and configured at scale using Azure Resource Manager template. 以下文章提供了适用于不同 Azure Monitor 功能的示例模板。The following articles provide sample templates for different Azure Monitor features. 这些示例可以根据特定要求进行修改,并且可以使用任何标准的资源管理器模板部署方法进行部署。These samples can be modified for your particular requirements and deployed using any standard method for deploying Resource Manager templates.

部署示例模板Deploying the sample templates

使用示例的基本步骤如下:The basic steps to use the samples are:

  1. 复制模板并另存为 JSON 文件。Copy the template and save as a JSON file.
  2. 根据环境修改参数并另存为 JSON 文件。Modify the parameters for your environment and save as a JSON file.
  3. 使用任意资源管理器模板部署方法部署模板。Deploy the template using any deployment method for Resource Manager templates.

例如,使用以下命令通过 PowerShell 或 Azure CLI 将模板和参数文件部署到资源组中。For example, use the following commands to deploy the template and parameters file to a resource group using PowerShell or Azure CLI.

Connect-AzAccount -Environment AzureChinaCloud
Select-AzSubscription -SubscriptionName my-subscription
New-AzResourceGroupDeployment -Name AzureMonitorDeployment -ResourceGroupName my-resource-group -TemplateFile azure-monitor-deploy.json -TemplateParameterFile azure-monitor-deploy.parameters.json
az login
az deployment group create \
    --name AzureMonitorDeployment \
    --resource-group ResourceGroupofTargetResource \
    --template-file azure-monitor-deploy.json \
    --parameters azure-monitor-deploy.parameters.json

示例模板列表List of sample templates

后续步骤Next steps