Gets the list of Batch supported Virtual Machine VM sizes available at the given location.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus?api-version=2022-10-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus?maxresults={maxresults}&$filter={$filter}&api-version=2022-10-01
URI Parameters
Name
In
Required
Type
Description
locationName
path
True
string
The region for which to retrieve Batch service supported SKUs.
subscriptionId
path
True
string
The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
api-version
query
True
string
The API version to be used with the HTTP request.
$filter
query
string
OData filter expression. Valid properties for filtering are "familyName".
maxresults
query
integer
int32
The maximum number of items to return in the response.
The operation was successful. The response contains the Batch service supported virtual machine vm sizes for the subscription in the specified location.
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python location_list_virtual_machine_skus.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 = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.location.list_supported_virtual_machine_skus(
location_name="japaneast",
)
for item in response:
print(item)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json
if __name__ == "__main__":
main()
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the list of Batch supported Virtual Machine VM sizes available at the given location.
*
* @summary Gets the list of Batch supported Virtual Machine VM sizes available at the given location.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json
*/
async function locationListVirtualMachineSkus() {
const subscriptionId = "subid";
const locationName = "japaneast";
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.location.listSupportedVirtualMachineSkus(locationName)) {
resArray.push(item);
}
console.log(resArray);
}
locationListVirtualMachineSkus().catch(console.error);
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json
// this example is just showing the usage of "Location_ListSupportedVirtualMachineSkus" 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 SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// invoke the operation and iterate over the result
AzureLocation locationName = new AzureLocation("japaneast");
await foreach (BatchSupportedSku item in subscriptionResource.GetBatchSupportedVirtualMachineSkusAsync(locationName))
{
Console.WriteLine($"Succeeded: {item}");
}
Console.WriteLine($"Succeeded");