Azure Bicep Deploy

👤 junior-juarez-msft 📦 v2.1.0 ⭐ 4.2 ⬇️ 1.2K 下载
🔒 IT运维与安全 免费

📖 技能介绍


name: azure-bicep-deploy description: Deploy and validate Azure Bicep files and ARM templates. Use for: (1) Deploying Bicep (.bicep) or ARM (JSON) templates to Azure, (2) Validating Bicep/ARM templates for syntax errors, (3) Creating Azure resources via Bicep, (4) Managing multi-environment deployments (dev/staging/prod) via parameters. Supports Azure Container Apps commonly used workloads. Prerequisites: Azure CLI (az) installed, Azure CLI authenticated (az login), Bicep CLI installed (az bicep install), appropriate Azure subscription access.


Azure Bicep Deploy

Prerequisites (Required)

Before using this skill, ensure:

  1. Azure CLI installed bash az --version Install from: https://docs.microsoft.com/cli/azure/install-azure-cli

  2. Azure CLI authenticated bash az login # Interactive login az login --tenant <tenant-id> # For specific tenant az account show # Verify logged in

  3. Correct subscription selected (if multiple) bash az account list # List subscriptions az account set --subscription <sub-id> # Switch subscription

  4. Bicep CLI installed bash az bicep install # Install Bicep az bicep version # Verify installation Or use built-in: az deployment group create auto-compiles Bicep

Deploy a Bicep File

az deployment group create \
  --resource-group <rg-name> \
  --template-file <path-to-bicep> \
  --parameters <params-file>.json

发现更多技能插件,请访问7w4.net。

Deploy an ARM Template

az deployment group create \
  --resource-group <rg-name> \
  --template-file <path-to-arm.json> \
  --parameters <params-file>.json

Validate a Template (What-If)

az deployment group what-if \
  --resource-group <rg-name> \
  --template-file <path-to-bicep>

Validate Syntax Only (Bicep)

az bicep build --file <bicep-file>

Multi-Environment Deployments

Use parameter files for each environment:

params/
├── dev.bicepparam      # or dev.json
├── staging.bicepparam  # or staging.json
└── prod.bicepparam     # or prod.json

Deploy with environment:

az deployment group create \
  --resource-group <rg>-dev \
  --template-file main.bicep \
  --parameters @params/dev.json

Azure Container Apps

See references/container-apps.md for detailed Container App patterns including: - Basic container deployment - Ingress configuration - Scaling rules - revisions/versions

Create New Resources

When asked to create Azure resources via Bicep:

  1. Check if existing templates in references/ match your need
  2. For Container Apps: use the sample in assets/container-app/
  3. For other resources: generate using az bicep build-params --file or reference Azure QuickStart Templates

Scripts

Copy scripts from references or use directly:

Quick deploy (copy-paste one-liner):

az deployment group create --resource-group <rg> --template-file main.bicep --parameters @params/dev.json

🤖 AI 评测

这是一套Azure Bicep部署工具,质量中等偏上。文档清晰易懂,环境配置和部署流程说明完善,提供了多环境部署和多环境参数配置支持。主要不足是脚本执行效率和安全规范有待提升,部分参数校验逻辑不够严谨。对于有Azure Bicep使用经验的用户来说基本够用,新手用户需要额外注意脚本中的硬编码路径和参数填写要求。

📊 多维度评分

适应性4.1
规范性4.2
有效性4.3
可靠性4.1
可信度4.3

📁 包含文件 (9 个)

📄 SKILL.md 3.3 KB
📄 _meta.json 137 B
📄 assets/container-app/params/dev.json 429 B
📄 assets/container-app/params/prod.json 431 B
📄 assets/container-app/params/staging.json 437 B
📄 references/bicep-build.md 1.5 KB
📄 references/container-apps.md 3.8 KB
📄 references/deploy.md 2.9 KB
📄 references/validate.md 2.6 KB