你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
- 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
- 2015-05-01-preview
- 2014-04-01
Bicep资源定义
可以使用目标操作部署服务器资源类型:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
去创造一个Microsoft。Sql/服务器资源,给你的模板添加以下 Bicep。
resource symbolicname 'Microsoft.Sql/servers@2025-02-01-preview' = {
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
location: 'string'
name: 'string'
properties: {
administratorLogin: 'string'
administratorLoginPassword: 'string'
administrators: {
administratorType: 'string'
azureADOnlyAuthentication: bool
login: 'string'
principalType: 'string'
sid: 'string'
tenantId: 'string'
}
createMode: 'string'
federatedClientId: 'string'
isIPv6Enabled: 'string'
keyId: 'string'
minimalTlsVersion: 'string'
primaryUserAssignedIdentityId: 'string'
publicNetworkAccess: 'string'
restrictOutboundNetworkAccess: 'string'
retentionDays: int
version: 'string'
}
tags: {
{customized property}: 'string'
}
}
属性值
Microsoft。SQL/服务器
| Name | Description | Value |
|---|---|---|
| 标识 | 服务器的Azure Active Directory身份。 | ResourceIdentity |
| 位置 | 资源所在的地理位置 | string (必需) |
| name | 资源名称 | string (必需) |
| properties | 资源属性。 | ServerProperties |
| tags | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 |
ResourceIdentity
| Name | Description | Value |
|---|---|---|
| 类型 | 标识类型。 将此设置为“SystemAssigned”,以便自动创建并分配该资源的 Azure Active Directory 主体。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | 要使用的用户分配标识的资源 ID | ResourceIdentityUserAssignedIdentities |
ResourceIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
ServerExternalAdministrator
| Name | Description | Value |
|---|---|---|
| administratorType | 服务器管理员的类型。 | 'ActiveDirectory' |
| azureADOnlyAuthentication | Azure Active Directory 仅启用认证。 | bool |
| login | 服务器管理员的登录名。 | 字符串 |
| principalType | 服务器管理员的主体类型。 | 'Application' 'Group' 'User' |
| sid | 服务器管理员的 SID (对象 ID)。 | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| tenantId | 管理员的租户 ID。 | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
ServerProperties
| Name | Description | Value |
|---|---|---|
| administratorLogin | 服务器的管理员用户名。 创建后,无法更改它。 | 字符串 |
| administratorLoginPassword | 管理员登录密码(创建服务器时需要)。 | string Constraints: 敏感值。 以安全参数的形式传入。 |
| administrators | 除了 azureADOnlyAuthentication 属性外,Azure Active Directory 管理员可以在服务器创建和服务器更新时使用。 若要更新 azureADOnlyAuthentication 属性,必须使用单个 API。 | ServerExternalAdministrator |
| createMode | 服务器的创建模式,只有有效的值是 正常 和 恢复。 | 'Normal' 'Restore' |
| federatedClientId | 用于跨租户 CMK 方案的客户端 ID | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| isIPv6Enabled | 是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” | 'Disabled' 'Enabled' |
| keyId | 要用于加密的密钥的 CMK URI。 | 字符串 |
| minimalTlsVersion | 最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3” | '1.0' '1.1' '1.2' '1.3' 'None' |
| primaryUserAssignedIdentityId | 默认情况下要使用的用户分配标识的资源 ID。 | 字符串 |
| publicNetworkAccess | 是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter” | 'Disabled' 'Enabled' 'SecuredByPerimeter' |
| restrictOutboundNetworkAccess | 是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” | 'Disabled' 'Enabled' |
| retentionDays | 此服务器将保持软删除的天数。 | int |
| 版本 | 服务器的版本。 | 字符串 |
TrackedResourceTags
| Name | Description | Value |
|---|
UserIdentity
| Name | Description | Value |
|---|
用法示例
Bicep 样本
部署 Microsoft SQL Azure 数据库服务器的基本示例。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The administrator password for the SQL server')
param sqlAdministratorPassword 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'
}
}
Azure verified modules
以下 Azure 验证模块可用于部署该资源类型。
| Module | Description |
|---|---|
| Azure SQL Server (Azure SQL 数据库服务器) | AVM Resource Module for Azure SQL Server |
Azure 快速入门示例
以下Azure快速启动模板包含部署该资源类型的Bicep示例。
| Bicep 文件 | Description |
|---|---|
| 该模板允许您部署启用审计功能的 Azure SQL 服务器,将审计日志写入 Log Analytics(OMS 工作空间) | |
| 创建SQL Server和数据库 | 使用此模板可以创建 SQL 数据库和服务器。 |
| 专用SQL池,采用透明加密 | 创建一个SQL Server和一个专用SQL池(前称SQL DW),并采用Transparent Data Encryption。 |
| 创建一个启用 ADLS Gen 2 的 Azure 存储账户,创建一个带有关联服务的 Azure Data Factory 实例(如果部署了则是 Azure SQL Database),以及一个 Azure Databricks 实例。 将为部署模板的用户的 AAD 标识以及 ADF 实例的托管标识授予存储帐户上的存储 Blob 数据参与者角色。 还有部署 Azure Key Vault 实例、Azure SQL Database 和 Azure Event Hub(用于流式使用场景)的选项。 当 Azure Key Vault 部署时,部署该模板的用户的数据工厂管理身份和 AAD 身份将被授予 Key Vault Secrets 用户角色。 | |
| 私有端点示例 | 这个模板展示了如何创建指向 Azure SQL Server 的私有端点 |
| 为一个带有SQL数据库的Web应用配置 | 此模板预配 Web 应用、SQL 数据库、自动缩放设置、警报规则和 App Insights。 它在网页应用中为数据库配置一个connection string。 |
| 此模板使用官方 Sonarqube 映像并由 Azure SQL Server 支持,部署于 Azure App Service web app Linux 容器中。 | |
| SQL 逻辑服务器 | 使用此模板可以创建 SQL 逻辑服务器。 |
| Web 应用,支持托管身份、SQL Server 和 ΑΙ | 部署 Azure 基础设施用于应用 + 数据 + 管理身份 + 监控的简单示例 |
ARM 模板资源定义
可以使用目标操作部署服务器资源类型:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
去创造一个Microsoft。Sql/服务器资源,在模板中添加以下JSON。
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2025-02-01-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"location": "string",
"properties": {
"administratorLogin": "string",
"administratorLoginPassword": "string",
"administrators": {
"administratorType": "string",
"azureADOnlyAuthentication": "bool",
"login": "string",
"principalType": "string",
"sid": "string",
"tenantId": "string"
},
"createMode": "string",
"federatedClientId": "string",
"isIPv6Enabled": "string",
"keyId": "string",
"minimalTlsVersion": "string",
"primaryUserAssignedIdentityId": "string",
"publicNetworkAccess": "string",
"restrictOutboundNetworkAccess": "string",
"retentionDays": "int",
"version": "string"
},
"tags": {
"{customized property}": "string"
}
}
属性值
Microsoft。SQL/服务器
| Name | Description | Value |
|---|---|---|
| apiVersion | API 版本 | “2025-02-01-预览” |
| 标识 | 服务器的Azure Active Directory身份。 | ResourceIdentity |
| 位置 | 资源所在的地理位置 | string (必需) |
| name | 资源名称 | string (必需) |
| properties | 资源属性。 | ServerProperties |
| tags | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 |
| 类型 | 资源类型 | “Microsoft。Sql/servers' |
ResourceIdentity
| Name | Description | Value |
|---|---|---|
| 类型 | 标识类型。 将此设置为“SystemAssigned”,以便自动创建并分配该资源的 Azure Active Directory 主体。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | 要使用的用户分配标识的资源 ID | ResourceIdentityUserAssignedIdentities |
ResourceIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
ServerExternalAdministrator
| Name | Description | Value |
|---|---|---|
| administratorType | 服务器管理员的类型。 | 'ActiveDirectory' |
| azureADOnlyAuthentication | Azure Active Directory 仅启用认证。 | bool |
| login | 服务器管理员的登录名。 | 字符串 |
| principalType | 服务器管理员的主体类型。 | 'Application' 'Group' 'User' |
| sid | 服务器管理员的 SID (对象 ID)。 | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| tenantId | 管理员的租户 ID。 | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
ServerProperties
| Name | Description | Value |
|---|---|---|
| administratorLogin | 服务器的管理员用户名。 创建后,无法更改它。 | 字符串 |
| administratorLoginPassword | 管理员登录密码(创建服务器时需要)。 | string Constraints: 敏感值。 以安全参数的形式传入。 |
| administrators | 除了 azureADOnlyAuthentication 属性外,Azure Active Directory 管理员可以在服务器创建和服务器更新时使用。 若要更新 azureADOnlyAuthentication 属性,必须使用单个 API。 | ServerExternalAdministrator |
| createMode | 服务器的创建模式,只有有效的值是 正常 和 恢复。 | 'Normal' 'Restore' |
| federatedClientId | 用于跨租户 CMK 方案的客户端 ID | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| isIPv6Enabled | 是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” | 'Disabled' 'Enabled' |
| keyId | 要用于加密的密钥的 CMK URI。 | 字符串 |
| minimalTlsVersion | 最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3” | '1.0' '1.1' '1.2' '1.3' 'None' |
| primaryUserAssignedIdentityId | 默认情况下要使用的用户分配标识的资源 ID。 | 字符串 |
| publicNetworkAccess | 是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter” | 'Disabled' 'Enabled' 'SecuredByPerimeter' |
| restrictOutboundNetworkAccess | 是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” | 'Disabled' 'Enabled' |
| retentionDays | 此服务器将保持软删除的天数。 | int |
| 版本 | 服务器的版本。 | 字符串 |
TrackedResourceTags
| Name | Description | Value |
|---|
UserIdentity
| Name | Description | Value |
|---|
用法示例
Azure 快速入门模板
以下Azure快速启动模板部署了这种资源类型。
| Template | Description |
|---|---|
|
App Service Environment 后端Azure SQL 后端 |
该模板创建了一个带有 Azure SQL 后端的 App Service Environment,以及私有端点和通常用于私有/隔离环境中的相关资源。 |
|
自动缩放 LANSA Windows VM ScaleSet Azure SQL Database |
该模板部署一个 Windows VMSS,并在规模集中设置所需的虚拟机数量,并安装一个 LANSA MSI。 部署 VM 规模集后,将使用自定义脚本扩展安装 LANSA MSI) |
|
Azure SQL Server,审计写入blob存储 |
这个模板允许你部署启用审计功能的 Azure SQL 服务器,将审计日志写入 blob 存储 |
|
Azure SQL Server 审计写信给 Event Hub |
这个模板允许你部署启用审计功能的 Azure SQL 服务器,将审计日志写入事件中心 |
| 该模板允许您部署启用审计功能的 Azure SQL 服务器,将审计日志写入 Log Analytics(OMS 工作空间) | |
|
创建SQL Server和数据库 |
使用此模板可以创建 SQL 数据库和服务器。 |
| 该模板创建一个带有 Redis 缓存和 SQL 数据库的 Azure Web 应用。 | |
|
创建一个Azure SQL Server,带有数据加密保护器 |
该模板创建一个 Azure SQL 服务器,使用存储在指定 Key Vault 中的指定密钥激活数据加密保护器 |
|
创建Azure SQL服务器和数据库,使用故障切换组 |
创建两个 Azure SQL 服务器、一个数据库和一个故障转移组。 |
|
创建、配置并部署Web应用到Azure VM的虚拟机 |
创建并配置一个带有 SQL Azure 数据库的 Windows 虚拟机,并使用 PowerShell DSC 向环境中部署 Web 应用 |
|
专用SQL池,采用透明加密 |
创建一个SQL Server和一个专用SQL池(前称SQL DW),并采用Transparent Data Encryption。 |
|
部署HDInsight集群和SQL数据库 |
使用此模板可以创建 HDInsight 群集和用于测试 Sqoop 的 SQL 数据库。 |
|
部署新的SQL弹性池, |
该模板允许您部署一个新的SQL弹性池,并配备新的关联SQL Server和新的SQL数据库以分配到它。 |
|
部署章鱼部署3.0,使用试用许可证 |
使用此模板,可以使用试用许可证部署单个 Octopus Deploy 3.0 服务器。 该系统将部署在单一的 Windows Server 2012R2 虚拟机(标准 D2)和 SQL DB(S1 层)上,部署到资源组指定的位置。 |
| 创建一个启用 ADLS Gen 2 的 Azure 存储账户,创建一个带有关联服务的 Azure Data Factory 实例(如果部署了则是 Azure SQL Database),以及一个 Azure Databricks 实例。 将为部署模板的用户的 AAD 标识以及 ADF 实例的托管标识授予存储帐户上的存储 Blob 数据参与者角色。 还有部署 Azure Key Vault 实例、Azure SQL Database 和 Azure Event Hub(用于流式使用场景)的选项。 当 Azure Key Vault 部署时,部署该模板的用户的数据工厂管理身份和 AAD 身份将被授予 Key Vault Secrets 用户角色。 | |
|
带SQL数据库的Django应用 |
该模板使用 Azure Linux CustomScript 扩展来部署应用程序。 这个例子是创建一个Ubuntu虚拟机,静默安装Python、Django和Apache,然后创建一个简单的Django应用。 该模板还创建一个 SQL 数据库,其中包含一些示例数据,这些示例数据使用查询在 Web 浏览器中显示 |
|
Enterprise Governance-AppService, SQL DB, AD, OMS, Runbooks |
企业(小型或大型)的云采用需要负责任的高效治理模型才能从其云部署中派生价值。 CloudWise(该解决方案的代号)是Azure Partner QuickStarts提供的复合解决方案,是客户、系统集成商和合作伙伴的采用促进器,提供一个自助、自动化治理和运营解决方案,专注于优化成本、提升应用可靠性、降低业务风险。 该解决方案重点介绍了可见性和控制的核心治理支柱。 |
| 该模板允许您创建 Azure 中 EpiServerCMS 部署所需的资源 | |
|
eShop网站,配备ILB ASE |
App Service Environment 是 Azure App Service 的一种高级服务计划选项,提供一个完全隔离且专用的环境,用于大规模安全地运行 Azure App Service 应用,包括 Web Apps、Mobile Apps 和 API 应用。 |
|
Kentico 体验 |
该模板便于部署托管 Kentico Xperience 环境所需的资源,用于在 Microsoft Azure 中运行。 |
| 该Azure Database Migration Service(DMS)旨在简化本地数据库迁移到Azure的流程。 DMS将简化现有本地SQL Server和Oracle数据库迁移到Azure SQL Database、Azure SQL Managed Instance或Microsoft SQL Server的Azure虚拟机迁移过程。 该模板将部署一个 Azure Database Migration service 实例,一个安装了 SQL 服务器的 Azure 虚拟机,作为源服务器,内置预建数据库,以及一个 Target Azure SQL 数据库服务器,后者将预设数据库模式,从源服务器迁移到目标服务器。 该模板还将部署所需的资源,例如 NIC、vnet 等,以支持源 VM、DMS 服务和目标服务器。 | |
|
Orchard CMS 视频门户网页应用 |
该模板为启用并配置Azure Media Services模块后,在Azure App Service Web Apps上部署Orchard CMS提供了便捷方式。 |
|
私有端点示例 |
这个模板展示了如何创建指向 Azure SQL Server 的私有端点 |
|
Provision a Mobile App with a SQL Database |
此模板预配移动应用、SQL 数据库和通知中心。 它在移动应用中为数据库和通知中心配置一个connection string。 |
| 该模板配置了一个SQL Server,并为Azure流量打开了防火墙,并配备了Transparent Data Encryption(TDE)的SQL数据库。 | |
|
为一个带有SQL数据库的Web应用配置 |
此模板预配 Web 应用、SQL 数据库、自动缩放设置、警报规则和 App Insights。 它在网页应用中为数据库配置一个connection string。 |
|
Remote Desktop 高可用性服务 |
该 ARM 模板示例代码将部署一个高可用性的 Remote Desktop服务 2019 会话集合实验室。 目标是部署一个完全冗余、高可用性的 Remote Desktop 服务解决方案,使用 Windows Server 2019。 |
|
可扩展的Umbraco CMS Web App |
该模板为Azure App Service Web Apps上部署 Umbraco CMS 网页应用提供了简便方法。 |
|
简单 Umbraco CMS 网页应用 |
该模板为Azure App Service Web Apps上部署 Umbraco CMS 网页应用提供了简便方法。 |
| 此模板使用官方 Sonarqube 映像并由 Azure SQL Server 支持,部署于 Azure App Service web app Linux 容器中。 | |
|
SQL 逻辑服务器 |
使用此模板可以创建 SQL 逻辑服务器。 |
|
SQL 服务器,仅Azure AD 认证 |
这个模板允许你在 Azure 中创建 SQL 服务器,同时启用 Azure AD 管理员设置和仅 Azure AD 认证功能。 |
|
Web 应用,包含 SQL 数据库、Azure Cosmos DB、Azure 搜索 |
该模板可提供Web App、SQL数据库、Azure Cosmos DB、Azure Search和Application Insights。 |
|
Web 应用,支持托管身份、SQL Server 和 ΑΙ |
部署 Azure 基础设施用于应用 + 数据 + 管理身份 + 监控的简单示例 |
|
WebApp正在消耗Azure SQL私有端点 |
该模板展示了如何创建一个使用指向 Azure SQL Server 私有端点的 Web 应用 |
Terraform (AzAPI 提供程序)资源定义
可以使用目标操作部署服务器资源类型:
- 资源组
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
去创造一个Microsoft。Sql/服务器资源,将以下Terraform添加到你的模板中。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Sql/servers@2025-02-01-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
administratorLogin = "string"
administratorLoginPassword = "string"
administrators = {
administratorType = "string"
azureADOnlyAuthentication = bool
login = "string"
principalType = "string"
sid = "string"
tenantId = "string"
}
createMode = "string"
federatedClientId = "string"
isIPv6Enabled = "string"
keyId = "string"
minimalTlsVersion = "string"
primaryUserAssignedIdentityId = "string"
publicNetworkAccess = "string"
restrictOutboundNetworkAccess = "string"
retentionDays = int
version = "string"
}
}
}
属性值
Microsoft。SQL/服务器
| Name | Description | Value |
|---|---|---|
| 标识 | 服务器的Azure Active Directory身份。 | ResourceIdentity |
| 位置 | 资源所在的地理位置 | string (必需) |
| name | 资源名称 | string (必需) |
| properties | 资源属性。 | ServerProperties |
| tags | 资源标记 | 标记名称和值的字典。 |
| 类型 | 资源类型 | “Microsoft。Sql/servers@2025-02-01-preview” |
ResourceIdentity
| Name | Description | Value |
|---|---|---|
| 类型 | 标识类型。 将此设置为“SystemAssigned”,以便自动创建并分配该资源的 Azure Active Directory 主体。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | 要使用的用户分配标识的资源 ID | ResourceIdentityUserAssignedIdentities |
ResourceIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
ServerExternalAdministrator
| Name | Description | Value |
|---|---|---|
| administratorType | 服务器管理员的类型。 | 'ActiveDirectory' |
| azureADOnlyAuthentication | Azure Active Directory 仅启用认证。 | bool |
| login | 服务器管理员的登录名。 | 字符串 |
| principalType | 服务器管理员的主体类型。 | 'Application' 'Group' 'User' |
| sid | 服务器管理员的 SID (对象 ID)。 | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| tenantId | 管理员的租户 ID。 | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
ServerProperties
| Name | Description | Value |
|---|---|---|
| administratorLogin | 服务器的管理员用户名。 创建后,无法更改它。 | 字符串 |
| administratorLoginPassword | 管理员登录密码(创建服务器时需要)。 | string Constraints: 敏感值。 以安全参数的形式传入。 |
| administrators | 除了 azureADOnlyAuthentication 属性外,Azure Active Directory 管理员可以在服务器创建和服务器更新时使用。 若要更新 azureADOnlyAuthentication 属性,必须使用单个 API。 | ServerExternalAdministrator |
| createMode | 服务器的创建模式,只有有效的值是 正常 和 恢复。 | 'Normal' 'Restore' |
| federatedClientId | 用于跨租户 CMK 方案的客户端 ID | string Constraints: 最小长度 = 36 最大长度 = 36 图案 = ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ |
| isIPv6Enabled | 是否为此服务器启用 IPv6 支持。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” | 'Disabled' 'Enabled' |
| keyId | 要用于加密的密钥的 CMK URI。 | 字符串 |
| minimalTlsVersion | 最低 TLS 版本。 允许的值:“None”、“1.0”、“1.1”、“1.2”、“1.3” | '1.0' '1.1' '1.2' '1.3' 'None' |
| primaryUserAssignedIdentityId | 默认情况下要使用的用户分配标识的资源 ID。 | 字符串 |
| publicNetworkAccess | 是否允许对此服务器使用公共终结点访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled”或“SecuredByPerimeter” | 'Disabled' 'Enabled' 'SecuredByPerimeter' |
| restrictOutboundNetworkAccess | 是否限制此服务器的出站网络访问。 值是可选的,但如果传入,则必须为“Enabled”或“Disabled” | 'Disabled' 'Enabled' |
| retentionDays | 此服务器将保持软删除的天数。 | int |
| 版本 | 服务器的版本。 | 字符串 |
TrackedResourceTags
| Name | Description | Value |
|---|
UserIdentity
| Name | Description | Value |
|---|
用法示例
Terraform 示例
部署 Microsoft SQL Azure 数据库服务器的基本示例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
variable "sql_administrator_password" {
type = string
description = "The administrator password for the SQL server"
sensitive = true
}
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.sql_administrator_password
minimalTlsVersion = "1.2"
publicNetworkAccess = "Enabled"
restrictOutboundNetworkAccess = "Disabled"
version = "12.0"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
Azure verified modules
以下 Azure 验证模块可用于部署该资源类型。
| Module | Description |
|---|---|
| Azure SQL Server (Azure SQL 数据库服务器) | AVM Resource Module for Azure SQL Server |