Devarayulu Tula, Senior Program Manager
Rahul Singh, Senior Software Engineer
Automation is a key aspect of DevOps and agile development. On January 19th, we announced the general availability of the Azure Quota REST API. The Quota API enables you to automate quota management and integrate it programmatically with your applications, tools, and existing systems. Now you can move your applications and systems faster to the cloud and free up your time to focus on your core business.
In this blog post, we give you an overview of the newly released Quota REST API and a step-by-step walkthrough with sample code that demonstrates how to use it when you reach a quota limit. For short, we will use Quota API throughout the rest of this blog.
Quotas, also referred to as service limits, are the maximum values for the resources, actions, and items in an Azure account.
An Azure subscription is an agreement between a customer and Microsoft that enables the customer to obtain Azure services. The subscription pricing and related terms are governed by the offer chosen for the subscription. For a given subscription, region, and SKU there is a default quota. Each Azure service defines its quotas and default values. Here are some things to consider about quotas:
To compete effectively, enterprises need to create an environment where developers can do their best work and operation teams can confidently meet the reliability, security, and compliance requirements their organizations expect. This requires advanced cloud capabilities designed to support modern constructs like containers, DevOps, APIs, and managed services—and the fluidity to work across environments and teams. Quota API can address this need for quota management automation and enabling quota management integration with your existing tools and applications. For details about the business benefits of using the Quota API, check out our blog post on the Microsoft Azure blog.
Azure Quota API is a one-stop-shop for automating the process of viewing and managing quotas and eliminating the manual process of creating and managing quotas through support tickets in the Azure portal. Azure Quota API makes it easy to look up current quota usage and to request increases. With the current version of the Quota API, you can manage the service limits (quota) of Azure Virtual Machines (cores/vCPU) and Azure Machine Learning. In future releases, you will be able to take advantage of this capability to query current usage and quotas for additional Azure services and resources.
Azure Quota Management Automation
This usage scenario illustrates how to use the Quota API to automate quota management to improve agility, developer velocity, and efficiency in IT operations.
Anna is a lead developer in the Contoso Cloud Readiness team. Contoso is an A/B testing company that tests firmware to be approved for cloud hardware. While testing, Anna needs to create many virtual machines (VMs) to test the firmware at scale. One of the challenges Anna faces is the inability to deploy new VMs because the maximum quota limit has been reached. This happens frequently and unexpectedly because of the inorganic growth in the usage of VMs in her organization. To continue with her workflow, Anna creates a support ticket manually to request a quota increase. But now, to improve efficiency in her workflow, she uses the Azure Quota API to automate quota request and validation operations end-to-end. She can check usage and monitor when her VMs reach the quota limit and automatically submit quota requests to increase limits. Anna's manual quota request process is now completely automated. This has helped her operations tremendously by paving the way for uninterrupted firmware testing.
With the Quota API, you can find out what your current quota limit and usage values are and compare them with your quota needs. To determine when to request a quota increase follow this workflow:
remaining quota = quota limit - current usage
Here's an example that illustrates how to determine if a quota increase is necessary and how to request it.
Anna is planning to deploy a new service in the East US region (eastus). She needs 20 general-purpose VMs for test and development that offer a balanced combination of vCPU(s), memory, and local disk. She picked 20 D3 v2 VMs (standardD3V2Family) which will support most of her production workloads. She also needs 5 NDs-series VMs (standardNDSFamily) to support parallel computing and machine learning workloads.
After initial deployment, Anna follows these steps to check the current usage of her NDs-series VMs and determine if she needs to request a quota increase for the NDs-series SKU in the East US region.
GET https://management.azure.com/subscriptions/00000000-0000/providers/Microsoft.Capacity/resourceProviders/Microsoft.Compute/locations/eastus/serviceLimits/standardNDSFamily?api-version=2020-10-25
and gets this response:{
"properties": {
"limit": 10, // Quota limit
"unit": "Count",
"currentValue": 5, // Current usage
"name": {
"value": "standardNDSFamily",
"localizedValue": "Standard NDS Family vCPUs"
}
}
}
remaining quota = quota limit - current usage = 10 - 5 = 5
new quota limit = old quota limit + quota increase = 10 + 5 = 15
PUT https://management.azure.com/subscriptions/00000000-0000/providers/Microsoft.Capacity/resourceProviders/Microsoft.Compute/locations/eastus/serviceLimits/standardNDSFamily?api-version=2020-10-25
and request body:
{
"properties": {
"limit": 15, // New limit
"unit": "Count",
"name": {
"value": "standardNDSFamily"
}
}
}
If you get a quota failure after you request an increase, try a smaller number rather than trying again with a bigger number. Using a bigger number might continue to cause failures. If you continue to get quota failures, follow the guidance on the How to create a support ticket via the Azure portal or use the Azure Support Ticket REST API to create it programmatically.
Share your feedback or issues about the Quota API with us on Stack Overflow or GitHub.
To ask a question about the Quota REST API on Stack Overflow, go to the Stack Overflow home page and click Ask Question on the top right corner of the page. Enter a title and description for your question. Under Tags, enter at least one of these tags: quota, quota-api, or azure-quotas. For tips on preparing a question, go to How do I ask a good question?
To report an issue with the Quota REST API on GitHub, click Issues at the top of the page for the language or interface you’re using. For example, if you are using the Microsoft Azure SDK for .NET, go to the SDK for .NET GitHub repository, click Issues→New issue. Choose your issue type (Bug report, Feature request, Question/Query template, or Report a security vulnerability) and click Get started. If none of these options matches your issue, click Open a blank issue at the bottom left of the page.
Check out our Quota API product documentation for technical details on the Quota API REST operations that are currently supported, how to look up quota usage, request a quota increase, and deal with quota failures. Visit our post on the Microsoft Azure blog for the business benefits of using the Quota API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.