在这个微软文档地址
https://docs.microsoft.com/en-us/azure/templates/microsoft.sql/servers/databases
我在许多参数中找到了以下注释:
要查看可能的值,请查询功能API。
不幸的是,没有解释如何查询“功能API”
任何的想法?
检查这个official document。
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities?api-version=2014-04-01
您可以使用Power Shell调用api(只是一个示例,您也可以使用其他语言来调用API)。
##get token
$TENANTID=""
$APPID=""
$PASSWORD=""
$result=Invoke-RestMethod -Uri https://login.microsoftonline.com/$TENANTID/oauth2/token?api-version=1.0 -Method Post -Body @{"grant_type" = "client_credentials"; "resource" = "https://management.core.windows.net/"; "client_id" = "$APPID"; "client_secret" = "$PASSWORD" }
$token=$result.access_token
##set subscriptionId
$subscriptionId=""
$Headers=@{
'authorization'="Bearer $token"
'host'="management.azure.com"
'contentype'='application/json'
}
$url="https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.Sql/locations/eastus/capabilities?api-version=2014-04-01"
Invoke-RestMethod -Uri $url -Headers $Headers -Method GET