是否有 azure API App cmdlet?
Is there any azure API App cmdlet?
有人知道用于在 powershell 中创建 API 应用程序的 cmdlet 吗?我试着寻找它,但找不到任何东西。我认为 New-AzureRmWebApp
是通过一些 type
的方式,有人对此有想法吗?
如 evilSnobu in this 所述,它稍作修改即可工作。所以如果有人需要,我会发布答案。
# CREATE "just-an-api" API App
$ResourceLocation = "West US"
$ResourceName = "just-an-api"
$ResourceGroupName = "demo"
# If we want to create under a specific app plan, we need to pass the server farmid in format
$serverFarmId = "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.Web/serverfarms/<app_service_plan_name>;
#If nothing is passed inside $PropertiesObject, it create s default app service plan.
$PropertiesObject = @{"serverFarmId"=$serverFarmId}
New-AzureRmResource -Location $ResourceLocation `
-PropertyObject $PropertiesObject `
-ResourceGroupName $ResourceGroupName `
-ResourceType Microsoft.Web/sites `
-ResourceName "just-an-api" ` #removing $ResourceName, as either one is required.
-Kind 'api' `
-ApiVersion 2016-08-01 -Force
有人知道用于在 powershell 中创建 API 应用程序的 cmdlet 吗?我试着寻找它,但找不到任何东西。我认为 New-AzureRmWebApp
是通过一些 type
的方式,有人对此有想法吗?
如 evilSnobu in this
# CREATE "just-an-api" API App
$ResourceLocation = "West US"
$ResourceName = "just-an-api"
$ResourceGroupName = "demo"
# If we want to create under a specific app plan, we need to pass the server farmid in format
$serverFarmId = "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.Web/serverfarms/<app_service_plan_name>;
#If nothing is passed inside $PropertiesObject, it create s default app service plan.
$PropertiesObject = @{"serverFarmId"=$serverFarmId}
New-AzureRmResource -Location $ResourceLocation `
-PropertyObject $PropertiesObject `
-ResourceGroupName $ResourceGroupName `
-ResourceType Microsoft.Web/sites `
-ResourceName "just-an-api" ` #removing $ResourceName, as either one is required.
-Kind 'api' `
-ApiVersion 2016-08-01 -Force