Microsoft. Sql servers/databases 2014-04-01

Bicep 자원 정의

서버/데이터베이스 리소스 종류는 다음을 대상으로 하는 작업으로 배포할 수 있습니다.

각 API 버전에서 변경된 속성 목록은 변경 로그참조하세요.

리소스 형식

Microsoft를 만드는 것. Sql/서버/데이터베이스 리소스, 템플릿에 다음 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
location 리소스 위치입니다. string(필수)
name 리소스 이름 string(필수)
parent Bicep에서는 자식 리소스의 부모 리소스를 지정할 수 있습니다. 자식 리소스가 부모 리소스 외부에서 선언된 경우에만 이 속성을 추가해야 합니다.

자세한 내용은 부모 리소스외부의 자식 리소스 참조하세요.
형식 리소스의 기호 이름: 서버
properties 리소스를 나타내는 속성입니다. DatabaseProperties
tags 리소스 태그 태그 이름 및 값의 사전입니다. 템플릿 태그를 참조하세요.

DatabaseProperties

| 이름 | 설명 | 값 | | ---- | ----------- | ------------ | | 데이터 정렬 | 데이터베이스의 데이터 정렬입니다. createMode가 기본값이 아닌 경우 이 값은 무시됩니다. | string | | createMode | 데이터베이스 만들기 모드를 지정합니다.

기본값: 일반 데이터베이스 만들기.

복사: 기존 데이터베이스의 복사본으로 데이터베이스를 만듭니다. sourceDatabaseId는 원본 데이터베이스의 리소스 ID로 지정해야 합니다.

OnlineSecondary/NonReadableSecondary: 기존 데이터베이스의 (읽기 가능하거나 읽을 수 없는) 보조 복제본으로 데이터베이스를 만듭니다. sourceDatabaseId는 기존 주 데이터베이스의 리소스 ID로 지정해야 합니다.

PointInTimeRestore: 기존 데이터베이스의 특정 시점 백업을 복원하여 데이터베이스를 만듭니다. sourceDatabaseId는 기존 데이터베이스의 리소스 ID로 지정해야 하며 restorePointInTime을 지정해야 합니다.

복구: 지역에서 복제된 백업을 복원하여 데이터베이스를 만듭니다. 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' | | 버전 | 데이터베이스의 버전입니다. DatabaseEditions 열거형에는 유효한 모든 버전이 포함됩니다. createMode가 NonReadableSecondary 또는 OnlineSecondary이면 이 값은 무시됩니다.

SKU 목록은 지역 및 지원 제품에 따라 다를 수 있습니다. Azure 지역에서 구독에 이용 가능한 SKU(SKU 이름, 티어/에디션, 패밀리, 용량 포함)를 확인하려면 Capabilities_ListByLocation REST API 또는 다음 명령어 중 하나를 사용하세요:

azurecli<br />az sql db list-editions -l &lt;location&gt; -o table<br />````<br /><br />파워쉘
<Get-AzSqlServerServiceObjective -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 &lt;location&gt; -o table<br />

