Claude-skill-registry azure-env-builder

⚠️ Alpha (開発中) - エンタープライズ Azure 環境構築スキル。AVM 活用、VM アプリ初期化、App Service/AKS/Container Apps へのアプリデプロイ、サービス間設定連携、CI/CD 生成をサポート。Hub-Spoke, AKS, AI Foundry 等の複合アーキテクチャに対応。Bicep MCP と Microsoft Learn Docs MCP で最新スキーマを取得。

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/azure-env-builder" ~/.claude/skills/majiayu000-claude-skill-registry-azure-env-builder && rm -rf "$T"
manifest: skills/data/azure-env-builder/SKILL.md
source content

Azure Environment Builder

エンタープライズ向け Azure 環境を効率的に構築するスキル。

When to use

  • エンタープライズ向け Azure 環境の新規構築や再構成
  • AVM モジュールを活用した Bicep 設計・実装
  • Hub-Spoke/AKS/AI Foundry など複合アーキテクチャの設計

🎯 機能一覧

カテゴリ機能
🏗️ アーキテクチャHub-Spoke, Web+DB, AKS, AI Foundry, Proxy VM パターン
📦 AVM モジュール200+ Azure Verified Modules カタログ
🖥️ VM 初期化Squid, Nginx, Docker, IIS 等のアプリ組み込みスクリプト
� アプリデプロイApp Service, AKS (Helm/kubectl), Container Apps デプロイ
�🔗 設定連携SQL/Storage/Redis 接続文字列、Managed Identity RBAC 自動化
🚀 CI/CDGitHub Actions / Azure Pipelines テンプレート
🔒 セキュリティPrivate Endpoint, Firewall, NSG 自動構成

ワークフロー概要

1. ヒアリング (基本情報 + アーキテクチャパターン選択)
      ↓
2. MCP ツールで最新 AVM/スキーマ取得
      ↓
3. 環境フォルダ生成 (scripts/scaffold_environment.ps1)
      ↓
4. Bicep 実装 (AVM モジュール + VM 初期化スクリプト)
      ↓
5. CI/CD パイプライン生成 (GitHub Actions or Azure Pipelines)
      ↓
6. 検証 (what-if) → デプロイ → 結果記録

必須: MCP ツールの使用

Bicep コード生成前に必ず実行すること。

# 1. ベストプラクティス取得
mcp_bicep_experim_get_bicep_best_practices

# 2. AVM (Azure Verified Modules) カタログ確認
mcp_bicep_experim_list_avm_metadata

# 3. リソーススキーマ確認
mcp_bicep_experim_list_az_resource_types_for_provider(providerNamespace: "Microsoft.Network")
mcp_bicep_experim_get_az_resource_type_schema(azResourceType: "Microsoft.Storage/storageAccounts", apiVersion: "2023-05-01")

# 4. 公式ドキュメント/サンプル検索
microsoft_docs_search(query: "Private Endpoint Bicep")
microsoft_code_sample_search(query: "cloud-init CustomScriptExtension", language: "bicep")

Step 1: ヒアリング

基本情報 (必須)

項目確認内容
サブスクリプションID またはログイン状態 (
az account show
)
環境名dev / staging / prod など
リージョンjapaneast / japanwest など
デプロイ方式Azure CLI / Bicep
スコープResourceGroup / Subscription

アーキテクチャパターン選択

references/architecture-patterns.md から選択

パターン用途
🏢 Hub-Spoke Landing Zone大規模エンタープライズ、複数環境
🌐 Web + Database一般的な Web アプリ (App Service)
☸️ AKS Kubernetesコンテナ化されたマイクロサービス
🤖 AI FoundryAI/ML ワークロード
🔒 Proxy VM (Squid 等)閉域ネットワーク、送信制御

VM アプリ初期化要件

references/vm-app-scripts.md 参照

アプリ対応 OS初期化方式
🦑 Squid ProxyLinuxcloud-init + CustomScriptExtension
🌐 Nginx ReverseLinuxcloud-init
🐳 Docker + ComposeLinuxcloud-init
🪟 IISWindowsCustomScriptExtension (PowerShell)

サービス間設定連携

references/service-config-templates.md 参照

連携パターン設定内容
App → SQL Database接続文字列自動生成、Managed Identity RBAC
App → StorageAccountKey または RBAC、SAS トークン
App → Redis Cache接続文字列、アクセスキー
App → Key VaultManaged Identity、シークレット参照
Private EndpointDNS Zone Link、NIC 自動構成

