{"canonical_url":"https://engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/","content_markdown":"# Azureインフラをコードとして構築\n\nBicepで、開発・ステージング・本番の各環境に、Container Apps、PostgreSQL Flexible Server、Front Door/WAF、ネットワークを含むAzureインフラをコードとして構築した。\n\n2025\n\n**状況.** プラットフォームはAzure上で動いていた。ポータルをクリックし個別に設定を変える手動運用は、ずれを生み、理由の記憶が失われ、障害後の再構築が遅く不安なものになる。複数環境をそろえる必要があれば、問題はさらに大きくなる。\n\n**課題.** 手動状態の山ではなく、読んでレビューし、再現できる環境とするため、全体をコードにする必要があった。\n\n**行動.** Bicepで環境を定義した。テスト、ステージング、本番は同じテンプレートから作る。管理環境上のAzure Container Appsで動くapi・www、PostgreSQL Flexible Server、キャッシュ用Redis、WAF方針付きFront Door、VNet・NSG・プライベートDNSのネットワークを含め、診断用Log Analyticsも接続した。イメージはプロジェクトのAzure Container Registryから取得する。すべてパラメーター化し、環境の新設・変更を、自分へのサポート依頼でなくpull requestにした。\n\n**結果.** 再現とレビューが可能になった。正本はコードにあり、不一致は謎でなくなった。前回クリックした内容を思い出す代わりに、テンプレート適用で構築・復旧できる。インフラに振り回されるのでなく、自ら管理できる状態となった。\n\n---\n\n- 役割: DevOpsエンジニア\n- カテゴリー: [プラットフォーム設計](https://platform.engineer.company/ja/categories/platform-architecture/), [DevOps](https://platform.engineer.company/ja/categories/devops/), [インフラ](https://platform.engineer.company/ja/categories/infrastructure/), [クラウド](https://platform.engineer.company/ja/categories/cloud/), [自動化・CI/CD](https://platform.engineer.company/ja/categories/automation/), [信頼性・バックアップ](https://platform.engineer.company/ja/categories/reliability/), [ネットワーク・VPN](https://platform.engineer.company/ja/categories/networking/), [セキュリティ](https://platform.engineer.company/ja/categories/security/)\n- サービス: [クラウドインフラ・移行](https://platform.engineer.company/ja/services/cloud-infrastructure/), [コードによるインフラ管理](https://platform.engineer.company/ja/services/infrastructure-as-code/), [ネットワーク・VPN構築](https://platform.engineer.company/ja/services/networking-vpn/), [セキュリティ・アクセス管理](https://platform.engineer.company/ja/services/security-access/)\n\n\u003chttps://engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/\u003e\n","date_modified":"2026-11-09T21:50:25Z","description":"BicepでContainer Apps、PostgreSQL、Front Door/WAFなどのAzureインフラをコード化し、開発・ステージング・本番で再現可能にした。","formats":{"gemtext":"https://platform.engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/index.gmi","gopher":"https://platform.engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/gophermap","html":"https://platform.engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/","json":"https://platform.engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/index.json","markdown":"https://platform.engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/index.md","pdf":"https://platform.engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/index.pdf"},"kind":"page","language":"ja","title":"Azureインフラをコードとして構築","url":"https://platform.engineer.company/ja/portfolio/provisioned-azure-infrastructure-as-code/","version":1}