Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.63k stars 838 forks source link

AAD Domain Service creation fails with 400/InvalidRequestContent #3285

Closed tiwood closed 5 years ago

tiwood commented 5 years ago

Bug Report

I'm trying to create Azure AD Domain Services with the SDK.

I'm doing the following:

properties := aad.DomainServiceProperties{
        TenantID:   &tenantID,
        DomainName: &domainName,
        VnetSiteID: &virtualNetworkID,
        SubnetID:   &subnetID,
}

//create the Azure AD Domain Services resource (long-running operation)
future, err := client.CreateOrUpdate(ctx, resourceGroupName, domainName, properties)

The following error is returned:

aad.DomainServicesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Could not find member 'tenantId' on object of type 'ResourceDefinition'. Path 'tenantId', line 1, position 12.'."

Things I've tried

I assume the API expects something different from the provided body.

vladbarosan commented 5 years ago

@tiwood it seems there was an issue with the service specs. this has been fixed here https://github.com/Azure/azure-rest-api-specs/pull/4353

Since its a breaking change for the sdk its going to make its way in the next major bump of the sdk at the end of the month,.

Also the fix should be available in the latest branch of this repo.

tiwood commented 5 years ago

@vladbarosan thank you for the heads up.