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

storage account naming guidance #10041

Closed
colemickens opened this issue Jul 24, 2019 · 10 comments
Closed

storage account naming guidance #10041

colemickens opened this issue Jul 24, 2019 · 10 comments
Assignees

Comments

@colemickens
Copy link
Contributor

This is a general question. Somehow, storage accounts are still required to be globally unique, and still only allowed to be 24 characters long. Meanwhile, there are locations with names that are 20 characters long. Say you are building images, which must be homed to a location, what is suggested as a naming scheme?

I can't think of anything better than finding some hashing function that outputs to 24 chars (...), and feed it a subscription id, location, and "unique name", but those output names are all going to be unreadable and generally nonsensical. Other platforms at least give canonical, short names that can be reliably used for naming in such scenarios.

This must be a wide-spread "issue". What are others doing?

@colemickens
Copy link
Contributor Author

colemickens commented Jul 25, 2019

DigitalOcean, Packet, and IBM Cloud use consistently-four-character names. They and the rest that I've checked (aka GCP/AWS) have neither such incredibly short storage account names, nor do they require global uniqueness.

edit: nice and unique: 2c72dd9fc5d7d7bb68d0156 😞

export AZURE_STORAGE_ACCOUNT_ID="nixos_production"
export AZURE_STORAGE_ACCOUNT_UNIQUE="${AZURE_SUBSCRIPTION_ID}${AZURE_LOCATION}${AZURE_STORAGE_ACCOUNT_ID}${AZURE_REPLICA}"
export AZURE_STORAGE_ACCOUNT_NAME="$(echo "${AZURE_STORAGE_ACCOUNT_UNIQUE}" | sha512sum | cut -c1-23)"```

@zikalino
Copy link

I think this discussion should not only include storage account names, there are other Azure resources that require names to be globally unique.

I am for instance concerned about examples, if you run examples that require unique name out of the box, most likely it will fail.

@colemickens
Copy link
Contributor Author

Here's the thing, I (feel like I) shouldn't have to do any of this anyway:

Managed disks takes care of storage accounts under the scenes... and yet... it can't replicate a blob from another location, and I still can't make images public across subscriptions. So instead, I have to do this all myself, maintain the scripts, and distribute them to users so they can then replicate blobs and construct their own images in their subscriptions...

[azureuser@xxnixos-22711:~/code/nixpkgs/nixos/maintainers/scripts/azure/v2]$ cat * | wc -l
139

@zikalino
Copy link

@colemickens regarding sharing images across subscriptions, you could use Shared Image Gallery az sig. will that help you?

@colemickens
Copy link
Contributor Author

colemickens commented Jul 25, 2019 via email

@colemickens
Copy link
Contributor Author

colemickens commented Jul 25, 2019 via email

@colemickens
Copy link
Contributor Author

It actually appears that Managed Disks + SIG might support exactly what I need to avoid managing storage accounts myself, but there's further clarification needed. See: #10192

@colemickens
Copy link
Contributor Author

colemickens commented Aug 24, 2019

Note: SIG names also have to be unique... At least it's only subscription-wide, I guess, instead of globally like storage accounts. No dashes in gallery names either.

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 8, 2019

@colemickens was your issue resolved?

@yonzhan yonzhan added this to the S164 milestone Dec 8, 2019
@yonzhan yonzhan modified the milestones: S164, S165 Feb 1, 2020
@yonzhan yonzhan modified the milestones: S165, S166 Feb 15, 2020
@yonzhan yonzhan modified the milestones: S166, S167 Mar 7, 2020
@yonzhan yonzhan modified the milestones: S167, S169 Mar 21, 2020
@jiasli
Copy link
Member

jiasli commented Apr 20, 2020

I think the limitation on Storage Account name is out of the scope of Azure CLI.

The reason why it has to be globally unique is because the name is used as part of the domain name http://mystorageaccount.blob.core.windows.net to identity the Storage Account.

I checked the feedback forum and did see this post: Increase Storage Account Name Length from Max of 24 Characters. You may vote on this post to get Storage team noticed. Thank you for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants