azure-sdk-for-go: AAD Domain Service create/update fails with Request_InvalidDataContractVersion

Bug Report

  • import path: “github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/2017-06-01/aad”
  • SDK version: v24.1.0
  • go version go1.11.4 darwin/amd64

I’m trying to create a Azure AD Domain Service resource, but the API returns Request_InvalidDataContractVersion while using the azure-sdk-for-go@v24.1.0

/subscriptions/{subscriptionid}/resourceGroups/{resourceGroup}/providers/Microsoft.AAD/domainServices/{domainServiceName}?api-version=2017-06-01

{
	"odata.error": {
		"code": "Request_InvalidDataContractVersion",
		"message": {
			"lang": "en",
			"value": "The specified api-version is invalid. The value must exactly match a supported version."
		}
	}
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

@jhendrixMSFT, thank you for assisting me with my issue. It turns out that I made a mistake in the initialization, which resulted in the wrong host uri. As soon as I used management.azure.com the creation was successful.

Sorry for the noise

@jhendrixMSFT here are the requested details:

RAW Request:

PUT /subscriptions/92807d76-6b48-4482-9e6d-bf034fede571/resourceGroups/adds_test/providers/Microsoft.AAD/domainServices/AlexanderBeissneroutlook.onmicrosoft.com?api-version=2017-06-01 HTTP/1.1
Host: graph.windows.net
User-Agent: Go/go1.11.5 (amd64-darwin) go-autorest/v11.2.8 Azure-SDK-For-Go/v24.1.0 aad/2017-06-01 Terraform/0.11.9 terraform-provider-azuread/dev
Content-Length: 319
Authorization: Bearer <snip>
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip

{"location":"westeurope","name":"AlexanderBeissneroutlook.onmicrosoft.com","properties":{"domainName":"AlexanderBeissneroutlook.onmicrosoft.com","subnetId":"/subscriptions/c356d2d3-7531-47ce-83bc-8938d820f8b1/resourceGroups/adds_test/providers/Microsoft.Network/virtualNetworks/virtualNetwork1/subnets/domainservices"}}

RAW Response:

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json; odata=verbose
Server: Microsoft-IIS/10.0
ocp-aad-diagnostics-server-name: +yD+FhcBb8tUXvrt20+iv/3Zym7XJiXO5AZ6j8c3jyg=
request-id: 6057ed16-a22f-430a-8136-31511e8d27e9
client-request-id: 6a57008d-74cc-44d1-b087-a1f084974a4c
Strict-Transport-Security: max-age=31536000; includeSubDomains
Access-Control-Allow-Origin: *
X-Powered-By: ASP.NET
Duration: 99072
Date: Tue, 05 Feb 2019 16:38:26 GMT
Content-Length: 183
Connection: keep-alive

{"odata.error":{"code":"Request_InvalidDataContractVersion","message":{"lang":"en","value":"The specified api-version is invalid. The value must exactly match a supported version."}}}

Thanks again for looking into it.