When using 2019-06-01 with Azure Stack to get subscriptions (in this case management.redmond.azurestack.corp.microsoft.com), the response doesn't comply with the REST spec subscriptions.json. For example, authorizationSource and managedByTenants are missing from the response.
|
"managedByTenants": { |
|
"type": "array", |
|
"items": { |
|
"$ref": "#/definitions/ManagedByTenant" |
|
}, |
|
"description": "An array containing the tenants managing the subscription." |
|
} |
> az cloud register -n redmond --endpoint-resource-manager "https://management.redmond.azurestack.corp.microsoft.com/"
> az cloud set -n redmond
> az login --debug
msrest.http_logger : Request URL: 'https://management.redmond.azurestack.corp.microsoft.com/subscriptions?api-version=2019-06-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Response status: 200
msrest.http_logger : Response content:
msrest.http_logger :
{
"value": [
{
"offerId": "/delegatedProviders/default/offers/full-offer",
"id": "/subscriptions/c9b8dfff-aff0-49b5-93bd-a1581f1896a0",
"subscriptionId": "c9b8dfff-aff0-49b5-93bd-a1581f1896a0",
"tenantId": "81cfafcd-8b9a-4419-9c85-823b54076b55",
"displayName": "azclidevtools",
"state": "Enabled",
"subscriptionPolicies": {
"locationPlacementId": "AzureStack"
}
}
]
}
This causes failure in Azure CLI when retrieving managed_by_tenants:
File "C:\Users\jiasli\AppData\Local\Programs\Python\Python38\lib\site-packages\azure\cli\core\_profile.py", line 276, in _normalize_properties
subscription_dict[_MANAGED_BY_TENANTS] = [{_TENANT_ID: t.tenant_id} for t in s.managed_by_tenants]
TypeError: 'NoneType' object is not iterable
The response of the public AzureCloud is:
> az cloud set -n AzureCloud
> az login --debug
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions?api-version=2019-06-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Response status: 200
msrest.http_logger : Response content:
msrest.http_logger :
{
"value": [
{
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590",
"authorizationSource": "RoleBased",
"managedByTenants": [
{
"tenantId": "2f4a9838-26b7-47ee-be60-ccc1fdec5953"
}
],
"subscriptionId": "0b1f6471-1bf0-4dda-aec3-cb9272f09590",
"tenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a",
"displayName": "AzureSDKTest",
"state": "Enabled",
"subscriptionPolicies": {
"locationPlacementId": "Internal_2014-09-01",
"quotaId": "Internal_2014-09-01",
"spendingLimit": "Off"
}
}
],
"count": {
"type": "Total",
"value": 1
}
}
If 2019-06-01 is not supported, the service should return "unsupported API version" instead a wrong response which doesn't comply with the spec.
When using
2019-06-01with Azure Stack to get subscriptions (in this casemanagement.redmond.azurestack.corp.microsoft.com), the response doesn't comply with the REST specsubscriptions.json. For example,authorizationSourceandmanagedByTenantsare missing from the response.azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json
Lines 271 to 277 in 76b6bd1
This causes failure in Azure CLI when retrieving
managed_by_tenants:The response of the public
AzureCloudis:If
2019-06-01is not supported, the service should return "unsupported API version" instead a wrong response which doesn't comply with the spec.