トレーニング
モジュール
Bicep と Azure Pipelines を使用して複数の環境を管理する - Training
Bicep IaC テンプレートのためのデプロイ パイプラインを作成します。 パイプライン テンプレート YAML ファイルを使用して、複数の環境にデプロイします。 パイプラインから環境特有のパラメーターを指定する方法について学びます。
このブラウザーはサポートされなくなりました。
Microsoft Edge にアップグレードすると、最新の機能、セキュリティ更新プログラム、およびテクニカル サポートを利用できます。
ADE 環境定義は、Bicep または Terraform で記述されたコードとしてのインフラストラクチャ (IaC) であり、リポジトリに格納されます。 環境定義は、特定の要件に合わせて変更および調整してから、Azure 上にデプロイ環境を作成するために使用できます。 environment.yaml スキーマは、環境定義に含まれる Azure リソースの種類を定義し、説明します。
environment.yaml ファイルはマニフェストとして機能し、使用されるリソースと環境定義のテンプレートの場所を記述します。
次のスクリプトは、環境定義に必要な environment.yaml の一般的な例です。
name: WebApp
version: 1.0.0
summary: Azure Web App Environment
description: Deploys a web app in Azure without a datastore
runner: ARM
templatePath: azuredeploy.json
次の表では、environment.yaml で使用できるプロパティについて説明します。
プロパティ | Type | 説明 | 必須 | 使用例 |
---|---|---|---|---|
name | string | カタログ アイテムの表示名。 | はい | |
version | string | カタログ アイテムのバージョン。 | 1.0.0 | |
まとめ | string | カタログ アイテムに関する短い概要文字列。 | ||
description | string | カタログ アイテムの説明。 | ||
ランナー | string | アクションの実行時に使用するコンテナー イメージ。 | ARM テンプレート Terraform |
|
templatePath | string | エントリ テンプレート ファイルの相対パス。 | はい | メイン.tf メイン.bicep azuredeploy.json |
parameters | 配列 | 環境を作成し、アクションを実行するときに使用する入力パラメーター。 | #/definitions/Parameter |
パラメーターを使用すると、さまざまなシナリオで環境定義を再利用できます。 たとえば、異なるリージョンの開発者に同じ環境をデプロイさせる場合があります。 location パラメーターを定義して、開発者が環境を作成するときに目的の場所を入力するように求めることができます。
次のスクリプトは、2 つのパラメーターを含む environment.yaml ファイルの例です。 location
and name
:
name: WebApp
summary: Azure Web App Environment
description: Deploys a web app in Azure without a datastore
runner: ARM
templatePath: azuredeploy.json
parameters:
- id: "location"
name: "location"
description: "Location to deploy the environment resources"
default: "[resourceGroup().location]"
type: "string"
required: false
- id: "name"
name: "name"
description: "Name of the Web App "
default: ""
type: "string"
required: false
次の表では、environment.yaml で使用できるデータ型について説明します。 environment.yaml マニフェスト ファイルで使用されるデータ型名は、ARM テンプレートで使用される名前とは異なります。
各パラメーターでは、次のいずれかのプロパティを使用できます。
プロパティ | Type | 説明 | その他の設定 |
---|---|---|---|
id | string | パラメーターの一意の ID。 | |
name | string | パラメーターの表示名。 | |
description | string | パラメーターの説明。 | |
default | 配列 ブール値 の整数 オブジェクト 文字列 |
パラメーターの既定値。 | |
型 | 配列 ブール値 の整数 オブジェクト 文字列 |
パラメーターのデータ型です。 このデータ型は、ARM テンプレート、BICEP ファイル、または Terraform ファイル内のパラメーター データ型と対応するパラメーター名と一致する必要があります。 | 既定の型: string |
readOnly | boolean | このパラメーターが読み取り専用かどうか。 | |
必須 | boolean | このパラメーターが必要かどうか。 | |
[許可] | 配列 | 使用できる値の配列。 | "items": { "type": "string" }, "minItems": 1, "uniqueItems": true, |
Azure Deployment Environment environment.yaml ファイルのスキーマが定義されており、これらのファイルの編集が少し簡単になります。 スキーマ定義は、environment.yaml ファイルの先頭に追加できます。
# yaml-language-server: $schema=https://github.com/Azure/deployment-environments/releases/download/2022-11-11-preview/manifest.schema.json
スキーマを使用する環境定義の例を次に示します。
# yaml-language-server: $schema=https://github.com/Azure/deployment-environments/releases/download/2022-11-11-preview/manifest.schema.json
name: FunctionApp
version: 1.0.0
summary: Azure Function App Environment
description: Deploys an Azure Function App, Storage Account, and Application Insights
runner: ARM
templatePath: azuredeploy.json
parameters:
- id: name
name: Name
description: 'Name of the Function App.'
type: string
required: true
- id: supportsHttpsTrafficOnly
name: 'Supports HTTPS Traffic Only'
description: 'Allows https traffic only to Storage Account and Functions App if set to true.'
type: boolean
- id: runtime
name: Runtime
description: 'The language worker runtime to load in the function app.'
type: string
allowed:
- 'dotnet'
- 'dotnet-isolated'
- 'java'
- 'node'
- 'powershell'
- 'python'
default: 'dotnet-isolated'
トレーニング
モジュール
Bicep と Azure Pipelines を使用して複数の環境を管理する - Training
Bicep IaC テンプレートのためのデプロイ パイプラインを作成します。 パイプライン テンプレート YAML ファイルを使用して、複数の環境にデプロイします。 パイプラインから環境特有のパラメーターを指定する方法について学びます。
ドキュメント
Azure Deployment Environments カタログの構築に関するベスト プラクティス - Azure Deployment Environments
この記事では、効率的なキャッシュのための Azure Deployment Environments カタログの構築に関するガイドラインを示します。
デプロイ環境を作成する - Azure Deployment Environments
開発者ポータルを使用して、Azure Deployment Environments プロジェクトで環境を作成してアクセスする方法について説明します。 環境には、アプリケーションをデプロイするためのすべての Azure リソースが事前構成されています。
Azure CLI を使用して環境を作成してアクセスする - Azure Deployment Environments
Azure CLI を使用して、Azure Deployment Environments プロジェクトで環境を作成してアクセスする方法について説明します。