-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support resource picker for parameters #4530
Comments
And does |
I think things are a little ad-hoc today (and we might end up treating the location value a little bit more like every other parameter than something special), but I think we'd be fine to change things up such that we always prompt for these values first.
@metadata({
azd: {
type: 'resource'
resourceType: 'Microsoft.OperationalInsights/workspaces'
}
})
param frontendLocation string I like this and I think it would be generally useful. I know that @wbreza has been playing around with some similar resource picking stuff in some exploratory work he's doing. Long term we might also want to add some sort of |
That's a good idea. Could unmarshal into a |
Speaking of which, if the parameter has a description, should we show that in some way? Presumably the template author added a descriptive description to describe what the parameter is for. Seems like a great thing to show in the UX. |
azd
supports a few "pickers" for parameters without default values today e.g.,Just like for any parameter named
location
, you'll prompt with a list of locations. This is also supported for a couple other types likegenerate
.It would be great to add support to query resources of a specific type e.g.,
This would list all the resources of that type discoverable to the user. Ideally, the display would put the location in parenthesis since they may want to limit those resources to just a location but you would have a hard time doing it above in any meaningful way because you'd either have to author it up front (not flexible), tie it to the
location
parameter (which you'd have to parse as an expression), or maybe just define auseLocation: bool
parameter and use thelocation
after you've already prompted/assigned it. Not sure how useful any of that would be, but listing names like "{name} ({location})" would be easy and useful, since ARM gives you back the locations as well.E.g.
az
CLI command:Scenarios
The reason why this would be useful is to provide a friendly interface for selecting resources you may want to reuse like AppInsights workspaces (often aggregates apps; this is my impetus for filing this feature request), dashboards (again, often aggregates), or for more expensive resources with multi-project support like Cognitive Services that may also pull from different organizational resources anyway.
It's possible now by passing an environment variable and using that in your
.parameters.json
file, but it's more work up front and doesn't really fit the UX you already have: you prompt for subscription and location already. Those could also be passed as required parameters but you provide a friendly UX to list them. Getting the resource ID of an existing resources can be a rather daunting task, so it seems that could be made easier as well for those "Getting started" scenarios that someazd
users are trying to provide for their downstream users e.g., if we usedazd
in our Azure SDKs' "Getting started" sections instead ofaz
CLI commands.The text was updated successfully, but these errors were encountered: