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

Can't create workload with same name as another workload anywhere in Azure #576

Closed
agoodmiller opened this issue Dec 15, 2021 · 2 comments · Fixed by #579
Closed

Can't create workload with same name as another workload anywhere in Azure #576

agoodmiller opened this issue Dec 15, 2021 · 2 comments · Fixed by #579
Assignees
Labels
bug Something isn't working

Comments

@agoodmiller
Copy link

Description

If i use the name tier3 as my workload name, the script errs out with (I do not have a tier3 in my subscription):
{"error":{"code":"InvalidTemplateDeployment","message":"The template deployment 'tier3' is not valid according to the validation procedure. The tracking id is 'bf1a2831-9730-4642-a2b9-4c63159e64e4'. See inner errors for details.","details":[{"code":"PreflightValidationCheckFailed","message":"Preflight validation failed. Please refer to the details for the specific errors.","details":[{"code":"StorageAccountAlreadyTaken","target":"logsyhdfpdatgh7j2","message":"The storage account named logsyhdfpdatgh7j2 is already taken."}]}]}}

i ran it 4 different times and got the exact same error each time : "StorageAccountAlreadyTaken","target":"logsyhdfpdatgh7j2"

It seems that, forwheter reason, the uniqueString(parameters('workloadName')) code in bicep isn't using anything other than the name to seed the UniqueString operation.
I assume it's also because someone else has used the script to create a tier3 and not deleted their test environment,

Steps to Reproduce

Steps to reproduce the behavior:

  1. create the initial MLZ
  2. set the workloadName to "tier3"
  3. run the workload creation

Expected behavior

it creates the new workload tier.

Actual behavior

It errs out before even running

Screenshots

image

Additional context

Operating System:windows 11
Terraform Version: N/A
Cloud (public, Azure Government, etc.): Public

@agoodmiller agoodmiller added the bug Something isn't working label Dec 15, 2021
@glennmusa
Copy link
Contributor

glennmusa commented Dec 15, 2021

Hi @agoodmiller thank you for submitting a bug with helpful context and reproduction steps.

There has, very recently, been updates to the New Workload example to reduce the likelihood of a naming collision for storage accounts: #572

We have a discussion thread about this if you're interested in participating: #575

In any event, the latest version of the New Workload template should prevent this from occurring. If you still encounter this error with these latest steps, let us know:

https://github.com/Azure/missionlz/tree/main/src/bicep/examples/newWorkload#deploy-the-example

@brooke-hamilton
Copy link
Contributor

@agoodmiller thank you for the bug report!

I did these steps to repro the issue, and I think like @glennmusa said the issue is likely fixed in very recent updates.

  1. Deploy MLZ using defaults
  2. Generate the deploymentVariables.json file from the deployment following these steps the new workload readme.
  3. Deploy the new workload example using --parameters workloadName=tier3.
    The deployment succeeded.

I found some documentation errors while working through this and I'll address those too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants