Storage Account Name Conflict
- Dominant language
- TypeScript
- Stars
- 79
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
`ng add @azure/ng-deploy` automatically chooses a storage account name based on the project name when the user initializes it and signs in. Sometimes, that storage account name can conflict with an existing storage account (the name must be globally unique).
Initialization does not immediately make the user aware that they do not own the storage account in question, and the init fails silently. The user is told:
> Account {{StorageAccountName}} already exist on subscription, using existing account.
In my case, the storage account name in question was not mine (and not in any of my subscriptions). I am working from an existing code sample.
When the user attempts to deploy the application (`ng deploy`), the following error is displayed:
> The resource 'Microsoft.Storage/storageAccounts/{{StorageAccountName}}' under resource group '{{ResourceGroup}}' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
**To Reproduce**
Steps to reproduce the behavior:
1. Choose a project name that causes a conflict with an existing storage account name. For example, name your project `angular9-todo-app`, so that initializing `ng-deploy` will set it up to connect to the existing storage account `angular9todoappstatic`. Make sure that storage account is not owned/accessible by you.
2. add ng-deploy with `ng add @azure/ng-deploy`
3. sign in
4. (storage account and other dependencies are created automatically)
5. > ✔ Creating resource group {{ResourceGroup}} at West US (westus)
Account {{StorageAccountName}} already exist on subscription, using existing account
CREATE azure.json (410 bytes)
UPDATE angular.json (5475 bytes
6. Deploy the app with `ng deploy`
7. > Preparing for deployment
Error when trying to deploy:
The Resource 'Microsoft.Storage/{{StorageAccountName}}' under resource group '{{ResourceGroup}}' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
**Expected behavior**
Either of the following behaviours would be nice:
1. create a storage account with a unique name, e.g., a UUID so there are no conflicts
2. To fail clearly at the initialization stage, when ng-deploy is added and the user signs in.
**Desktop (please complete the following information):**
- OS: Windows 10 Enterprise
**Additional context**
N/A
Contributor guide
Assessment
This issue has not been assessed yet.