Azure / Azure/azure-rest-api-specs
[BUG] Microsoft.Quota can't get limits for Microsoft.DevOpsInfrastructure provider
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/quota/resource-manager/Microsoft.Quota/stable/2025-03-01/quota.json
https://learn.microsoft.com/en-us/azure/templates/microsoft.quota/quotas?pivots=deployment-language-terraform
### API Spec version
Checked 2023-02-01, 2025-03-01; affected probably all
### Describe the bug
According to the Microsoft.Quota documentation, commands like `az quota list` and `az quota show` should return quotas over passed scope (`az rest -m GET -u "scope_url" `).
- Calling `az quota list --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/"` returns an empty list `[]`
- `az quota show --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/" --resource-name ""` throws an error
```
(InvalidResourceName) Name is not valid resource name.
Code: InvalidResourceName
Message: Name is not valid resource name.
```
Any type of resource family can be used with the same result.
- `az quota update --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/" --resource-name "" --limit-object value=10 --resource-type dedicated ` succeeds
- Debugging the command, it calls PATCH endpoint at `https://management.azure.com/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations//providers/Microsoft.Quota/quotas/?api-version=2023-02-01` with body `{"properties": {"limit": {"limitObjectType": "LimitValue", "value": 10}, "name": {"value": ""}, "resourceType": "dedicated"}}`. Trying the same url using "GET" fails with errors like for `az quota show` command.
- I've implemented quota update using terraform, but because `azapi_resource` and `azapi_update_resource` uses "GET" first to fetch the status, it fails. So I used `azapi_resource_action` resource instead to "PATCH" only the value like az cli does, but there another limitation appears - you can't update the value with the same or lower number, than before.
```
(QuotaReductionNotSupported) Request failed.
Code: QuotaReductionNotSupported
Message: Request failed.
````
Functionality can't be really implemented using IaC practices.
- Calling `az rest -m GET -u "https://management.azure.com/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations//usages?api-version=2024-04-04-preview"` returns a full list of quotas and families for the provider, but can't be "PATCH"ed to change quotas.
None of the cases above are documented nor fully implemented / handled to adjust Quotas.
### Expected behavior
1. `az quota list --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/"` returns a list of quotas
2. `az quota show --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/" --resource-name ""` returns quota for specific resource
3. `az quota update --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/" --resource-name "" --limit-object value=10 --resource-type dedicated ` succeeds every time
Resolving these cases should allow using it correctly with terraform az-api provider too.
### Actual behavior
1. `az quota list --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/"` returns an empty list `[]`
2. `az quota show --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/" --resource-name ""` throws an error
```
(InvalidResourceName) Name is not valid resource name.
Code: InvalidResourceName
Message: Name is not valid resource name.
```
3. `az quota update --scope "/subscriptions//providers/Microsoft.DevOpsInfrastructure/locations/" --resource-name "" --limit-object value=10 --resource-type dedicated ` succeeds for the first time. Then fails constatly, because of the error `QuotaReductionNotSupported`.
### Reproduction Steps
1. Register `Microsoft.DevOpsInfrastructure` and `Microsoft.Quota` provider for your subscription.
2. Run `az quota` commands like above to update quota for selected compute family.
### Environment
_No response_
Contributor guide
Research direction
Start with specification/quota/resource-manager/Microsoft.Quota/stable/2025-03-01/quota.json and compare its list, show, and update operations with the documented Microsoft.DevOpsInfrastructure scope and usages endpoint. Confirm whether the required behavior is representable in the specification; done means the Azure CLI and Terraform azapi workflows can list, show, and update these quotas as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi, terraform
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100