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

Web Apps - Analyze Custom Hostname

分析自定义主机名的说明。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname?api-version=2025-03-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname?hostName={hostName}&api-version=2025-03-01

URI 参数

名称 必需 类型 说明
name
path True

string

Web 应用的名称。

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 版本

hostName
query

string

自定义主机名。

响应

名称 类型 说明
200 OK

CustomHostnameAnalysisResult

好的

Other Status Codes

DefaultErrorResponse

应用服务错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

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

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Analyze custom hostname for webapp.

示例请求

GET https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/sites/sitef6141/analyzeCustomHostname?api-version=2025-03-01

示例响应

{
  "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/sites/sitef6141",
  "name": "sitef6141",
  "type": "Microsoft.Web/sites",
  "properties": {
    "isHostnameAlreadyVerified": true,
    "customDomainVerificationTest": "Passed",
    "customDomainVerificationFailureInfo": {
      "code": "07198",
      "message": "Custom domain verification failed on conflicting CNAMEs."
    },
    "hasConflictOnScaleUnit": false,
    "hasConflictAcrossSubscription": true,
    "conflictingAppResourceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/sites/siteog",
    "cNameRecords": [
      "siteog.azurewebsites.net"
    ]
  }
}

定义

名称 说明
CustomHostnameAnalysisResult

自定义域分析。

DefaultErrorResponse

应用服务错误响应。

Details
DnsVerificationTestResult

DNS 验证测试结果。

Error

错误模型。

ErrorEntity

从 API 返回的错误响应的正文。

CustomHostnameAnalysisResult

自定义域分析。

名称 类型 说明
id

string

资源 ID。

kind

string

资源类型。

name

string

资源名称。

properties.aRecords

string[]

记录控制器可以看到此主机名。

properties.alternateCNameRecords

string[]

备用 CName 记录控制器可以看到此主机名。

properties.alternateTxtRecords

string[]

备用 TXT 记录控制器可以看到此主机名。

properties.cNameRecords

string[]

CName 记录控制器可以看到此主机名。

properties.conflictingAppResourceId

string

缩放单元上冲突应用的名称(如果位于同一订阅中)。

properties.customDomainVerificationFailureInfo

ErrorEntity

如果 DNS 验证失败,原始失败信息。

properties.customDomainVerificationTest

DnsVerificationTestResult

DNS 验证测试结果。

properties.hasConflictAcrossSubscription

boolean

true 如果订阅之间存在冲突;否则, false.

properties.hasConflictOnScaleUnit

boolean

true 如果比例单位上存在冲突;否则, false.

properties.isHostnameAlreadyVerified

boolean

true 如果主机名已验证;否则, false.

properties.txtRecords

string[]

TXT 记录控制器可以看到此主机名。

type

string

资源类型。

DefaultErrorResponse

应用服务错误响应。

名称 类型 说明
error

Error

错误模型。

Details

名称 类型 说明
code

string

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

message

string

详细的错误描述和调试信息。

target

string

详细的错误描述和调试信息。

DnsVerificationTestResult

DNS 验证测试结果。

说明
Passed
Failed
Skipped

Error

错误模型。

名称 类型 说明
code

string

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

details

Details[]

详细错误。

innererror

string

调试错误的更多信息。

message

string

详细的错误描述和调试信息。

target

string

详细的错误描述和调试信息。

ErrorEntity

从 API 返回的错误响应的正文。

名称 类型 说明
code

string

基本错误代码。

details

ErrorEntity[]

错误详细信息。

extendedCode

string

错误类型。

innerErrors

ErrorEntity[]

内部错误。

message

string

错误的任何详细信息。

messageTemplate

string

消息模板。

parameters

string[]

模板的参数。

target

string

错误目标。