```powershell
<Get-AzSqlServerServiceObjective -Location 위치>
```` | '기본'
'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가 기본값이 아닌 경우 이 값은 무시됩니다. DataWarehouse 버전에서는 지원되지 않습니다. | 'AdventureWorksLT' | | sourceDatabaseDeletionDate | 조건부. createMode가 Restore이고 sourceDatabaseId가 존재할 때 삭제된 데이터베이스의 원래 리소스 ID인 경우(현재 복원 가능한 삭제된 데이터베이스 ID와는 달리) 이 값이 필요합니다. 데이터베이스가 삭제된 시간을 지정합니다. | string | | sourceDatabaseId | 조건부. createMode가 Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery 또는 Restore인 경우 이 값이 필요합니다. 원본 데이터베이스의 리소스 ID를 지정합니다. createMode가 NonReadableSecondary 또는 OnlineSecondary인 경우 원본 데이터베이스의 이름은 생성되는 새 데이터베이스와 동일해야 합니다. | string | | zoneRedundant | 이 데이터베이스가 영역 중복인지 여부입니다. 즉, 이 데이터베이스의 복제본이 여러 가용성 영역에 분산됩니다. | 부울 |

TrackedResourceTags

Name Description Value

사용 예제

Bicep 샘플

MS SQL Database 배포의 기본 예입니다.

@secure()
@description('The administrator login password for the SQL server')
param administratorLoginPassword string
param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource server 'Microsoft.Sql/servers@2021-02-01-preview' = {
  name: resourceName
  location: location
  properties: {
    administratorLogin: 'mradministrator'
    administratorLoginPassword: administratorLoginPassword
    minimalTlsVersion: '1.2'
    publicNetworkAccess: 'Enabled'
    restrictOutboundNetworkAccess: 'Disabled'
    version: '12.0'
  }
}

resource database 'Microsoft.Sql/servers/databases@2021-02-01-preview' = {
  name: resourceName
  location: location
  parent: server
  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 Server 감사는 Log Analytics 이 템플릿은 감사가 활성화된 Azure SQL 서버를 배포하여 Log Analytics(OMS workspace)에 감사 로그를 작성할 수 있게 해줍니다
SQL Server 및 데이터베이스 생성 이 템플릿을 사용하면 SQL Database 및 서버를 만들 수 있습니다.
투명 암호화가 적용된 전용 SQL 풀 SQL Server와 전용 SQL 풀(이전 명칭: SQL DW)을 생성하여 투명한 데이터 암호화을 지원합니다.
Azure 아키텍처 ADLS Gen 2가 활성화된 Azure 스토리지 계정을 생성하고, 스토리지 계정과 연결된 서비스가 있는 Azure Data Factory 인스턴스(배포 시 Azure SQL Database 포함), 그리고 Azure Databricks 인스턴스를 생성합니다. 템플릿을 배포하는 사용자의 AAD ID와 ADF 인스턴스의 관리 ID에는 스토리지 계정에 대한 Storage Blob 데이터 기여자 역할이 부여됩니다. 또한 Azure Key Vault 인스턴스, Azure SQL Database, 스트리밍 사용 사례용 Azure Event Hub를 배포하는 옵션도 있습니다. Azure Key Vault가 배포되면, 템플릿을 배포하는 사용자의 데이터 팩토리 관리 신원과 AAD 신원에 Key Vault Secrets 사용자 역할이 부여됩니다.
프라이빗 엔드포인트 예시 이 템플릿은 Azure SQL Server를 가리키는 개인 엔드포인트를 만드는 방법을 보여줍니다
SQL 데이터베이스로 웹 앱 프로비저닝 이 템플릿은 웹앱, SQL Database, 자동 크기 조정 설정, 경고 규칙 및 App Insights를 프로비전합니다. 웹 앱에서 데이터베이스용 연결 문자열을 구성합니다.
Sonarqube Docker Web App on Linux with Azure SQL 이 템플릿은 공식 Sonarqube 이미지를 사용해 Azure App Service 웹 앱 Linux 컨테이너에 Sonarqube를 배포하고 Azure SQL Server로 백업합니다.
웹 앱, 관리 신원, SQL Server 및 ΑΙ 앱 + 데이터 + 관리 신원 + 모니터링을 위한 Azure 인프라를 배포하는 간단한 예시입니다

ARM 템플릿 리소스 정의

서버/데이터베이스 리소스 종류는 다음을 대상으로 하는 작업으로 배포할 수 있습니다.

각 API 버전에서 변경된 속성 목록은 변경 로그참조하세요.

리소스 형식

Microsoft를 만드는 것. SQL/서버/데이터베이스 리소스, 템플릿에 다음 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'
location 리소스 위치입니다. string(필수)
name 리소스 이름 string(필수)
properties 리소스를 나타내는 속성입니다. DatabaseProperties
tags 리소스 태그 태그 이름 및 값의 사전입니다. 템플릿 태그를 참조하세요.
type 리소스 종류 'Microsoft. SQL/서버/데이터베이스'

DatabaseProperties

| 이름 | 설명 | 값 | | ---- | ----------- | ------------ | | 데이터 정렬 | 데이터베이스의 데이터 정렬입니다. createMode가 기본값이 아닌 경우 이 값은 무시됩니다. | string | | createMode | 데이터베이스 만들기 모드를 지정합니다.

기본값: 일반 데이터베이스 만들기.

복사: 기존 데이터베이스의 복사본으로 데이터베이스를 만듭니다. sourceDatabaseId는 원본 데이터베이스의 리소스 ID로 지정해야 합니다.

OnlineSecondary/NonReadableSecondary: 기존 데이터베이스의 (읽기 가능하거나 읽을 수 없는) 보조 복제본으로 데이터베이스를 만듭니다. sourceDatabaseId는 기존 주 데이터베이스의 리소스 ID로 지정해야 합니다.

PointInTimeRestore: 기존 데이터베이스의 특정 시점 백업을 복원하여 데이터베이스를 만듭니다. sourceDatabaseId는 기존 데이터베이스의 리소스 ID로 지정해야 하며 restorePointInTime을 지정해야 합니다.

복구: 지역에서 복제된 백업을 복원하여 데이터베이스를 만듭니다. 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' | | 버전 | 데이터베이스의 버전입니다. DatabaseEditions 열거형에는 유효한 모든 버전이 포함됩니다. createMode가 NonReadableSecondary 또는 OnlineSecondary이면 이 값은 무시됩니다.

SKU 목록은 지역 및 지원 제품에 따라 다를 수 있습니다. Azure 지역에서 구독에 이용 가능한 SKU(SKU 이름, 티어/에디션, 패밀리, 용량 포함)를 확인하려면 Capabilities_ListByLocation REST API 또는 다음 명령어 중 하나를 사용하세요:

azurecli<br />az sql db list-editions -l &lt;location&gt; -o table<br />````<br /><br />파워쉘
<Get-AzSqlServerServiceObjective -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 &lt;location&gt; -o table<br />

```powershell
<Get-AzSqlServerServiceObjective -Location 위치>
```` | '기본'
'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가 기본값이 아닌 경우 이 값은 무시됩니다. DataWarehouse 버전에서는 지원되지 않습니다. | 'AdventureWorksLT' | | sourceDatabaseDeletionDate | 조건부. createMode가 Restore이고 sourceDatabaseId가 존재할 때 삭제된 데이터베이스의 원래 리소스 ID인 경우(현재 복원 가능한 삭제된 데이터베이스 ID와는 달리) 이 값이 필요합니다. 데이터베이스가 삭제된 시간을 지정합니다. | string | | sourceDatabaseId | 조건부. createMode가 Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery 또는 Restore인 경우 이 값이 필요합니다. 원본 데이터베이스의 리소스 ID를 지정합니다. createMode가 NonReadableSecondary 또는 OnlineSecondary인 경우 원본 데이터베이스의 이름은 생성되는 새 데이터베이스와 동일해야 합니다. | string | | zoneRedundant | 이 데이터베이스가 영역 중복인지 여부입니다. 즉, 이 데이터베이스의 복제본이 여러 가용성 영역에 분산됩니다. | 부울 |

