如何在创建之前确定特定订阅/位置中可用的 Azure 应用服务计划 SKU?

问题描述 投票:0回答:1
  • 在 Microsoft 文档中,有一个记录良好的 API 端点,用于列出现有应用服务计划的可用应用服务计划 SKU/功能。 这里

  • 但是,当尝试为特定订阅/位置创建新的服务计划时,似乎没有提供直接端点或方法来预先检索可用 SKU 列表。

  • 在创建应用服务计划或

    Microsoft.Web/serverfarms
    资源之前,是否可以通过编程方式确定所提供的 Azure 订阅和位置中支持的应用服务计划 SKU?

azure azure-rm-template azure-app-service-plans server-farm
1个回答
0
投票

如何在创建之前确定特定订阅/位置中可用的 Azure 应用服务计划 SKU?

以编程方式,无法使用 ARM 模板检索它,但是,您可以使用 PowerShell 或 Azure 资源图查询资源管理器来实现要求,详情如下。

AZ PowerShell:

$appservice =  Get-AzAppServicePlan -Location "West US"
foreach($app in $appservice){
 $resourceGroup = $app.ResourceGroup
 $appName = $app.Name    
 $resources = Get-AzResource -ResourceGroupName $resourceGroup | Where-Object { $_.ResourceName -eq $appName }
 $sku = $resources.Sku
 $skus += $sku    
}

enter image description here

或者

(Get-AzAppServicePlan -Location "West US").SKU

enter image description here

Azure 资源图查询:

resources
| where type =~ "Microsoft.Web/serverfarms"  and location has  "WestUS"
| project sku

enter image description here

resources
| where type =~ "Microsoft.Web/serverfarms"  and subscriptionId has  "xxxxx"
| project sku.tier

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.