你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Domains - Create Or Update

创建或更新域的说明。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}?api-version=2024-11-01

URI 参数

名称 必需 类型 说明
domainName
path True

string

pattern: [a-zA-Z0-9][a-zA-Z0-9\.-]+

域的名称。

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[-\w\._\(\)]+[^\.]$

资源所属的资源组的名称。

subscriptionId
path True

string

Azure 订阅 ID。 这是 GUID 格式的字符串(例如 000000000-0000-0000-0000-00000000000000)。

api-version
query True

string

API 版本

请求正文

名称 必需 类型 说明
location True

string

资源位置。

properties.consent True

DomainPurchaseConsent

法律协议同意。

properties.contactAdmin True

Contact

管理联系人。

properties.contactBilling True

Contact

计费联系人。

properties.contactRegistrant True

Contact

注册联系人。

properties.contactTech True

Contact

技术联系人。

kind

string

资源类型。 如果资源是应用,可以参考 https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference 了解类型支持的详细信息值。

properties.authCode

string

properties.autoRenew

boolean

如果域应自动续订,true;否则,false

properties.dnsType

DnsType

当前 DNS 类型

properties.dnsZoneId

string

要使用的 Azure DNS 区域

properties.privacy

boolean

如果为此域启用了域隐私,则 true;否则,false

properties.targetDnsType

DnsType

目标 DNS 类型(将用于迁移)

tags

object

资源标记。

响应

名称 类型 说明
200 OK

Domain

域购买成功。

202 Accepted

Domain

域购买正在进行中。

Other Status Codes

DefaultErrorResponse

应用服务错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create App Service Domain

示例请求

PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com?api-version=2024-11-01

{
  "location": "global",
  "tags": {},
  "properties": {
    "authCode": "exampleAuthCode",
    "privacy": false,
    "autoRenew": true,
    "dnsType": "DefaultDomainRegistrarDns",
    "consent": {
      "agreementKeys": [
        "agreementKey1"
      ],
      "agreedBy": "192.0.2.1",
      "agreedAt": "2021-09-10T19:30:53Z"
    },
    "contactTech": {
      "email": "tech@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Tech",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactBilling": {
      "email": "billing@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Billing",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactAdmin": {
      "email": "admin@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Admin",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactRegistrant": {
      "email": "registrant@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Registrant",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    }
  }
}

示例响应

{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com",
  "name": "example.com",
  "type": "Microsoft.DomainRegistration/domains",
  "location": "global",
  "tags": {},
  "properties": {
    "authCode": "exampleAuthCode",
    "registrationStatus": "Active",
    "provisioningState": "Succeeded",
    "nameServers": [
      "ns01.ote.domaincontrol.com",
      "ns02.ote.domaincontrol.com"
    ],
    "privacy": false,
    "createdTime": "2021-09-10T19:30:53Z",
    "expirationTime": "2022-09-10T19:30:53Z",
    "autoRenew": true,
    "readyForDnsRecordManagement": true,
    "managedHostNames": [],
    "domainNotRenewableReasons": [
      "ExpirationNotInRenewalTimeRange"
    ],
    "dnsType": "DefaultDomainRegistrarDns",
    "consent": {
      "agreementKeys": [
        "agreementKey1"
      ],
      "agreedBy": "192.0.2.1",
      "agreedAt": "2021-09-10T19:30:53Z"
    },
    "contactTech": {
      "email": "tech@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Tech",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactBilling": {
      "email": "billing@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Billing",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactAdmin": {
      "email": "admin@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Admin",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactRegistrant": {
      "email": "registrant@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Registrant",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    }
  }
}
{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com",
  "name": "example.com",
  "type": "Microsoft.DomainRegistration/domains",
  "location": "global",
  "tags": {},
  "properties": {
    "authCode": "exampleAuthCode",
    "registrationStatus": "Active",
    "provisioningState": "Succeeded",
    "nameServers": [
      "ns01.ote.domaincontrol.com",
      "ns02.ote.domaincontrol.com"
    ],
    "privacy": false,
    "createdTime": "2021-09-10T19:30:53Z",
    "expirationTime": "2022-09-10T19:30:53Z",
    "autoRenew": true,
    "readyForDnsRecordManagement": true,
    "managedHostNames": [],
    "domainNotRenewableReasons": [
      "ExpirationNotInRenewalTimeRange"
    ],
    "dnsType": "DefaultDomainRegistrarDns",
    "consent": {
      "agreementKeys": [
        "agreementKey1"
      ],
      "agreedBy": "192.0.2.1",
      "agreedAt": "2021-09-10T19:30:53Z"
    },
    "contactTech": {
      "email": "tech@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Tech",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactBilling": {
      "email": "billing@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Billing",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactAdmin": {
      "email": "admin@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Admin",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    },
    "contactRegistrant": {
      "email": "registrant@email.com",
      "fax": "1-245-534-2242",
      "nameFirst": "John",
      "nameLast": "Doe",
      "nameMiddle": "",
      "jobTitle": "Registrant",
      "organization": "Microsoft Inc.",
      "phone": "1-245-534-2242",
      "addressMailing": {
        "address1": "3400 State St",
        "city": "Chicago",
        "state": "IL",
        "country": "United States",
        "postalCode": "67098"
      }
    }
  }
}

定义

名称 说明
Address

域注册的地址信息。

AzureResourceType

主机名分配给的 Azure 资源的类型。

Contact

域注册的联系信息。 如果未选择“域隐私”选项,则根据 ISI 要求通过 Whois 目录公开提供联系信息。