TrackedResourceTags

Name Description Value

사용 예제

Azure Quickstart Templates

다음 Azure 퀵스타트 템플릿이 이 리소스 유형을 배포합니다.

Template Description
Azure SQL Server 감사는 Log Analytics

Azure
이 템플릿은 감사가 활성화된 Azure SQL 서버를 배포하여 Log Analytics(OMS workspace)에 감사 로그를 작성할 수 있게 해줍니다
SQL Server 및 데이터베이스 생성

Azure
이 템플릿을 사용하면 SQL Database 및 서버를 만들 수 있습니다.
투명 암호화가 적용된 전용 SQL 풀

Azure
SQL Server와 전용 SQL 풀(이전 명칭: SQL DW)을 생성하여 투명한 데이터 암호화을 지원합니다.
새로운 SQL Elastic Pool

Azure
이 템플릿을 통해 새로운 SQL Elastic Pool과 그에 새로 연관된 SQL Server, 그리고 할당할 새로운 SQL 데이터베이스를 배포할 수 있습니다.
Azure 아키텍처

Azure
ADLS Gen 2가 활성화된 Azure 스토리지 계정을 생성하고, 스토리지 계정과 연결된 서비스가 있는 Azure Data Factory 인스턴스(배포 시 Azure SQL Database 포함), 그리고 Azure Databricks 인스턴스를 생성합니다. 템플릿을 배포하는 사용자의 AAD ID와 ADF 인스턴스의 관리 ID에는 스토리지 계정에 대한 Storage Blob 데이터 기여자 역할이 부여됩니다. 또한 Azure Key Vault 인스턴스, Azure SQL Database, 스트리밍 사용 사례용 Azure Event Hub를 배포하는 옵션도 있습니다. Azure Key Vault가 배포되면, 템플릿을 배포하는 사용자의 데이터 팩토리 관리 신원과 AAD 신원에 Key Vault Secrets 사용자 역할이 부여됩니다.
HDInsight에서 VNET

Azure
이 템플릿을 사용하면 사용자 지정 Ambari DB 및 Hive Metastore 역할을 하는 새 SQL DB를 사용하여 기존 가상 네트워크에 HDInsight 클러스터를 만들 수 있습니다. 기존 SQL Sever, 스토리지 계정 및 VNET이 있어야 합니다.
프라이빗 엔드포인트 예시

Azure
이 템플릿은 Azure SQL Server를 가리키는 개인 엔드포인트를 만드는 방법을 보여줍니다
SQL 데이터베이스로 웹 앱 프로비저닝

Azure
이 템플릿은 웹앱, SQL Database, 자동 크기 조정 설정, 경고 규칙 및 App Insights를 프로비전합니다. 웹 앱에서 데이터베이스용 연결 문자열을 구성합니다.
원격 데스크톱 고가용성 서비스

Azure
이 ARM 템플릿 샘플 코드는 고가용성으로 원격 데스크톱 Services 2019 세션 컬렉션 랩을 배포할 것입니다. 목표는 Windows Server 2019를 사용하여 완전 중복되고 고가용성 솔루션인 원격 데스크톱 서비스를 배포하는 것입니다.
Sonarqube Docker Web App on Linux with Azure SQL

