support for default location#4752
Conversation
weikanglim
left a comment
There was a problem hiding this comment.
LGTM. This is a solid value add to our azd picklist customization strategy in Bicep. Only left some very minor comments.
|
@vhvb1989 any impact for VS integration? |
No. VS does neither understand or use azd metadata. VS owns the prompting logic and the UI for it. IIRC, they use combobox controls to pick sub and location and a simple inputbox for other string parameters. Most likely they ignore annotations like |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
This PR adds the ability to set a default location, as part of the bicep definition, to be selected by azd during user prompt.
This feature works with priority levels. The default location setting priority is as follows, from highest to lowest:
location. Azd skips the location prompt for main location and uses the value from the system environment when set.When using metadata type
locationplusdefaultLocation, azd will list all locations and select thedefaultLocationfrom the list.@allowedtag in the bicep parameter likeThe
default locationin this case is the first location from the allowed array. You can also add thedefaultLocationto the metadata to set a specific location as the default, like:The metadata
defaultLocationtakes higher priority then the allowed array and is used.defaultLocation(metadata) or allowed array is set, azd check if there is a default location saved in the azd local config for the user (~/.azd/config.json) and use that value as the default. This is the lowest priority and the current behavior before this PR.fix: #4749