你当前正在访问 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=2023-12-01

URI 参数

名称 必需 类型 说明
domainName
path True

string

域的名称。

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

resourceGroupName
path True

string

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

Regex pattern: ^[-\w\._\(\)]+[^\.]$

subscriptionId
path True

string

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

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

资源类型。

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

App 服务错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

Create App Service Domain

Sample Request

PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com?api-version=2023-12-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"
      }
    }
  }
}

Sample Response

{
  "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

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

CustomHostNameDnsRecordType

DNS 记录的类型。

DefaultErrorResponse

App 服务错误响应。

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

string

Website

string

Contact

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

名称 类型 说明
addressMailing

Address

邮寄地址。

email

string

电子邮件地址。

fax

string

传真号。

jobTitle

string

职务。

nameFirst

string

名字。

nameLast

string

姓氏。

nameMiddle

string

中间名。

organization

string

组织联系人属于 。

phone

string

电话号码。

CustomHostNameDnsRecordType

DNS 记录的类型。

名称 类型 说明
A

string

CName

string

DefaultErrorResponse

App 服务错误响应。

名称 类型 说明
error

Error

错误模型。

Details

名称 类型 说明
code

string

用于以编程方式识别错误的标准化字符串。

message

string

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

target

string

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

DnsType

当前 DNS 类型

名称 类型 说明
AzureDns

string

DefaultDomainRegistrarDns

string

Domain

有关域的信息。

名称 类型 默认值 说明
id

string

资源 ID。

kind

string

资源类型。

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

域创建时间戳。

properties.dnsType

DnsType

当前 DNS 类型

properties.dnsZoneId

string

要使用的 Azure DNS 区域

properties.domainNotRenewableReasons

ResourceNotRenewableReason[]

域不可续订的原因。

properties.expirationTime

string

域过期时间戳。

properties.lastRenewedTime

string

上次续订域的时间戳。

properties.managedHostNames

HostName[]

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

properties.nameServers

string[]

名称服务器。

properties.privacy

boolean

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

properties.provisioningState

ProvisioningState

域预配状态。

properties.readyForDnsRecordManagement

boolean

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

properties.registrationStatus

DomainStatus

域注册状态。

properties.targetDnsType

DnsType

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

tags

object

资源标记。

type

string

资源类型。

DomainPurchaseConsent

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

名称 类型 说明
agreedAt

string

接受协议的时间戳。

agreedBy

string

客户端 IP 地址。

agreementKeys

string[]

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

DomainStatus

域注册状态。

名称 类型 说明
Active

string

Awaiting

string

Cancelled

string

Confiscated

string

Disabled

string

Excluded

string

Expired

string

Failed

string

Held

string

JsonConverterFailed

string

Locked

string

Parked

string

Pending

string

Reserved

string

Reverted

string

Suspended

string

Transferred

string

Unknown

string

Unlocked

string

Unparked

string

Updated

string

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

string

Verified

string

ProvisioningState

域预配状态。

名称 类型 说明
Canceled

string

Deleting

string

Failed

string

InProgress

string

Succeeded

string

ResourceNotRenewableReason

域不可续订的原因。

名称 类型 说明
ExpirationNotInRenewalTimeRange

string

RegistrationStatusNotSupportedForRenewal

string

SubscriptionNotActive

string