-
Notifications
You must be signed in to change notification settings - Fork 173
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
List all regions when a debug flag is set #3781
base: main
Are you sure you want to change the base?
List all regions when a debug flag is set #3781
Conversation
By default, `azd` only lists a subset of the locations that a user has access to. Our filtering huristics exclude both EUAP and the "stage" regions which some customers may have access to but in practice don't always support all of the infrastructure that users of `azd` may try to provison. However, when testing new features, it's often useful to be able to select these regions from the picker, instead of forcing folks to run something like `azd env set AZURE_LOCATION <short-name-of-region>` This change adds support for setting `AZD_DEBUG_INCLUDE_ALL_LOCATIONS` to a true value (as recognized by `strconv.ParseBool`) to prevent us from filtering out these other locations.
@weikanglim @vhvb1989 Proposing this as something we may want to do (perhaps it's better to express it with a user config flag that they can set with Just a thought. |
@@ -111,16 +113,32 @@ func (s *SubscriptionsService) ListSubscriptionLocations( | |||
locations := []Location{} | |||
pager := client.NewListLocationsPager(subscriptionId, nil) | |||
|
|||
includeLocation := func(location *armsubscriptions.Location) bool { | |||
// By default, we only include physical regions that have a physical location. In practice this filters out the EUAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering... What are the implications if we always listed all locations regardless of it being physical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question - I wrote a small little program to answer this question:
https://gist.github.com/ellismg/5362960c75ef6cadb0093ce93962dd8d
It printed:
Non Physical Region centralusstage Central US (Stage) (Logical)
Non Physical Region eastusstage East US (Stage) (Logical)
Non Physical Region eastus2stage East US 2 (Stage) (Logical)
Non Physical Region northcentralusstage North Central US (Stage) (Logical)
Non Physical Region southcentralusstage South Central US (Stage) (Logical)
Non Physical Region westusstage West US (Stage) (Logical)
Non Physical Region westus2stage West US 2 (Stage) (Logical)
Non Physical Region asia Asia (Logical)
Non Physical Region asiapacific Asia Pacific (Logical)
Non Physical Region australia Australia (Logical)
Non Physical Region brazil Brazil (Logical)
Non Physical Region canada Canada (Logical)
Non Physical Region europe Europe (Logical)
Non Physical Region france France (Logical)
Non Physical Region germany Germany (Logical)
Non Physical Region global Global (Logical)
Non Physical Region india India (Logical)
Non Physical Region israel Israel (Logical)
Non Physical Region italy Italy (Logical)
Non Physical Region japan Japan (Logical)
Non Physical Region korea Korea (Logical)
Non Physical Region newzealand New Zealand (Logical)
Non Physical Region norway Norway (Logical)
Non Physical Region poland Poland (Logical)
Non Physical Region qatar Qatar (Logical)
Non Physical Region singapore Singapore (Logical)
Non Physical Region southafrica South Africa (Logical)
Non Physical Region sweden Sweden (Logical)
Non Physical Region switzerland Switzerland (Logical)
Non Physical Region uae United Arab Emirates (Logical)
Non Physical Region uk United Kingdom (Logical)
Non Physical Region unitedstates United States (Logical)
Non Physical Region unitedstateseuap United States EUAP (Logical)
Non Physical Region eastasiastage East Asia (Stage) (Logical)
Non Physical Region southeastasiastage Southeast Asia (Stage) (Logical)
Physical Region with No Location brazilus Brazil US (Physical)
Physical Region with No Location centraluseuap Central US EUAP (Physical)
Physical Region with No Location eastus2euap East US 2 EUAP (Physical)
There seem to be three "classes" of locations here:
- The "Stage" regions, which I am pretty sure are not present in most subscriptions, since they feel like internal testing environments we happen to have access to since we are in the Microsoft tenant. (From experience, ARM doesn't seem to accept these regions)
- A bunch of logical regions that correspond to geographies on the map (I think ARM rejects submitting to any of these)
- A few which are physical which have no physical location, this includes the EUAP regions (which mostly work, however we have seen cases that certain types of resources can't be provisioned there, e.g. a log analytics workspace) and this "Brazil US" region, which I don't know anything about.
I suspect that at a minimum we almost always want to reject the logical regions. I could imagine that maybe including the physical ones with no locations could be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can land a change that mirrors the Portal behavior, that would be the most ideal in my mind...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The locations list in the portal depends on the subscription and service/resource you are creating.
There's a management api (IIRC) which allows you to list the supported regions for a resource. That would follow what the portal does
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSIDocumentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Ran into this today, would definitely want to show all regions by default so the user doesn't have to hunt for the setting when it doesn't' appear. I spent roughly 30-60 researching why the region wasn't appearing in the list. I ultimately had to reach out to Victor who pointed me to this issue. Our customers won't have that luxury of Victor on call. |
@jongio Which region specifically? EUAP or others? I could imagine us always including EUAP but we should hide the others by default I think. The fact that we are doing filtering here at all is driven by user feedback from the past... I think these "stage" regions that a bunch of at least MSFT folks have access to just don't work from the point of view of someone who is not an Azure service engineer and if people pick them they will have a very bad time... |
I would use an opt-in setting in user config for this @ellismg. |
EAUP. If you use list-locations, then it will only show locations applicable to that sub. So, shouldn't be a prob |
I don't know about that one. Now the user would have to search for that setting to figure out why locations aren't appearing. |
By default,
azd
only lists a subset of the locations that a user has access to. Our filtering huristics exclude both EUAP and the "stage" regions which some customers may have access to but in practice don't always support all of the infrastructure that users ofazd
may try to provison.However, when testing new features, it's often useful to be able to select these regions from the picker, instead of forcing folks to run something like
azd env set AZURE_LOCATION <short-name-of-region>
This change adds support for setting
AZD_DEBUG_INCLUDE_ALL_LOCATIONS
to a true value (as recognized bystrconv.ParseBool
) to prevent us from filtering out these other locations.