→ 詳細なヒアリング項目: references/hearing-checklist.md

Step 2: 環境フォルダ生成

pwsh scripts/scaffold_environment.ps1 -Environment <env> -Location <region> -DeploymentMode Bicep -DeploymentScope <scope>

生成物:

  • env/<env>/bicep/main.bicep
  • env/<env>/bicep/parameters/<env>.json
  • env/<env>/README.md

Step 3: Bicep 実装 (AVM 活用)

AVM モジュール参照

references/avm-modules.md で最新バージョン確認

// AVM モジュール使用例 (VNet)
module vnet 'br/public:avm/res/network/virtual-network:0.7.1' = {
  name: 'vnetDeployment'
  params: {
    name: 'vnet-${environment}-${location}'
    addressPrefixes: ['10.0.0.0/16']
    subnets: [
      { name: 'snet-web', addressPrefix: '10.0.1.0/24' }
      { name: 'snet-db', addressPrefix: '10.0.2.0/24' }
    ]
  }
}

VM アプリ初期化 (Squid 例)

// Squid Proxy VM with cloud-init
module squidVm 'br/public:avm/res/compute/virtual-machine:0.13.0' = {
  name: 'squidVmDeployment'
  params: {
    name: 'vm-squid-${environment}'
    vmSize: 'Standard_B2s'
    osType: 'Linux'
    imageReference: {
      publisher: 'Canonical'
      offer: '0001-com-ubuntu-server-jammy'
      sku: '22_04-lts-gen2'
      version: 'latest'
    }
    // cloud-init でアプリ初期化
    customData: loadFileAsBase64('../scripts/cloud-init-squid.yaml')
  }
}

→ 詳細: references/vm-app-scripts.md

Step 4: CI/CD パイプライン生成

references/cicd-templates/ 参照

GitHub Actions

# .github/workflows/deploy-azure.yml
name: Deploy Azure Environment
on:
  push:
    branches: [main]
    paths: ["env/**/*.bicep"]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: azure/login@v2
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}
      - run: |
          az deployment group create \
            --resource-group ${{ vars.RESOURCE_GROUP }} \
            --template-file env/prod/bicep/main.bicep

Step 5: 検証 & デプロイ

# 検証 (what-if)
az deployment group what-if --resource-group <rg> --template-file main.bicep --parameters @parameters/<env>.json

# デプロイ
az deployment group create --resource-group <rg> --template-file main.bicep --parameters @parameters/<env>.json

Step 6: 結果出力

デプロイ完了後、以下を必ず出力:

## 🎉 デプロイ完了

| リソース        | 名前          | 状態     | 備考                  |
| --------------- | ------------- | -------- | --------------------- |
| ✅ VNet         | vnet-prod-jpe | 作成済み | Hub-Spoke             |
| ✅ Squid VM     | vm-squid-prod | 作成済み | Squid 3128 リッスン中 |
| ✅ App Service  | app-web-prod  | 作成済み | MI で SQL 接続        |
| ✅ SQL Database | sql-db-prod   | 作成済み | PE 経由アクセスのみ   |

### サービス間接続設定

| 接続元      | 接続先       | 認証方式           |
| ----------- | ------------ | ------------------ |
| App Service | SQL Database | Managed Identity   |
| App Service | Storage      | RBAC (Blob Reader) |

### Azure Portal リンク

- [リソースグループ](https://portal.azure.com/#@/resource/subscriptions/{subId}/resourceGroups/{rg}/overview)

📚 参照ファイル

コア

ファイル用途
references/hearing-checklist.md詳細ヒアリング項目
references/environment-template.md環境定義テンプレート
references/resource-patterns.mdリソース別構成パターン
references/review-checklist.mdレビュー確認事項

新機能

ファイル用途
references/architecture-patterns.mdHub-Spoke, AKS, AI 等のアーキテクチャ
references/avm-modules.mdAVM モジュールカタログ (200+)
references/vm-app-scripts.mdSquid/Nginx/Docker 等 VM 初期化スクリプト
references/app-deploy-patterns.mdApp Service/AKS/Container Apps デプロイ
references/service-config-templates.mdサービス間設定連携パターン
references/cicd-templates/GitHub Actions / Azure Pipelines

スクリプト

ファイル用途
scripts/scaffold_environment.ps1環境フォルダ生成
scripts/validate_bicep.ps1Bicep 検証
scripts/preview_cli.ps1CLI プレビュー