I'm looking for a way to programmatically retrieve the hardware specifications (specifically vCPU and RAM) for Azure App Service Plans by SKU
I have tried the REST APIs i could find to get Azure App service plan SKUs but none of them seem to return the actual hardware specs of the app service plan.
I have tried the following api endpoints:
https://management.azure.com/subscriptions/xxx/resourceGroups/rg-contoso/providers/Microsoft.Web/serverfarms/asp-contoso/skus?api-version=2024-04-01
https://management.azure.com/subscriptions/xxx/providers/Microsoft.Web/serverfarms?detailed=true&api-version=2024-04-01
An API that exist for the compute section
https://management.azure.com/subscriptions/xxx/providers/Microsoft.Compute/skus?api-version=2024-03-02
Perhaps there was one for server farms also undocumented but this returns an error.
https://management.azure.com/subscriptions/xxx/providers/Microsoft.Web/serverfarms/skus?api-version=2022-03-01
Error:
"error": {
"code": "ResourceNotFound",
"message": "The Resource 'Microsoft.Web/serverFarms/skus' under resource group '<null>' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
}
I have also tried to query the pricing API to see if I can find any information there but still only returnes non hardware spec
https://prices.azure.com/api/retail/prices$filter=serviceName%20eq%20'Azure%20App%20Service'
When opening the App Service Plan size picker in the Azure Portal, I looked at network requests via DevTools but couldn't find a direct API call that returns the hardware specs. It appears that this data is bundled in frontend JavaScript or comes from internal APIs that are not publicly documented that I can't inspect from the terminal as no REST request are shown.
Is there any official or unofficial way (via API, SDK, or other programmatic approach) to retrieve the hardware specs (vCPU and RAM) for App Service Plan SKUs?
Or is the only option to maintain a static, manually curated table using data from Microsoft's documentation?
I'm looking for an automated or regularly updated source that can be used in scripts or reporting tools. Any guidance would be appreciated.
Yes, you are right Azure APIs work the same way for everyone, no matter what language or tool you use. Whether it’s PowerShell, Python, or C#, when you get the details for an App Service Plan, the Azure API only tells you the SKU (like “S1” or “P1v3”), not the actual hardware specs such as vCPU or RAM.
So, what most people do (even inside PowerShell in Azure Functions) is create a small table in their code that lists what each SKU means in terms of hardware. Your script grabs the SKU from Azure, then looks up the specs from the own list.
Here’s a PowerShell example:
# Define your own table of specs
$skuSpecs = @{
"B1" = @{ vCPU = 1; RAM = "1.75 GB"; Storage = "10 GB" }
"S1" = @{ vCPU = 1; RAM = "1.75 GB"; Storage = "50 GB" }
"P1v3" = @{ vCPU = 2; RAM = "8 GB"; Storage = "250 GB" }
# Add more SKUs as needed
}
# Get the plan’s info from Azure
$asp = Get-AzAppServicePlan -ResourceGroupName "my-rg" -Name "my-asp"
# Look up the hardware details
$sku = $asp.Sku.Name
if ($skuSpecs.ContainsKey($sku)) {
$specs = $skuSpecs[$sku]
Write-Output "App Service Plan: $($asp.Name)"
Write-Output "SKU: $sku"
Write-Output "vCPU: $($specs.vCPU)"
Write-Output "RAM: $($specs.RAM)"
Write-Output "Storage: $($specs.Storage)"
} else {
Write-Output "Specs for SKU '$sku' not found."
}
Result: