Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The ResourceGroupSelector user-interface (UI) element lets users select an existing resource group or create a new one. It's the standalone resource-group picker used when a form doesn't use the composite Microsoft.Common.ResourceScope element.
UI sample
The ResourceGroupSelector element renders a resource-group dropdown with existing and new resource-group modes.
Schema
{
"name": "resourceGroup",
"type": "Microsoft.Common.ResourceGroupSelector",
"allowedMode": "Both",
"scope": {
"subscriptionId": "[steps('basics').subscription.subscriptionId]"
},
"constraints": {
"validations": [
{
"isValid": "[not(empty(steps('basics').resourceGroup.value.name))]",
"message": "Select or create a resource group."
}
]
},
"visible": true
}
Sample output
{
"mode": "New",
"value": {
"name": "example-rg",
"location": "westus2",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg"
}
}
Remarks
scope.subscriptionIdis required and should reference the selected subscription.allowedModecontrols whether users can create a resource group, use an existing resource group, or both. Valid values areBoth,CreateNew, andUseExisting.- Reference the resource group ID with
[steps('basics').resourceGroup.value.resourceId]. - Reference the resource group name with
[steps('basics').resourceGroup.value.name]. - Reference the selection mode with
[steps('basics').resourceGroup.mode]. - If the resource group can be new, pair this element with
Microsoft.Common.LocationSelectorand use that location whenmodeisNew.