LocationSelector使用者介面(UI)元素讓使用者選擇 Azure 區域來訂閱。 它是當表單沒有使用複合 Microsoft.Common.ResourceScope 元素時使用的獨立區域選擇器。
使用者介面範例
該 LocationSelector 元素會渲染一個區域下拉選單。
Schema
{
"name": "location",
"type": "Microsoft.Common.LocationSelector",
"label": "Region",
"toolTip": "Select the Azure region for the resources.",
"resourceTypes": [
"Microsoft.Storage/storageAccounts"
],
"allowedValues": [
"eastus",
"westus2"
],
"scope": {
"subscriptionId": "[steps('basics').subscription.subscriptionId]"
},
"visible": true
}
範例輸出
{
"name": "westus2",
"displayName": "West US 2"
}
Remarks
-
scope.subscriptionId必須,且應參考所選訂閱。 -
resourceTypes篩選區域至支援上述資源類型的地點。 -
allowedValues可選擇性地將區域限制為明確的地點名稱清單。 它可以是一個陣列,也可以是一個計算到陣列的運算式。 - 用如 的表達式
[steps('basics').location.name]來參考所選的位置名稱。 - 對於資源群組部署,當資源群組是新建或範本需要明確部署位置時,請使用所選位置
view.outputs.location。