Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request.
GET https://management.azure.com/{scope}/providers/Microsoft.Quota/quotas/{resourceName}?api-version=2023-02-01
URI Parameters
Name |
In |
Required |
Type |
Description |
resourceName
|
path |
True
|
string
|
Resource name for a given resource provider. For example:
- SKU name for Microsoft.Compute
- SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices
For Microsoft.Network PublicIPAddresses.
|
scope
|
path |
True
|
string
|
The target Azure resource URI. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/ . This is the target Azure resource URI for the List GET operation. If a {resourceName} is added after /quotas , then it's the target Azure resource URI in the GET operation for the specific resource.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Responses
Name |
Type |
Description |
200 OK
|
CurrentQuotaLimitBase
|
OK. The quota information will be returned in the response with pagination.
Headers
ETag: string
|
Other Status Codes
|
ExceptionResponse
|
Error response describing why the operation failed.
|
Security
azure_auth
Azure Active Directory OAuth 2.0 authorization
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
Impersonate your user account.
|
Examples
Quotas_Get_Request_ForCompute
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/providers/Microsoft.Quota/quotas/standardNDSFamily?api-version=2023-02-01
/** Samples for Quota Get. */
public final class Main {
/*
* x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json
*/
/**
* Sample code: Quotas_Get_Request_ForCompute.
*
* @param manager Entry point to QuotaManager.
*/
public static void quotasGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) {
manager
.quotas()
.getWithResponse(
"standardNDSFamily",
"subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.quota import QuotaMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-quota
# USAGE
python get_compute_one_sku_quota_limit.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = QuotaMgmtClient(
credential=DefaultAzureCredential(),
)
response = client.quota.get(
resource_name="standardNDSFamily",
scope="subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus",
)
print(response)
# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armquota_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/quota/armquota"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json
func ExampleClient_Get_quotasGetRequestForCompute() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armquota.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewClient().Get(ctx, "standardNDSFamily", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CurrentQuotaLimitBase = armquota.CurrentQuotaLimitBase{
// Name: to.Ptr("standardNDSFamily"),
// Type: to.Ptr("Microsoft.Quota/Quotas"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/providers/Microsoft.Quota/Quotas/standardNDSFamily"),
// Properties: &armquota.Properties{
// Name: &armquota.ResourceName{
// LocalizedValue: to.Ptr("Standard NDS Family vCPUs"),
// Value: to.Ptr("standardNDSFamily"),
// },
// IsQuotaApplicable: to.Ptr(true),
// Limit: &armquota.LimitObject{
// LimitObjectType: to.Ptr(armquota.LimitTypeLimitValue),
// LimitType: to.Ptr(armquota.QuotaLimitTypesIndependent),
// Value: to.Ptr[int32](100),
// },
// Unit: to.Ptr("Count"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureQuotaExtensionAPI } = require("@azure/arm-quota");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request.
*
* @summary Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request.
* x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json
*/
async function quotasGetRequestForCompute() {
const resourceName = "standardNDSFamily";
const scope =
"subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus";
const credential = new DefaultAzureCredential();
const client = new AzureQuotaExtensionAPI(credential);
const result = await client.quota.get(resourceName, scope);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Quota;
using Azure.ResourceManager.Quota.Models;
// Generated from example definition: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json
// this example is just showing the usage of "Quota_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this CurrentQuotaLimitBaseResource created on azure
// for more information of creating CurrentQuotaLimitBaseResource, please refer to the document of CurrentQuotaLimitBaseResource
string scope = "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus";
string resourceName = "standardNDSFamily";
ResourceIdentifier currentQuotaLimitBaseResourceId = CurrentQuotaLimitBaseResource.CreateResourceIdentifier(scope, resourceName);
CurrentQuotaLimitBaseResource currentQuotaLimitBase = client.GetCurrentQuotaLimitBaseResource(currentQuotaLimitBaseResourceId);
// invoke the operation
CurrentQuotaLimitBaseResource result = await currentQuotaLimitBase.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CurrentQuotaLimitBaseData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/providers/Microsoft.Quota/Quotas/standardNDSFamily",
"type": "Microsoft.Quota/Quotas",
"name": "standardNDSFamily",
"properties": {
"limit": {
"limitObjectType": "LimitValue",
"value": 100,
"limitType": "Independent"
},
"unit": "Count",
"name": {
"value": "standardNDSFamily",
"localizedValue": "Standard NDS Family vCPUs"
},
"isQuotaApplicable": true
}
}
Quotas_UsagesRequest_ForNetwork
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas/MinPublicIpInterNetworkPrefixLength?api-version=2023-02-01
/** Samples for Quota Get. */
public final class Main {
/*
* x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json
*/
/**
* Sample code: Quotas_UsagesRequest_ForNetwork.
*
* @param manager Entry point to QuotaManager.
*/
public static void quotasUsagesRequestForNetwork(com.azure.resourcemanager.quota.QuotaManager manager) {
manager
.quotas()
.getWithResponse(
"MinPublicIpInterNetworkPrefixLength",
"subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.quota import QuotaMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-quota
# USAGE
python get_network_one_sku_quota_limit.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = QuotaMgmtClient(
credential=DefaultAzureCredential(),
)
response = client.quota.get(
resource_name="MinPublicIpInterNetworkPrefixLength",
scope="subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus",
)
print(response)
# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armquota_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/quota/armquota"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json
func ExampleClient_Get_quotasUsagesRequestForNetwork() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armquota.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewClient().Get(ctx, "MinPublicIpInterNetworkPrefixLength", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CurrentQuotaLimitBase = armquota.CurrentQuotaLimitBase{
// Name: to.Ptr("MinPublicIpInterNetworkPrefixLength"),
// Type: to.Ptr("Microsoft.Quota/Quotas"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/Quotas/MinPublicIpInterNetworkPrefixLength"),
// Properties: &armquota.Properties{
// Name: &armquota.ResourceName{
// LocalizedValue: to.Ptr("Min Public Ip InterNetwork Prefix Length"),
// Value: to.Ptr("MinPublicIpInterNetworkPrefixLength"),
// },
// IsQuotaApplicable: to.Ptr(true),
// Limit: &armquota.LimitObject{
// LimitObjectType: to.Ptr(armquota.LimitTypeLimitValue),
// Value: to.Ptr[int32](10),
// },
// ResourceType: to.Ptr("MinPublicIpInterNetworkPrefixLength"),
// Unit: to.Ptr("Count"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureQuotaExtensionAPI } = require("@azure/arm-quota");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request.
*
* @summary Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request.
* x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json
*/
async function quotasUsagesRequestForNetwork() {
const resourceName = "MinPublicIpInterNetworkPrefixLength";
const scope =
"subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus";
const credential = new DefaultAzureCredential();
const client = new AzureQuotaExtensionAPI(credential);
const result = await client.quota.get(resourceName, scope);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Quota;
using Azure.ResourceManager.Quota.Models;
// Generated from example definition: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json
// this example is just showing the usage of "Quota_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this CurrentQuotaLimitBaseResource created on azure
// for more information of creating CurrentQuotaLimitBaseResource, please refer to the document of CurrentQuotaLimitBaseResource
string scope = "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus";
string resourceName = "MinPublicIpInterNetworkPrefixLength";
ResourceIdentifier currentQuotaLimitBaseResourceId = CurrentQuotaLimitBaseResource.CreateResourceIdentifier(scope, resourceName);
CurrentQuotaLimitBaseResource currentQuotaLimitBase = client.GetCurrentQuotaLimitBaseResource(currentQuotaLimitBaseResourceId);
// invoke the operation
CurrentQuotaLimitBaseResource result = await currentQuotaLimitBase.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
CurrentQuotaLimitBaseData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/Quotas/MinPublicIpInterNetworkPrefixLength",
"type": "Microsoft.Quota/Quotas",
"name": "MinPublicIpInterNetworkPrefixLength",
"properties": {
"limit": {
"limitObjectType": "LimitValue",
"value": 10
},
"name": {
"value": "MinPublicIpInterNetworkPrefixLength",
"localizedValue": "Min Public Ip InterNetwork Prefix Length"
},
"unit": "Count",
"isQuotaApplicable": true,
"resourceType": "MinPublicIpInterNetworkPrefixLength"
}
}
Definitions
CurrentQuotaLimitBase
Quota limit.
Name |
Type |
Description |
id
|
string
|
The resource ID.
|
name
|
string
|
The resource name.
|
properties
|
QuotaProperties
|
Quota properties for the specified resource, based on the API called, Quotas or Usages.
|
type
|
string
|
The resource type.
|
ExceptionResponse
Error.
LimitObject
The resource quota limit value.
Name |
Type |
Description |
limitObjectType
|
string:
LimitValue
|
The limit object type.
|
limitType
|
quotaLimitTypes
|
The quota or usages limit types.
|
value
|
integer
|
The quota/limit value
|
quotaLimitTypes
The quota or usages limit types.
Name |
Type |
Description |
Independent
|
string
|
|
Shared
|
string
|
|
QuotaProperties
Quota properties for the specified resource.
Name |
Type |
Description |
isQuotaApplicable
|
boolean
|
States if quota can be requested for this resource.
|
limit
|
LimitJsonObject:
LimitObject
|
Resource quota limit properties.
|
name
|
ResourceName
|
Resource name provided by the resource provider. Use this property name when requesting quota.
|
properties
|
object
|
Additional properties for the specific resource provider.
|
quotaPeriod
|
string
|
The time period over which the quota usage values are summarized. For example:
*P1D (per one day)
*PT1M (per one minute)
*PT1S (per one second).
This parameter is optional because, for some resources like compute, the period is irrelevant.
|
resourceType
|
string
|
The name of the resource type. Optional field.
|
unit
|
string
|
The quota units, such as Count and Bytes. When requesting quota, use the unit value returned in the GET response in the request body of your PUT operation.
|
ResourceName
Name of the resource provided by the resource Provider. When requesting quota, use this property name.
Name |
Type |
Description |
localizedValue
|
string
|
Resource display name.
|
value
|
string
|
Resource name.
|
ServiceError
API error details.
Name |
Type |
Description |
code
|
string
|
Error code.
|
details
|
ServiceErrorDetail[]
|
List of error details.
|
message
|
string
|
Error message.
|
ServiceErrorDetail
Error details.
Name |
Type |
Description |
code
|
string
|
Error code.
|
message
|
string
|
Error message.
|