Yes, it is possible to create a quota request through the CLI and Azure Python SDK.
For Azure CLI you can use the az quota command which is an extension that gets installed when you run the command.
az quota create --resource-name standardFSv2Family --scope /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus --limit-object value=10 --resource-type dedicated
For Azure Python SDK you can use azure-mgmt-quota This is some sample code that you might find useful:
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.quota import AzureQuotaExtensionAPI
from azure.mgmt.resource import ResourceManagementClient
def main():
subscription = os.getenv('AZURE_SUBSCRIPTION_ID')
quota_client = AzureQuotaExtensionAPI(DefaultAzureCredential(), subscription)
resource_client = ResourceManagementClient(DefaultAzureCredential(), subscription)
GROUP_NAME = 'zbw_test'
# Create resource group
resource_client.resource_groups.create_or_update(
GROUP_NAME,
{"location": "eastus"}
)
result = quota_client.quota.begin_create_or_update(
resource_name=GROUP_NAME,
scope='/subscriptions/' + subscription + 'providers/Microsoft.Compute/location/eastus',
create_quota_request={
"properties": {
"limit": {
"limit_object_type": "1000"
},
"resourceType": "dedicated"
}
}
).result()
print(result)
# delete resource group
resource_client.resource_groups.begin_delete(GROUP_NAME).result()
if __name__ == '__main__':
main()
Hope this helps! Let me know if you have an questions.
If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.
If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.
Thank you for helping to improve Microsoft Q&A!