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

Your deployment failed Deployment name:TemplateDeployment #3

Closed
Felipetsa opened this issue Feb 18, 2022 · 6 comments
Closed

Your deployment failed Deployment name:TemplateDeployment #3

Felipetsa opened this issue Feb 18, 2022 · 6 comments

Comments

@Felipetsa
Copy link

Hi,
When I run > Invoke-WebRequest http://bit.ly/reader-scenarios -O reader-scenario.ps1 (Page 187) I'm getting "Deployment failed. Click here for details"

Error details:
{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"message":"Website with given name webap-n77iodknbqbau already exists."}]}

Status: Conflict

{
"status": "Failed",
"error": {
"code": "Conflict",
"message": "Website with given name webap-n77iodknbqbau already exists.",
"details": [
{
"message": "Website with given name webap-n77iodknbqbau already exists."
},
{
"code": "Conflict"
},
{}
]
}
}
chrome_aC4od6boMu

@davidokeyode
Copy link
Collaborator

Hi Felipe, can you try running it again? Seems like the random name generated for the app already existed. Delete the resource group and rerun. Let me know how it goes.

@Felipetsa
Copy link
Author

Felipetsa commented Feb 22, 2022

Hi David, many thanks for your reply! I've deleted "Pentest-rg" resource group and I rerun the script, but the problem is still the same.
chrome_rCyiw5OM07
jfs3ND53kJ

I'm also attaching the deployment result:
reader-account-output.txt

I have 4 resource groups in my tenant at the moment:
chrome_Lrr2Nztq1h

Does it matter which country I'm in? I'm in the North Europe region.

Thank you for your help!

@Felipetsa
Copy link
Author

Hi David, sorry for the hassle but do you have any clue? Just impacting my way through the book. Thank you.

@swattor
Copy link

swattor commented Mar 9, 2022

It seems that the script does not create a random name. I have the same failure with the same message failed to create 'webap-n77iodknbqbau'

It looks like a bug - all the other resources are created with uniqueString(resourceGroup().id))]" whereas the webapp is created with uniqueString(resourceGroup().name))]"

@Felipetsa
Copy link
Author

Hi @swattor , I got it sorted following the steps below:

  1. Delete the resource group.
  2. Copy the script https://raw.githubusercontent.com/PacktPublishing/Penetration-Testing-Azure-for-Ethical-Hackers/main/chapter-4/resources/badtemplate.json and edit it using your favorite editor.
  3. Search for this line on the script: "defaultValue": "[concat('webap-' and change it to "defaultValue": "[concat('webapp-'
  4. Upload the script here on GitHub keeping the same name badtemplate.json
  5. Edit reader-scenario.ps1 and point it to your new badtemplate.json path (https://raw.githubusercontent.com/YOUR-GITHUB/reader-scenario.ps1
  6. Run it again.

Unfortunately, I had little support from the authors on this problem. Hope this works for you too.

@kfosaaen
Copy link
Collaborator

I've corrected the "webap" line in the template file. Sorry for the delays in addressing this. My notifications got turned off for issues on the repo. I've tested this in my own environment and it appears to be running correctly now.

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

No branches or pull requests

4 participants