Azure / Azure/azure-rest-api-specs

`azure.mgmt.resource.subscriptions` lacks `api_version` 2020-01-01

Open
#19,786 2 comments 0 reactions 0 assignees View on GitHub
Docs Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

- **Package Name**: `azure.mgmt.resource.subscriptions`
- **Package Version**: latest

**Describe the bug**
The REST API document for Tenants - List uses `api-version=2020-01-01`:

https://docs.microsoft.com/en-us/rest/api/resources/tenants/list?tabs=HTTP

![image](https://user-images.githubusercontent.com/4003950/179149361-d7926c32-65b0-4dbf-bc9d-d8453b8e8719.png)

However, this API version is missing from Python SDK:

https://github.com/Azure/azure-sdk-for-python/blob/0492dc711c69cacc0ec8aea69e7f2d33d0e66c0e/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py#L170-L182

The swagger for `2020-01-01` does have `Tenants_List`:

https://github.com/Azure/azure-rest-api-specs/blob/c03c258c7a01a7d57b3110cc20e2e76752b6f2d6/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json#L156-L162

```
"/tenants": {
"get": {
"tags": [
"Tenants"
],
"operationId": "Tenants_List",
"description": "Gets the tenants for your account.",
```

Another question not belonging to Python SDK: Why isn't the REST API doc updated to use `api-version=2021-01-01` which also has `tenants` API?

https://github.com/Azure/azure-rest-api-specs/blob/c03c258c7a01a7d57b3110cc20e2e76752b6f2d6/specification/resources/resource-manager/Microsoft.Resources/stable/2021-01-01/subscriptions.json#L160-L166

The same happens to `subscriptions`.

Contributor guide

Open the contributing guide

Research direction

Start with the linked azure/mgmt/resource/subscriptions/_subscription_client.py section and the 2020-01-01 and 2021-01-01 subscriptions.json files, comparing their Tenants_List and subscriptions operations. Verify how the REST specification maps to the Python SDK's supported API versions; done means the requested version is consistently represented or the version discrepancy is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi, python
Domain
api, backend-api-design, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.