Edit

Microsoft.Common.LocationSelector UI element

The LocationSelector user-interface (UI) element lets users select an Azure region for a subscription. It's the standalone region picker used when a form doesn't use the composite Microsoft.Common.ResourceScope element.

UI sample

The LocationSelector element renders a region dropdown.

Screenshot of the Microsoft.Common.LocationSelector UI element.

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
}

Sample output

{
  "name": "westus2",
  "displayName": "West US 2"
}

Remarks

  • scope.subscriptionId is required and should reference the selected subscription.
  • resourceTypes filters regions to locations that support the listed resource types.
  • allowedValues optionally limits the regions to an explicit list of location names. It can be an array or an expression that evaluates to an array.
  • Reference the selected location name with an expression such as [steps('basics').location.name].
  • For a resource-group deployment, use the selected location in view.outputs.location when the resource group is new or when the template needs an explicit deployment location.

Next steps