I'm trying to build a (what I thought would be) a simple script in Python to download Microsoft's Azure's rate card using the Billing API.
token_response = adal.acquire_token_with_client_credentials(
'https://login.microsoftonline.com/' + TENANT_ID,
CLIENT-ID,
CLIENT-KEY)
access_token = token_response.get('accessToken')
endpoint = "https://management.azure.com/subscriptions/[SUBSCRIPTION-ID]/providers/Microsoft.Commerce/RateCard?api-version=2015-06-01-preview&$filter=OfferDurableId eq 'MS-AZR-0003P' and Currency eq 'GBP' and Locale eq 'en-GB' and RegionInfo eq 'GB'"
headers = {"Authorization": 'Bearer ' + access_token}
out = requests.get(endpoint,headers=headers)
json_output = out.json()
print son_output
The query seems to be executing correctly. Authorisation seems to go ok, and I'm getting a 200 OK message response. But the output is empty: {u'value': []}. I've tried different OfferIDs, different $filter strings and now it's driving me mad...
I wonder if perhaps I haven't delegated suitable permissions, but I've created an Application attached to Active Directory, generated a key, and delegated permissions to Windows Azure Service Management? And if that was the problem, wouldn't I receive an error?
Happy to hear alternative ways of doing the same thing, but Python is all I really know...