CustomHostNameDnsRecordType

DNS 记录的类型。

DefaultErrorResponse

应用服务错误响应。

Details
DnsType

当前 DNS 类型

Domain

有关域的信息。

DomainPurchaseConsent

域购买同意对象,表示接受适用的法律协议。

DomainStatus

域注册状态。

Error

错误模型。

HostName

从域派生的主机名的详细信息。

HostNameType

主机名的类型。

ProvisioningState

域预配状态。

ResourceNotRenewableReason

域不可续订的原因。

Address

域注册的地址信息。

名称 类型 说明
address1

string

地址的第一行。

address2

string

地址的第二行。 可选。

city

string

地址的城市。

country

string

地址所在的国家/地区。

postalCode

string

地址的邮政编码。

state

string

地址的州或省。

AzureResourceType

主机名分配给的 Azure 资源的类型。

说明
TrafficManager
Website

Contact

域注册的联系信息。 如果未选择“域隐私”选项,则根据 ISI 要求通过 Whois 目录公开提供联系信息。

名称 类型 说明
addressMailing

Address

邮寄地址。

email

string

电子邮件地址。

fax

string

传真号。

jobTitle

string

职务。

nameFirst

string

名字。

nameLast

string

姓。

nameMiddle

string

中间名称。

organization

string

组织联系人属于该联系人。

phone

string

电话号码。

CustomHostNameDnsRecordType

DNS 记录的类型。

说明
A
CName

DefaultErrorResponse

应用服务错误响应。

名称 类型 说明
error

Error

错误模型。

Details

名称 类型 说明
code

string

标准化字符串,以编程方式标识错误。

message

string

详细的错误说明和调试信息。

target

string

详细的错误说明和调试信息。

DnsType

当前 DNS 类型

说明
AzureDns
DefaultDomainRegistrarDns

Domain

有关域的信息。

名称 类型 默认值 说明
id

string

资源 ID。

kind

string

资源类型。 如果资源是应用,可以参考 https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference 了解类型支持的详细信息值。

location

string

资源位置。

name

string

资源名称。

properties.authCode

string

properties.autoRenew

boolean

True

如果域应自动续订,true;否则,false

properties.consent

DomainPurchaseConsent

法律协议同意。

properties.contactAdmin

Contact

管理联系人。

properties.contactBilling

Contact

计费联系人。

properties.contactRegistrant

Contact

注册联系人。

properties.contactTech

Contact

技术联系人。

properties.createdTime

string (date-time)

域创建时间戳。

properties.dnsType

DnsType

当前 DNS 类型

properties.dnsZoneId

string

要使用的 Azure DNS 区域

properties.domainNotRenewableReasons

ResourceNotRenewableReason[]

域不可续订的原因。

properties.expirationTime

string (date-time)

域过期时间戳。

properties.lastRenewedTime

string (date-time)

上次续订域时的时间戳。

properties.managedHostNames

HostName[]

从域派生并分配给 Azure 资源的所有主机名。

properties.nameServers

string[]

名称服务器。

properties.privacy

boolean

如果为此域启用了域隐私,则 true;否则,false

properties.provisioningState

ProvisioningState

域预配状态。

properties.readyForDnsRecordManagement

boolean

如果 Azure 可以将此域分配给应用服务应用,true;否则,false。 如果域注册状态处于活动状态,并且托管在 Azure 具有编程访问权限的名称服务器上,则此值将 true

properties.registrationStatus

DomainStatus

域注册状态。

properties.targetDnsType

DnsType

目标 DNS 类型(将用于迁移)

tags

object

资源标记。

type

string

资源类型。

DomainPurchaseConsent

域购买同意对象,表示接受适用的法律协议。

名称 类型 说明
agreedAt

string (date-time)

接受协议时的时间戳。

agreedBy

string

客户端 IP 地址。

agreementKeys

string[]

适用的法律协议密钥列表。 可以使用 TopLevelDomain 资源下的 ListLegalAgreements API 检索此列表。

DomainStatus

域注册状态。

说明
Active
Awaiting
Cancelled
Confiscated
Disabled
Excluded
Expired
Failed
Held
JsonConverterFailed
Locked
Parked
Pending
Reserved
Reverted
Suspended
Transferred
Unknown
Unlocked
Unparked
Updated

Error

错误模型。

名称 类型 说明
code

string

标准化字符串,以编程方式标识错误。

details

Details[]

详细错误。

innererror

string

调试错误的详细信息。

message

string

详细的错误说明和调试信息。

target

string

详细的错误说明和调试信息。

HostName

从域派生的主机名的详细信息。

名称 类型 说明
azureResourceName

string

主机名分配给的 Azure 资源的名称。 如果将其分配给流量管理器,则它将是流量管理器名称,否则它将是应用名称。

azureResourceType

AzureResourceType

主机名分配给的 Azure 资源的类型。

customHostNameDnsRecordType

CustomHostNameDnsRecordType

DNS 记录的类型。

hostNameType

HostNameType

主机名的类型。

name

string

主机名的名称。

siteNames

string[]

主机名分配给的应用列表。 仅当主机名指向流量管理器时,此列表才会有多个应用。

HostNameType

主机名的类型。

说明
Managed
Verified

ProvisioningState

域预配状态。

说明
Canceled
Deleting
Failed
InProgress
Succeeded

ResourceNotRenewableReason

域不可续订的原因。

说明
ExpirationNotInRenewalTimeRange
RegistrationStatusNotSupportedForRenewal
SubscriptionNotActive