Azure
이 템플릿은 공식 Sonarqube 이미지를 사용해 Azure App Service 웹 앱 Linux 컨테이너에 Sonarqube를 배포하고 Azure SQL Server로 백업합니다.
웹 앱, 관리 신원, SQL Server 및 ΑΙ

Azure
앱 + 데이터 + 관리 신원 + 모니터링을 위한 Azure 인프라를 배포하는 간단한 예시입니다
WebApp이 Azure SQL 프라이빗 엔드포인트

Azure
이 템플릿은 Azure SQL Server를 가리키는 프라이비시 엔드포인트를 사용하는 웹 앱을 만드는 방법을 보여줍니다

Terraform(AzAPI 공급자) 리소스 정의

서버/데이터베이스 리소스 종류는 다음을 대상으로 하는 작업으로 배포할 수 있습니다.

  • 리소스 그룹

각 API 버전에서 변경된 속성 목록은 변경 로그참조하세요.

리소스 형식

Microsoft를 만드는 것. SQL/서버/데이터베이스 리소스, 템플릿에 다음 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
location 리소스 위치입니다. string(필수)
name 리소스 이름 string(필수)
parent_id 이 리소스의 부모인 리소스의 ID입니다. 유형의 리소스에 대한 ID: 서버
properties 리소스를 나타내는 속성입니다. DatabaseProperties
tags 리소스 태그 태그 이름 및 값의 사전입니다.
type 리소스 종류 "Microsoft. Sql/servers/databases@2014-04-01"

DatabaseProperties

| 이름 | 설명 | 값 | | ---- | ----------- | ------------ | | 데이터 정렬 | 데이터베이스의 데이터 정렬입니다. createMode가 기본값이 아닌 경우 이 값은 무시됩니다. | string | | createMode | 데이터베이스 만들기 모드를 지정합니다.

기본값: 일반 데이터베이스 만들기.

복사: 기존 데이터베이스의 복사본으로 데이터베이스를 만듭니다. sourceDatabaseId는 원본 데이터베이스의 리소스 ID로 지정해야 합니다.

OnlineSecondary/NonReadableSecondary: 기존 데이터베이스의 (읽기 가능하거나 읽을 수 없는) 보조 복제본으로 데이터베이스를 만듭니다. sourceDatabaseId는 기존 주 데이터베이스의 리소스 ID로 지정해야 합니다.

PointInTimeRestore: 기존 데이터베이스의 특정 시점 백업을 복원하여 데이터베이스를 만듭니다. sourceDatabaseId는 기존 데이터베이스의 리소스 ID로 지정해야 하며 restorePointInTime을 지정해야 합니다.

복구: 지역에서 복제된 백업을 복원하여 데이터베이스를 만듭니다. 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' | | 버전 | 데이터베이스의 버전입니다. DatabaseEditions 열거형에는 유효한 모든 버전이 포함됩니다. createMode가 NonReadableSecondary 또는 OnlineSecondary이면 이 값은 무시됩니다.

SKU 목록은 지역 및 지원 제품에 따라 다를 수 있습니다. Azure 지역에서 구독에 이용 가능한 SKU(SKU 이름, 티어/에디션, 패밀리, 용량 포함)를 확인하려면 Capabilities_ListByLocation REST API 또는 다음 명령어 중 하나를 사용하세요:

azurecli<br />az sql db list-editions -l &lt;location&gt; -o table<br />````<br /><br />파워쉘
<Get-AzSqlServerServiceObjective -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 &lt;location&gt; -o table<br />

```powershell
<Get-AzSqlServerServiceObjective -Location 위치>
```` | '기본'
'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가 기본값이 아닌 경우 이 값은 무시됩니다. DataWarehouse 버전에서는 지원되지 않습니다. | 'AdventureWorksLT' | | sourceDatabaseDeletionDate | 조건부. createMode가 Restore이고 sourceDatabaseId가 존재할 때 삭제된 데이터베이스의 원래 리소스 ID인 경우(현재 복원 가능한 삭제된 데이터베이스 ID와는 달리) 이 값이 필요합니다. 데이터베이스가 삭제된 시간을 지정합니다. | string | | sourceDatabaseId | 조건부. createMode가 Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery 또는 Restore인 경우 이 값이 필요합니다. 원본 데이터베이스의 리소스 ID를 지정합니다. createMode가 NonReadableSecondary 또는 OnlineSecondary인 경우 원본 데이터베이스의 이름은 생성되는 새 데이터베이스와 동일해야 합니다. | string | | zoneRedundant | 이 데이터베이스가 영역 중복인지 여부입니다. 즉, 이 데이터베이스의 복제본이 여러 가용성 영역에 분산됩니다. | 부울 |

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    = ["*"]
}