Open Suchiman opened 5 years ago
Thank you for opening this issue! We are routing it to the appropriate team for follow up.
@Suchiman The properties match what is in the rest API specs
As for XML coming back from the service, can you kindly capture the fiddler traces and capture the response from the server and paste it here?
Following Request and Response are issued by the SDK. Request:
GET https://management.microsoftazure.de/subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Web/sites/REDACTED/analyzeCustomHostname?hostName=sample.de&api-version=2018-02-01 HTTP/1.1
x-ms-client-request-id: REDACTED
accept-language: en-US
Authorization: Bearer REDACTED
User-Agent: FxVersion/4.7.3324.0 OSName/Windows OSVersion/6.2.9200.0 Microsoft.Azure.Management.AppService.Fluent.WebSiteManagementClient/1.20.0.0 MacAddressHash/REDACTED
Host: management.microsoftazure.de
Response:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1286
Content-Type: application/xml; charset=utf-8
Expires: -1
Strict-Transport-Security: max-age=31536000; includeSubDomains
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
x-ms-ratelimit-remaining-subscription-reads: 14992
x-ms-request-id: REDACTED
x-ms-correlation-request-id: REDACTED
x-ms-routing-request-id: GERMANYCENTRAL:REDACTED
X-Content-Type-Options: nosniff
Date: Wed, 17 Apr 2019 15:22:44 GMT
<CustomHostnameAnalysisResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure"><ARecords xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d2p1:string>217.147.99.181</d2p1:string><d2p1:string>217.115.143.140</d2p1:string></ARecords><CustomDomainVerificationFailureInfo><Code>BadRequest</Code><Message>A CNAME record pointing from sample.de to redacted.azurewebsites.de was not found. Alternative record awverify.sample.de to awverify.redacted.azurewebsites.de was not found either.</Message><ExtendedCode>04006</ExtendedCode><MessageTemplate>A CNAME record pointing from {0} to {1} was not found. Alternative record awverify.{0} to awverify.{1} was not found either.</MessageTemplate><Parameters xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d3p1:string>sample.de</d3p1:string><d3p1:string>redacted.azurewebsites.de</d3p1:string></Parameters><InnerErrors i:nil="true" /></CustomDomainVerificationFailureInfo><CustomDomainVerificationTest>Failed</CustomDomainVerificationTest><HasConflictAcrossSubscription>false</HasConflictAcrossSubscription><HasConflictOnScaleUnit>false</HasConflictOnScaleUnit><IsHostnameAlreadyVerified>false</IsHostnameAlreadyVerified></CustomHostnameAnalysisResult>
If you modify the Request to include accept: application/json
then you get
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 681
Content-Type: application/json; charset=utf-8
Expires: -1
Strict-Transport-Security: max-age=31536000; includeSubDomains
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
x-ms-ratelimit-remaining-subscription-reads: 14991
x-ms-request-id: REDACTED
x-ms-correlation-request-id: REDACTED
x-ms-routing-request-id: GERMANYCENTRAL:REDACTED
X-Content-Type-Options: nosniff
Date: Wed, 17 Apr 2019 15:27:07 GMT
{"isHostnameAlreadyVerified":false,"customDomainVerificationTest":"Failed","customDomainVerificationFailureInfo":{"extendedCode":"04006","messageTemplate":"A CNAME record pointing from {0} to {1} was not found. Alternative record awverify.{0} to awverify.{1} was not found either.","parameters":["sample.de","redacted.azurewebsites.de"],"code":"BadRequest","message":"A CNAME record pointing from sample.de to redacted.azurewebsites.de was not found. Alternative record awverify.sample.de to awverify.redacted.azurewebsites.de was not found either."},"hasConflictOnScaleUnit":false,"hasConflictAcrossSubscription":false,"aRecords":["217.147.99.181","217.115.143.140","80.237.128.10"]}
Given that the generated Code declares [JsonProperty(PropertyName = "properties.isHostnameAlreadyVerified")]
the JSON should be "properties.isHostnameAlreadyVerified":false
but it's actually "isHostnameAlreadyVerified":false
which explains why nothing gets deserialized if i add accept: application/json
with a DelegatingHandler to the request.
I'm having the same issue with both Microsoft.WindowsAzure.Management.Websites and Microsoft.Azure.Management.Fluent.
Is this not the same issue reported in 2017? AppService AnalyzeCustomHostname method fails
Describe the bug If you call
AnalyzeCustomHostnameAsync
you get an exception because theRequest
forgot to includeAccept: application/json
and thus got XML as response. If you fix this with aDelegatingHandler
, then you get an object with all properties set to null returned.Exception or Stack Trace
To Reproduce
additionally, the properties on the result class look quite odd and have the wrong property names:
Expected behavior I get the results i can see in fiddler in my object without exception.
Setup (please complete the following information):
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report