azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

Limit list of possible deploy locations based on service

Open GeekTrainer opened this issue 3 years ago • 4 comments

Describe the bug

Certain services, such as Azure Static Web Apps, are only available in a subset of regions. When using azd provision the full list of Azure regions is displayed.

To Reproduce

  1. Create a template which uses a service available in a subset of regions
  2. Run azd provision
  3. The full list of regions is displayed

Expected behavior

When running azd provision, only the valid regions should display.

Environment

N/A

Additional context

I'd add it might be worthwhile considering having a reduced list of regions regardless of the service. The list of available regions is quite long, and can require a fair bit of scrolling to find the right one.

GeekTrainer avatar Jan 10 '22 22:01 GeekTrainer

Is there a programmatic way to discover what regions are supported by a specific service? I imagine if we wanted to this the right way we would need to inspect all resources which would be deployed by a template and then query to find the list of supported regions for each type and take the intersection of this list.

Something related for us to think about, imagine that I have a set of infrastructure and then I add a new resource that that resource is not supported in the currently selected location. Is this something we would now detect before sending a deployment to ARM (i.e. early in azd provision or would we just send the template and expect the ARM deployment to fail and we'd report that issue back to the user?

ellismg avatar Jan 11 '22 21:01 ellismg

I know certain services (App Services for one) do provide an API for listing the available locations. I did look at a couple of others (ASWA and SQL specifically), and at the very least it didn't appear there was an option through the CLI.

I think the experience would be better to fail before attempting to create resources. Especially considering how long certain resources take to create (Cosmos DB as an example), it can be frustrating to wait a handful of minutes only to have it fail and figure out what needs to be cleaned up since the operation isn't transactional.

GeekTrainer avatar Jan 12 '22 22:01 GeekTrainer

@ellismg - Will this be addressed in your region PR?

jongio avatar Jul 27 '22 17:07 jongio

Partly - we will use the @allowed decorator on the bicep file to control the allowable values for a location for a template and that will play into the values the user can select when configuring the location. But the template author must include this metadata, we are not going to try to query every RP to find all supported locations (we could, however, do that in the code we use to build these templates, so we don't have to manually keep it up to date).

ellismg avatar Jul 27 '22 23:07 ellismg

Seems duplicate of #2695 which is fixed now by azd handling allowed decorator.

rajeshkamal5050 avatar Sep 20 '23 05:09 rajeshkamal5050