- Latest
- 2025-02-01-preview
- 2025-01-01
- 2024-11-01-preview
- 2024-05-01-preview
- 2023-08-01
- 2023-08-01-preview
- 2023-05-01-preview
- 2023-02-01-preview
- 2022-11-01-preview
- 2022-08-01-preview
- 2022-05-01-preview
- 2022-02-01-preview
- 2021-11-01
- 2021-11-01-preview
- 2021-08-01-preview
- 2021-05-01-preview
- 2021-02-01-preview
- 2020-11-01-preview
- 2020-08-01-preview
- 2020-02-02-preview
- 2019-06-01-preview
- 2017-10-01-preview
- 2017-03-01-preview
- 2014-04-01
Bicepリソースの定義
サーバー/データベースのリソースの種類は、次を対象とする操作でデプロイできます。
- リソース グループの - リソース グループのデプロイ コマンド 参照
各 API バージョンで変更されたプロパティの一覧については、変更ログの
リソースの形式
Microsoftを作るために。Sql/servers/databases リソースで、テンプレートに以下のBicepを追加してください。
resource symbolicname 'Microsoft.Sql/servers/databases@2014-04-01' = {
parent: resourceSymbolicName
location: 'string'
name: 'string'
properties: {
collation: 'string'
createMode: 'string'
edition: 'string'
elasticPoolName: 'string'
maxSizeBytes: 'string'
readScale: 'string'
recoveryServicesRecoveryPointResourceId: 'string'
requestedServiceObjectiveId: 'string'
requestedServiceObjectiveName: 'string'
restorePointInTime: 'string'
sampleName: 'string'
sourceDatabaseDeletionDate: 'string'
sourceDatabaseId: 'string'
zoneRedundant: bool
}
tags: {
{customized property}: 'string'
}
}
プロパティ値
Microsoft。SQL/サーバー/データベース
| Name | Description | Value |
|---|---|---|
| 位置 | リソースの場所。 | string (必須) |
| name | リソース名 | string (必須) |
| 親 | Bicepでは、子リソースの親リソースを指定することができます。 このプロパティを追加する必要があるのは、子リソースが親リソースの外部で宣言されている場合のみです。 詳細については、「親リソースの外部 |
種類のリソースのシンボリック名: サーバー |
| properties | リソースを表すプロパティ。 | DatabaseProperties |
| tags | リソース タグ | タグ名と値のディクショナリ。 テンプレート の |
DatabaseProperties
|名前 |説明 |値 | |---- |----------- |------------ | |照合順序 |データベースの照合順序。 createMode が Default でない場合、この値は無視されます。 |string | |createMode |データベースの作成モードを指定します。
既定値: 通常のデータベース作成。
コピー: 既存のデータベースのコピーとしてデータベースを作成します。 sourceDatabaseId は、ソース データベースのリソース ID として指定する必要があります。
OnlineSecondary/NonReadableSecondary: 既存のデータベースの (読み取り可能または読み取り不可能な) セカンダリ レプリカとしてデータベースを作成します。 sourceDatabaseId は、既存のプライマリ データベースのリソース ID として指定する必要があります。
PointInTimeRestore: 既存のデータベースの特定の時点のバックアップを復元してデータベースを作成します。 sourceDatabaseId を既存のデータベースのリソース ID として指定し、restorePointInTime を指定する必要があります。
復旧: geo レプリケートされたバックアップを復元してデータベースを作成します。 sourceDatabaseId は、復元する回復可能なデータベース リソース ID として指定する必要があります。
復元: 削除されたデータベースのバックアップを復元してデータベースを作成します。 sourceDatabaseId を指定する必要があります。 sourceDatabaseId がデータベースの元のリソース ID である場合は、sourceDatabaseDeletionDate を指定する必要があります。 それ以外の場合、sourceDatabaseId は復元可能な破棄されたデータベース リソース ID である必要があり、sourceDatabaseDeletionDate は無視されます。 restorePointInTime は、以前の時点から復元するように指定することもできます。
RestoreLongTermRetentionBackup: 長期保持コンテナーから復元することでデータベースを作成します。 recoveryServicesRecoveryPointResourceId は、復旧ポイントのリソース ID として指定する必要があります。
DataWarehouse エディションでは、Copy、NonReadableSecondary、OnlineSecondary、RestoreLongTermRetentionBackup はサポートされていません。 |「コピー」
'Default'
'NonReadableSecondary'
'OnlineSecondary'
'PointInTimeRestore'
'Recovery'
'Restore'
'RestoreLongTermRetentionBackup' | |edition |データベースのエディション。 DatabaseEditions 列挙には、すべての有効なエディションが含まれています。 createMode が NonReadableSecondary または OnlineSecondary の場合、この値は無視されます。
SKU の一覧は、リージョンとサポート プランによって異なる場合があります。 Azureリージョンでサブスクリプションで利用可能なSKU(SKU名、ティア/エディション、ファミリー、容量を含む)を特定するには、Capabilities_ListByLocation REST APIまたは以下のいずれかのコマンドを使用します。
azurecli<br />az sql db list-editions -l <location> -o table<br />````<br /><br />パワーシェル
Get-AzSqlServerServiceObjective -Location < location> | 'Basic'<br />'Business'<br />'BusinessCritical'<br />'DataWarehouse'<br />'Free'<br />'GeneralPurpose'<br />'Hyperscale'<br />'Premium'<br />'PremiumRS'<br />'Standard'<br />'Stretch'<br />'System'<br />'System2'<br />'Web' | | elasticPoolName | The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition. | string | | maxSizeBytes | The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." | string | | readScale | Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. | 'Disabled'<br />'Enabled' | | recoveryServicesRecoveryPointResourceId | Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from. | string | | requestedServiceObjectiveId | The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName.<br /><br />The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API. | string <br /><br />Constraints:<br />Min length = 36<br />Max length = 36<br />Pattern = `^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$` | | requestedServiceObjectiveName | The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. <br /><br />The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:<br /><br />```azurecli<br />az sql db list-editions -l <location> -o table<br />
```powershell
Get-AzSqlServerServiceObjective -Location < location>
```` |'Basic'
'DS100'
'DS1000'
'DS1200'
'DS1500'
'DS200'
'DS2000'
'DS300'
'DS400'
'DS500'
'DS600'
'DW100'
'DW1000'
'DW10000c'
'DW1000c'
'DW1200'
'DW1500'
'DW15000c'
'DW1500c'
'DW200'
'DW2000'
'DW2000c'
'DW2500c'
'DW300'
'DW3000'
'DW30000c'
'DW3000c'
'DW400'
'DW500'
'DW5000c'
'DW600'
'DW6000'
'DW6000c'
'DW7500c'
'ElasticPool'
'Free'
'P1'
'P11'
'P15'
'P2'
'P3'
'P4'
'P6'
'PRS1'
'PRS2'
'PRS4'
'PRS6'
'S0'
'S1'
'S12'
'S2'
'S3'
'S4'
'S6'
'S7'
'S9'
'System'
'System0'
'System1'
'System2'
'System2L'
'System3'
'System3L'
'System4'
'System4L' |restorePointInTime |条件付きの。 createMode が PointInTimeRestore の場合、この値は必須です。 createMode が Restore の場合、この値は省略可能です。 新しいデータベースを作成するために復元されるソース データベースの時点 (ISO8601形式) を指定します。 ソース データベースの earliestRestoreDate 値以上である必要があります。 |string | |sampleName |このデータベースの作成時に適用するサンプル スキーマの名前を示します。 createMode が Default でない場合、この値は無視されます。 DataWarehouse エディションではサポートされていません。 |'AdventureWorksLT' |sourceDatabaseDeletionDate |条件付きの。 createMode が Restore で、sourceDatabaseId が削除されたデータベースの元のリソース ID (現在の復元可能な削除されたデータベース ID ではなく) である場合、この値は必須です。 データベースが削除された時刻を指定します。 |string | |sourceDatabaseId |条件付きの。 createMode が Copy、NonReadableSecondary、OnlineSecondary、PointInTimeRestore、Recovery、または Restore の場合、この値は必須です。 ソース データベースのリソース ID を指定します。 createMode が NonReadableSecondary または OnlineSecondary の場合、ソース データベースの名前は、作成する新しいデータベースと同じである必要があります。 |string | |zoneRedundant |このデータベースがゾーン冗長かどうか。つまり、このデータベースのレプリカは複数の可用性ゾーンに分散されます。 |bool |
TrackedResourceTags
| Name | Description | Value |
|---|
使用例
Bicep サンプル
MS SQL Database のデプロイの基本的な例。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The administrator login password for the SQL server')
param administratorLoginPassword string
resource server 'Microsoft.Sql/servers@2021-02-01-preview' = {
name: resourceName
location: location
properties: {
administratorLogin: 'mradministrator'
administratorLoginPassword: null
minimalTlsVersion: '1.2'
publicNetworkAccess: 'Enabled'
restrictOutboundNetworkAccess: 'Disabled'
version: '12.0'
}
}
resource database 'Microsoft.Sql/servers/databases@2021-02-01-preview' = {
parent: server
name: resourceName
location: location
properties: {
autoPauseDelay: 0
createMode: 'Default'
elasticPoolId: ''
highAvailabilityReplicaCount: 0
isLedgerOn: false
licenseType: 'LicenseIncluded'
maintenanceConfigurationId: resourceId('Microsoft.Maintenance/publicMaintenanceConfigurations', 'SQL_Default')
minCapacity: 0
readScale: 'Disabled'
requestedBackupStorageRedundancy: 'Geo'
zoneRedundant: false
}
}
Azure Verified Modules
以下のAzure検証済みモジュールはこのリソースタイプの展開に使用できます。
| モジュール | Description |
|---|---|
| Azure SQL Database | AVM Resource Module for Azure SQL Database |
Azure Quickstart Samples
以下の Azure クイックスタートテンプレートには、このリソースタイプのデプロイのためのBicepサンプルが含まれています。
| Bicepファイル | Description |
|---|---|
| このテンプレートを使えば、監査を有効にしたAzure SQLサーバーを展開し、Log Analytics(OMSワークスペース)に監査ログを書き込むことができます | |
| SQL Serverとデータベースを作成 | このテンプレートを使用すると、SQL Database とサーバーを作成できます。 |
| Dedicated SQL pool with Transparent Encryption | SQL Serverと専用SQLプール(旧SQL DW)を作成し、Transparent Data Encryptionを使用します。 |
| ADLS Gen 2を有効にしたAzureストレージアカウント、ストレージアカウント用のリンクサービスを持つAzure Data Factoryインスタンス(展開されている場合はAzure SQL Database)、そしてAzure Databricksインスタンスを作成します。 テンプレートをデプロイするユーザーの AAD ID と ADF インスタンスのマネージド ID には、ストレージ アカウントのストレージ BLOB データ共同作成者ロールが付与されます。 また、Azure Key Vaultインスタンス、Azure SQL Database、ストリーミング利用のためのAzure Event Hubを展開するオプションもあります。 Azure Key Vaultが展開されると、テンプレートをデプロイするユーザーのData Factory管理IDとAADアイデンティティにKey Vault Secretsユーザーロールが付与されます。 | |
| プライベートエンドポイントの例 | このテンプレートはAzure SQL Serverを指すプライベートエンドポイントの作成方法を示しています |
| このテンプレートは、Web アプリ、SQL Database、自動スケール設定、アラート ルール、App Insights をプロビジョニングします。 ウェブアプリ内でデータベース用の接続文字列を設定します。 | |
| Sonarqube Docker Web App on Linux with Azure SQL | このテンプレートは、公式のSonarqubeイメージを使用し、Azure SQL ServerによってバックアップされたAzure App ServiceのWebアプリLinuxコンテナにSonarqubeをデプロイします。 |
| <マネージド・アイデンティティ、SQL Server、ΑΙWebアプリ> | Azure インフラストラクチャを app + data + managed identity + monitoring にデプロイするための簡単な例 |
ARM テンプレート リソース定義
サーバー/データベースのリソースの種類は、次を対象とする操作でデプロイできます。
- リソース グループの - リソース グループのデプロイ コマンド 参照
各 API バージョンで変更されたプロパティの一覧については、変更ログの
リソースの形式
Microsoftを作るために。SQL/servers/databasesリソース、テンプレートに以下のJSONを追加してください。
{
"type": "Microsoft.Sql/servers/databases",
"apiVersion": "2014-04-01",
"name": "string",
"location": "string",
"properties": {
"collation": "string",
"createMode": "string",
"edition": "string",
"elasticPoolName": "string",
"maxSizeBytes": "string",
"readScale": "string",
"recoveryServicesRecoveryPointResourceId": "string",
"requestedServiceObjectiveId": "string",
"requestedServiceObjectiveName": "string",
"restorePointInTime": "string",
"sampleName": "string",
"sourceDatabaseDeletionDate": "string",
"sourceDatabaseId": "string",
"zoneRedundant": "bool"
},
"tags": {
"{customized property}": "string"
}
}
プロパティ値
Microsoft。SQL/サーバー/データベース
| Name | Description | Value |
|---|---|---|
| apiVersion | API のバージョン | '2014-04-01' |
| 位置 | リソースの場所。 | string (必須) |
| name | リソース名 | string (必須) |
| properties | リソースを表すプロパティ。 | DatabaseProperties |
| tags | リソース タグ | タグ名と値のディクショナリ。 テンプレート の |
| 型 | リソースの種類 | 「Microsoft。SQL/サーバー/データベース |
DatabaseProperties
|名前 |説明 |値 | |---- |----------- |------------ | |照合順序 |データベースの照合順序。 createMode が Default でない場合、この値は無視されます。 |string | |createMode |データベースの作成モードを指定します。
既定値: 通常のデータベース作成。
コピー: 既存のデータベースのコピーとしてデータベースを作成します。 sourceDatabaseId は、ソース データベースのリソース ID として指定する必要があります。
OnlineSecondary/NonReadableSecondary: 既存のデータベースの (読み取り可能または読み取り不可能な) セカンダリ レプリカとしてデータベースを作成します。 sourceDatabaseId は、既存のプライマリ データベースのリソース ID として指定する必要があります。
PointInTimeRestore: 既存のデータベースの特定の時点のバックアップを復元してデータベースを作成します。 sourceDatabaseId を既存のデータベースのリソース ID として指定し、restorePointInTime を指定する必要があります。
復旧: geo レプリケートされたバックアップを復元してデータベースを作成します。 sourceDatabaseId は、復元する回復可能なデータベース リソース ID として指定する必要があります。
復元: 削除されたデータベースのバックアップを復元してデータベースを作成します。 sourceDatabaseId を指定する必要があります。 sourceDatabaseId がデータベースの元のリソース ID である場合は、sourceDatabaseDeletionDate を指定する必要があります。 それ以外の場合、sourceDatabaseId は復元可能な破棄されたデータベース リソース ID である必要があり、sourceDatabaseDeletionDate は無視されます。 restorePointInTime は、以前の時点から復元するように指定することもできます。
RestoreLongTermRetentionBackup: 長期保持コンテナーから復元することでデータベースを作成します。 recoveryServicesRecoveryPointResourceId は、復旧ポイントのリソース ID として指定する必要があります。
DataWarehouse エディションでは、Copy、NonReadableSecondary、OnlineSecondary、RestoreLongTermRetentionBackup はサポートされていません。 |「コピー」
'Default'
'NonReadableSecondary'
'OnlineSecondary'
'PointInTimeRestore'
'Recovery'
'Restore'
'RestoreLongTermRetentionBackup' | |edition |データベースのエディション。 DatabaseEditions 列挙には、すべての有効なエディションが含まれています。 createMode が NonReadableSecondary または OnlineSecondary の場合、この値は無視されます。
SKU の一覧は、リージョンとサポート プランによって異なる場合があります。 Azureリージョンでサブスクリプションで利用可能なSKU(SKU名、ティア/エディション、ファミリー、容量を含む)を特定するには、Capabilities_ListByLocation REST APIまたは以下のいずれかのコマンドを使用します。
azurecli<br />az sql db list-editions -l <location> -o table<br />````<br /><br />パワーシェル
Get-AzSqlServerServiceObjective -Location < location> | 'Basic'<br />'Business'<br />'BusinessCritical'<br />'DataWarehouse'<br />'Free'<br />'GeneralPurpose'<br />'Hyperscale'<br />'Premium'<br />'PremiumRS'<br />'Standard'<br />'Stretch'<br />'System'<br />'System2'<br />'Web' | | elasticPoolName | The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition. | string | | maxSizeBytes | The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." | string | | readScale | Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. | 'Disabled'<br />'Enabled' | | recoveryServicesRecoveryPointResourceId | Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from. | string | | requestedServiceObjectiveId | The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName.<br /><br />The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API. | string <br /><br />Constraints:<br />Min length = 36<br />Max length = 36<br />Pattern = `^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$` | | requestedServiceObjectiveName | The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. <br /><br />The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:<br /><br />```azurecli<br />az sql db list-editions -l <location> -o table<br />
```powershell
Get-AzSqlServerServiceObjective -Location < location>
```` |'Basic'
'DS100'
'DS1000'
'DS1200'
'DS1500'
'DS200'
'DS2000'
'DS300'
'DS400'
'DS500'
'DS600'
'DW100'
'DW1000'
'DW10000c'
'DW1000c'
'DW1200'
'DW1500'
'DW15000c'
'DW1500c'
'DW200'
'DW2000'
'DW2000c'
'DW2500c'
'DW300'
'DW3000'
'DW30000c'
'DW3000c'
'DW400'
'DW500'
'DW5000c'
'DW600'
'DW6000'
'DW6000c'
'DW7500c'
'ElasticPool'
'Free'
'P1'
'P11'
'P15'
'P2'
'P3'
'P4'
'P6'
'PRS1'
'PRS2'
'PRS4'
'PRS6'
'S0'
'S1'
'S12'
'S2'
'S3'
'S4'
'S6'
'S7'
'S9'
'System'
'System0'
'System1'
'System2'
'System2L'
'System3'
'System3L'
'System4'
'System4L' |restorePointInTime |条件付きの。 createMode が PointInTimeRestore の場合、この値は必須です。 createMode が Restore の場合、この値は省略可能です。 新しいデータベースを作成するために復元されるソース データベースの時点 (ISO8601形式) を指定します。 ソース データベースの earliestRestoreDate 値以上である必要があります。 |string | |sampleName |このデータベースの作成時に適用するサンプル スキーマの名前を示します。 createMode が Default でない場合、この値は無視されます。 DataWarehouse エディションではサポートされていません。 |'AdventureWorksLT' |sourceDatabaseDeletionDate |条件付きの。 createMode が Restore で、sourceDatabaseId が削除されたデータベースの元のリソース ID (現在の復元可能な削除されたデータベース ID ではなく) である場合、この値は必須です。 データベースが削除された時刻を指定します。 |string | |sourceDatabaseId |条件付きの。 createMode が Copy、NonReadableSecondary、OnlineSecondary、PointInTimeRestore、Recovery、または Restore の場合、この値は必須です。 ソース データベースのリソース ID を指定します。 createMode が NonReadableSecondary または OnlineSecondary の場合、ソース データベースの名前は、作成する新しいデータベースと同じである必要があります。 |string | |zoneRedundant |このデータベースがゾーン冗長かどうか。つまり、このデータベースのレプリカは複数の可用性ゾーンに分散されます。 |bool |
TrackedResourceTags
| Name | Description | Value |
|---|
使用例
Azure Quickstart Templates
以下のAzureクイックスタートテンプレートはこのリソースタイプを展開します。
| Template | Description |
|---|---|
| このテンプレートを使えば、監査を有効にしたAzure SQLサーバーを展開し、Log Analytics(OMSワークスペース)に監査ログを書き込むことができます | |
|
SQL Serverとデータベースを作成 |
このテンプレートを使用すると、SQL Database とサーバーを作成できます。 |
|
Dedicated SQL pool with Transparent Encryption |
SQL Serverと専用SQLプール(旧SQL DW)を作成し、Transparent Data Encryptionを使用します。 |
|
新しいSQLエラスティックプールをデプロイ |
このテンプレートにより、新しいSQL Serverや割り当て可能な新しいSQLデータベースを備えた新しいSQLエラスティックプールを展開できます。 |
| ADLS Gen 2を有効にしたAzureストレージアカウント、ストレージアカウント用のリンクサービスを持つAzure Data Factoryインスタンス(展開されている場合はAzure SQL Database)、そしてAzure Databricksインスタンスを作成します。 テンプレートをデプロイするユーザーの AAD ID と ADF インスタンスのマネージド ID には、ストレージ アカウントのストレージ BLOB データ共同作成者ロールが付与されます。 また、Azure Key Vaultインスタンス、Azure SQL Database、ストリーミング利用のためのAzure Event Hubを展開するオプションもあります。 Azure Key Vaultが展開されると、テンプレートをデプロイするユーザーのData Factory管理IDとAADアイデンティティにKey Vault Secretsユーザーロールが付与されます。 | |
| このテンプレートを使用すると、カスタム Ambari DB と Hive Metastore の両方として機能する新しい SQL DB を使用して、既存の仮想ネットワークに HDInsight クラスターを作成できます。 既存の SQL Sever、ストレージ アカウント、VNET が必要です。 | |
|
プライベートエンドポイントの例 |
このテンプレートはAzure SQL Serverを指すプライベートエンドポイントの作成方法を示しています |
| このテンプレートは、Web アプリ、SQL Database、自動スケール設定、アラート ルール、App Insights をプロビジョニングします。 ウェブアプリ内でデータベース用の接続文字列を設定します。 | |
|
リモート デスクトップ 高可用性サービス |
このARMテンプレートのサンプルコードは、リモート デスクトップ Services 2019 Session Collectionラボを高可用性で展開します。 目標は、Windows Server 2019を用いて、完全に冗長で高可用性のリモート デスクトップ Servicesソリューションを展開することです。 |
|
Sonarqube Docker Web App on Linux with Azure SQL |
このテンプレートは、公式のSonarqubeイメージを使用し、Azure SQL ServerによってバックアップされたAzure App ServiceのWebアプリLinuxコンテナにSonarqubeをデプロイします。 |
| <マネージド・アイデンティティ、SQL Server、ΑΙWebアプリ> |
Azure インフラストラクチャを app + data + managed identity + monitoring にデプロイするための簡単な例 |
| このテンプレートは、Azure SQL Serverを指すプライベートエンドポイントを消費するWebアプリの作成方法を示しています |
Terraform (AzAPI プロバイダー) リソース定義
サーバー/データベースのリソースの種類は、次を対象とする操作でデプロイできます。
- リソース グループ
各 API バージョンで変更されたプロパティの一覧については、変更ログの
リソースの形式
Microsoftを作るために。SQL/servers/databasesリソースで、テンプレートに以下のTerraformを追加してください。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Sql/servers/databases@2014-04-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
collation = "string"
createMode = "string"
edition = "string"
elasticPoolName = "string"
maxSizeBytes = "string"
readScale = "string"
recoveryServicesRecoveryPointResourceId = "string"
requestedServiceObjectiveId = "string"
requestedServiceObjectiveName = "string"
restorePointInTime = "string"
sampleName = "string"
sourceDatabaseDeletionDate = "string"
sourceDatabaseId = "string"
zoneRedundant = bool
}
}
}
プロパティ値
Microsoft。SQL/サーバー/データベース
| Name | Description | Value |
|---|---|---|
| 位置 | リソースの場所。 | string (必須) |
| name | リソース名 | string (必須) |
| parent_id | このリソースの親であるリソースの ID。 | 種類のリソースの ID: サーバー |
| properties | リソースを表すプロパティ。 | DatabaseProperties |
| tags | リソース タグ | タグ名と値のディクショナリ。 |
| 型 | リソースの種類 | 「Microsoft。Sql/servers/databases@2014-04-01" |
DatabaseProperties
|名前 |説明 |値 | |---- |----------- |------------ | |照合順序 |データベースの照合順序。 createMode が Default でない場合、この値は無視されます。 |string | |createMode |データベースの作成モードを指定します。
既定値: 通常のデータベース作成。
コピー: 既存のデータベースのコピーとしてデータベースを作成します。 sourceDatabaseId は、ソース データベースのリソース ID として指定する必要があります。
OnlineSecondary/NonReadableSecondary: 既存のデータベースの (読み取り可能または読み取り不可能な) セカンダリ レプリカとしてデータベースを作成します。 sourceDatabaseId は、既存のプライマリ データベースのリソース ID として指定する必要があります。
PointInTimeRestore: 既存のデータベースの特定の時点のバックアップを復元してデータベースを作成します。 sourceDatabaseId を既存のデータベースのリソース ID として指定し、restorePointInTime を指定する必要があります。
復旧: geo レプリケートされたバックアップを復元してデータベースを作成します。 sourceDatabaseId は、復元する回復可能なデータベース リソース ID として指定する必要があります。
復元: 削除されたデータベースのバックアップを復元してデータベースを作成します。 sourceDatabaseId を指定する必要があります。 sourceDatabaseId がデータベースの元のリソース ID である場合は、sourceDatabaseDeletionDate を指定する必要があります。 それ以外の場合、sourceDatabaseId は復元可能な破棄されたデータベース リソース ID である必要があり、sourceDatabaseDeletionDate は無視されます。 restorePointInTime は、以前の時点から復元するように指定することもできます。
RestoreLongTermRetentionBackup: 長期保持コンテナーから復元することでデータベースを作成します。 recoveryServicesRecoveryPointResourceId は、復旧ポイントのリソース ID として指定する必要があります。
DataWarehouse エディションでは、Copy、NonReadableSecondary、OnlineSecondary、RestoreLongTermRetentionBackup はサポートされていません。 |「コピー」
'Default'
'NonReadableSecondary'
'OnlineSecondary'
'PointInTimeRestore'
'Recovery'
'Restore'
'RestoreLongTermRetentionBackup' | |edition |データベースのエディション。 DatabaseEditions 列挙には、すべての有効なエディションが含まれています。 createMode が NonReadableSecondary または OnlineSecondary の場合、この値は無視されます。
SKU の一覧は、リージョンとサポート プランによって異なる場合があります。 Azureリージョンでサブスクリプションで利用可能なSKU(SKU名、ティア/エディション、ファミリー、容量を含む)を特定するには、Capabilities_ListByLocation REST APIまたは以下のいずれかのコマンドを使用します。
azurecli<br />az sql db list-editions -l <location> -o table<br />````<br /><br />パワーシェル
Get-AzSqlServerServiceObjective -Location < location> | 'Basic'<br />'Business'<br />'BusinessCritical'<br />'DataWarehouse'<br />'Free'<br />'GeneralPurpose'<br />'Hyperscale'<br />'Premium'<br />'PremiumRS'<br />'Standard'<br />'Stretch'<br />'System'<br />'System2'<br />'Web' | | elasticPoolName | The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition. | string | | maxSizeBytes | The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." | string | | readScale | Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. | 'Disabled'<br />'Enabled' | | recoveryServicesRecoveryPointResourceId | Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from. | string | | requestedServiceObjectiveId | The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName.<br /><br />The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API. | string <br /><br />Constraints:<br />Min length = 36<br />Max length = 36<br />Pattern = `^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$` | | requestedServiceObjectiveName | The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. <br /><br />The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:<br /><br />```azurecli<br />az sql db list-editions -l <location> -o table<br />
```powershell
Get-AzSqlServerServiceObjective -Location < location>
```` |'Basic'
'DS100'
'DS1000'
'DS1200'
'DS1500'
'DS200'
'DS2000'
'DS300'
'DS400'
'DS500'
'DS600'
'DW100'
'DW1000'
'DW10000c'
'DW1000c'
'DW1200'
'DW1500'
'DW15000c'
'DW1500c'
'DW200'
'DW2000'
'DW2000c'
'DW2500c'
'DW300'
'DW3000'
'DW30000c'
'DW3000c'
'DW400'
'DW500'
'DW5000c'
'DW600'
'DW6000'
'DW6000c'
'DW7500c'
'ElasticPool'
'Free'
'P1'
'P11'
'P15'
'P2'
'P3'
'P4'
'P6'
'PRS1'
'PRS2'
'PRS4'
'PRS6'
'S0'
'S1'
'S12'
'S2'
'S3'
'S4'
'S6'
'S7'
'S9'
'System'
'System0'
'System1'
'System2'
'System2L'
'System3'
'System3L'
'System4'
'System4L' |restorePointInTime |条件付きの。 createMode が PointInTimeRestore の場合、この値は必須です。 createMode が Restore の場合、この値は省略可能です。 新しいデータベースを作成するために復元されるソース データベースの時点 (ISO8601形式) を指定します。 ソース データベースの earliestRestoreDate 値以上である必要があります。 |string | |sampleName |このデータベースの作成時に適用するサンプル スキーマの名前を示します。 createMode が Default でない場合、この値は無視されます。 DataWarehouse エディションではサポートされていません。 |'AdventureWorksLT' |sourceDatabaseDeletionDate |条件付きの。 createMode が Restore で、sourceDatabaseId が削除されたデータベースの元のリソース ID (現在の復元可能な削除されたデータベース ID ではなく) である場合、この値は必須です。 データベースが削除された時刻を指定します。 |string | |sourceDatabaseId |条件付きの。 createMode が Copy、NonReadableSecondary、OnlineSecondary、PointInTimeRestore、Recovery、または Restore の場合、この値は必須です。 ソース データベースのリソース ID を指定します。 createMode が NonReadableSecondary または OnlineSecondary の場合、ソース データベースの名前は、作成する新しいデータベースと同じである必要があります。 |string | |zoneRedundant |このデータベースがゾーン冗長かどうか。つまり、このデータベースのレプリカは複数の可用性ゾーンに分散されます。 |bool |
TrackedResourceTags
| Name | Description | Value |
|---|
使用例
Terraformサンプル
MS SQL Database のデプロイの基本的な例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
variable "administrator_login_password" {
type = string
description = "The administrator login password for the SQL server"
sensitive = true
}
data "azurerm_client_config" "current" {
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "server" {
type = "Microsoft.Sql/servers@2021-02-01-preview"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
administratorLogin = "mradministrator"
administratorLoginPassword = var.administrator_login_password
minimalTlsVersion = "1.2"
publicNetworkAccess = "Enabled"
restrictOutboundNetworkAccess = "Disabled"
version = "12.0"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
data "azapi_resource_id" "publicMaintenanceConfiguration" {
type = "Microsoft.Maintenance/publicMaintenanceConfigurations@2023-04-01"
parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"
name = "SQL_Default"
}
resource "azapi_resource" "database" {
type = "Microsoft.Sql/servers/databases@2021-02-01-preview"
parent_id = azapi_resource.server.id
name = var.resource_name
location = var.location
body = {
properties = {
autoPauseDelay = 0
createMode = "Default"
elasticPoolId = ""
highAvailabilityReplicaCount = 0
isLedgerOn = false
licenseType = "LicenseIncluded"
maintenanceConfigurationId = data.azapi_resource_id.publicMaintenanceConfiguration.id
minCapacity = 0
readScale = "Disabled"
requestedBackupStorageRedundancy = "Geo"
zoneRedundant = false
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
MS SQL Database のデプロイの基本的な例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
variable "administrator_login_password" {
type = string
description = "The administrator login password for the SQL server"
sensitive = true
}
data "azurerm_client_config" "current" {
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "server" {
type = "Microsoft.Sql/servers@2021-02-01-preview"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
administratorLogin = "mradministrator"
administratorLoginPassword = var.administrator_login_password
minimalTlsVersion = "1.2"
publicNetworkAccess = "Enabled"
restrictOutboundNetworkAccess = "Disabled"
version = "12.0"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
data "azapi_resource_id" "publicMaintenanceConfiguration" {
type = "Microsoft.Maintenance/publicMaintenanceConfigurations@2023-04-01"
parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"
name = "SQL_Default"
}
resource "azapi_resource" "database" {
type = "Microsoft.Sql/servers/databases@2021-02-01-preview"
parent_id = azapi_resource.server.id
name = var.resource_name
location = var.location
body = {
properties = {
autoPauseDelay = 0
createMode = "Default"
elasticPoolId = ""
highAvailabilityReplicaCount = 0
isLedgerOn = false
licenseType = "LicenseIncluded"
maintenanceConfigurationId = data.azapi_resource_id.publicMaintenanceConfiguration.id
minCapacity = 0
readScale = "Disabled"
requestedBackupStorageRedundancy = "Geo"
zoneRedundant = false
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}