Skip to content
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

Not able to identify the case-sensitivity of Azure locations #22536

Open
dunefro opened this issue Mar 6, 2024 · 2 comments
Open

Not able to identify the case-sensitivity of Azure locations #22536

dunefro opened this issue Mar 6, 2024 · 2 comments
Assignees
Labels
Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@dunefro
Copy link

dunefro commented Mar 6, 2024

Bug Report

  • import path of package in question, e.g. "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
  • SDK version e.g. 4.2.1
  • output of go version go1.21.3 darwin/arm64

What happened?

I am trying to write a function which can list the SKU family based on the instance size and region. The code snippet looks like this

	newpager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil, IncludeExtendedLocations: nil})
	for newpager.More() {
		page, err := newpager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			// fmt.Println(*v.Name)
			if *v.Name == "Standard_D2ds_v5" {
				fmt.Println(*v.Family, *v.Locations[0])
			}
			// _ = v
		}
	}

I tried using a filter like this but it doesn't work and still it prints all of the locations. This is given in the documentation example

locationFilter := "location -eq 'CentralIndia'"
newpager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: &locationFilter, IncludeExtendedLocations: nil})

Weirdly the regions that the above code snippet prints has no common case sensitivity. Check the following output

standardDDSv5Family AustraliaCentral
standardDDSv5Family AustraliaCentral2
standardDDSv5Family australiaeast
standardDDSv5Family australiasoutheast
standardDDSv5Family brazilsouth
standardDDSv5Family BrazilSoutheast
standardDDSv5Family CanadaCentral
standardDDSv5Family CanadaEast
standardDDSv5Family CentralIndia
standardDDSv5Family centralus
standardDDSv5Family CentralUSEUAP
standardDDSv5Family eastasia
standardDDSv5Family eastus
standardDDSv5Family eastus2
standardDDSv5Family EastUS2EUAP
standardDDSv5Family FranceCentral
standardDDSv5Family FranceSouth
standardDDSv5Family GermanyNorth
standardDDSv5Family GermanyWestCentral
standardDDSv5Family IsraelCentral
standardDDSv5Family ItalyNorth
standardDDSv5Family japaneast
standardDDSv5Family japanwest
standardDDSv5Family JioIndiaWest
standardDDSv5Family KoreaCentral
standardDDSv5Family KoreaSouth
standardDDSv5Family MalaysiaSouth
standardDDSv5Family MexicoCentral
standardDDSv5Family northcentralus
standardDDSv5Family northeurope
standardDDSv5Family NorwayEast
standardDDSv5Family NorwayWest
standardDDSv5Family PolandCentral
standardDDSv5Family QatarCentral
standardDDSv5Family SouthAfricaNorth
standardDDSv5Family SouthAfricaWest
standardDDSv5Family southcentralus
standardDDSv5Family SouthCentralUSSTG
standardDDSv5Family southeastasia
standardDDSv5Family SouthIndia
standardDDSv5Family SpainCentral
standardDDSv5Family SwedenCentral
standardDDSv5Family SwedenSouth
standardDDSv5Family SwitzerlandNorth
standardDDSv5Family SwitzerlandWest
standardDDSv5Family TaiwanNorth
standardDDSv5Family TaiwanNorthwest
standardDDSv5Family UAECentral
standardDDSv5Family UAENorth
standardDDSv5Family uksouth
standardDDSv5Family ukwest
standardDDSv5Family westcentralus
standardDDSv5Family westeurope
standardDDSv5Family westus
standardDDSv5Family westus2
standardDDSv5Family WestUS3

I also tried to check if the armsubscriptions.Location has some mapping to check the region name printed above to the one it actually displays via Location.Name or Location.DisplayName. But there isn't.

Ultimately how can I know the location name will be lowercase, camelcase or any other. for e.g. when checking central india form the armsubscriptions.Location it gives centralindia and Central India as the name and DisplayName respectively, but in the above output I see that I need to check for CentralIndia for the amiFamily.

What did you expect or want to happen?

I expect a common ground on how can I use the location or atleast some mapping which maps the different cases.

How can we reproduce it?

Execute the above code.

Anything we should know about your environment.

uname -a
Darwin ip-192-168-1-3.ec2.internal 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 6, 2024
@jhendrixMSFT jhendrixMSFT added Compute Service Attention This issue is responsible by Azure service team. Mgmt This issue is related to a management-plane library. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Mar 6, 2024
@github-actions github-actions bot added the needs-team-attention This issue needs attention from Azure service team or SDK team label Mar 6, 2024
Copy link

github-actions bot commented Mar 6, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @amjads1 @avirishuv @Drewm3 @Vaibhav-Agar.

@TravisCragg-MSFT TravisCragg-MSFT self-assigned this Mar 7, 2024
@TravisCragg-MSFT
Copy link

@dunefro Thank you for the Feedback! I definitely agree that this can use some standardization.

Also, we will be adding a query function to the SKU API itself to retrieve this information in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants