1
votes

I can authenticate and call the Azure Management API through Postman with the URL:

https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Commerce/UsageAggregates?api-version=2015-06-01-preview&reportedStartTime=2015-02-01T09%3A00%3A00&reportedEndTime=2015-02-08T09%3A00%3A00&aggregationGranularity=Daily&showDetails=false

But if I try to use any Resource Type other than 'Microsoft.Commerce', such as 'Microsoft.Compute' then I get an error message of:

"code": "InvalidResourceType", "message": "The resource type could not be found in the namespace 'Microsoft.Compute' for api version '2015-06-01-preview'."

Is there a restricted list of Resource Types that can be used in the 'preview' version or am I doing something wrong here?

Ps. I retrieved the list of all available resource types using the following API call:

https://management.azure.com/subscriptions/{subscription-id}/providers?$skiptoken={skiptoken}&api-version=2015-01-01

but this won't accept the preview version as it's 'api-version' so it's probably not the right source to get the available types from.

Any help much appreciated!

1

1 Answers

1
votes

IMHO, you're doing it the other way around. Essentially each resource provider has an API version and for performing ARM operation on a resource provider and resource type you would need to use that version.

Considering Microsoft.Compute resource provider and virtualMachines resource type in it, allowed API versions are: 2015-06-15, 2015-05-01-preview.

enter image description here

You can find this information by using Get information about a resource provider API operation.