Azure / Azure/azure-quickstart-templates
Cannot rerun front-door-standard-premium-storage-static-website template
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
[front-door-standard-premium-storage-static-website](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.cdn/front-door-standard-premium-storage-static-website)
### Issue Details
First run of this template works successfully, subsequent runs fail making this template unusable in a continuous delivery pipeline.
After deploying this template first time, I'm able to see the "Welcome" text on the index page of the frontDoorEndpointHostName output. However, any subsequent runs of this main.bicep file fail if any changes have been made.
It is my understanding that Bicep/ARM templates are designed to be Desired State Configuration and expected to be used as such (run many times to apply updates). However, this template doesn't seem to work in this fashion. What am I missing?
### Repro steps
1. git clone https://github.com/Azure/azure-quickstart-templates.git
2. Create a resource group named "cdn".
3. az login
4. front-door-standard-premium-storage-static-website> az deployment group create --resource-group cdn --template-file main.bicep
5. Verify "Welcome" is viewable at the host that is shown in the output for frontDoorEndpointHostName from step 4.
6. Modify scripts\enable-storage-static-website.ps1 Line 15 to say "Welcome!"
7. Rerun command from Step 4, get the following error:
{"status":"Failed","error":{"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":[{"code":"Conflict","message":"{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"DeploymentFailed\",\r\n \"message\": \"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.\",\r\n \"details\": [\r\n {\r\n \"code\": \"Conflict\",\r\n \"message\": \"{\\r\\n \\\"status\\\": \\\"failed\\\",\\r\\n \\\"error\\\": {\\r\\n \\\"code\\\": \\\"ResourceDeploymentFailure\\\",\\r\\n \\\"message\\\": \\\"The resource operation completed with terminal provisioning state 'failed'.\\\",\\r\\n \\\"details\\\": [\\r\\n {\\r\\n \\\"code\\\": \\\"DeploymentScriptError\\\",\\r\\n \\\"message\\\": \\\"The provided script failed with the following error:\\\\r\\\\nSystem.NullReferenceException: Object reference not set to an instance of an object.\\\\n at Microsoft.PowerShell.ConsoleHostUserInterface.PromptForChoice(String caption, String message, Collection`1 choices, Int32 defaultChoice)\\\\n at System.Management.Automation.Internal.Host.InternalHostUserInterface.PromptForChoice(String caption, String message, Collection`1 choices, Int32 defaultChoice)\\\\n at System.Management.Automation.MshCommandRuntime.InquireHelper(String inquireMessage, String inquireCaption, Boolean allowYesToAll, Boolean allowNoToAll, Boolean replaceNoWithHalt, Boolean hasSecurityImpact)\\\\n at System.Management.Automation.MshCommandRuntime.DoShouldContinue(String query, String caption, Boolean hasSecurityImpact, Boolean supportsToAllOptions, Boolean& yesToAll, Boolean& noToAll)\\\\n at System.Management.Automation.MshCommandRuntime.ShouldContinue(String query, String caption)\\\\n at System.Management.Automation.Cmdlet.ShouldContinue(String query, String caption)\\\\n at Microsoft.WindowsAzure.Commands.Storage.Blob.StorageDataMovementCmdletBase.b__21_1(String s1, String s2, String s3)\\\\n at Microsoft.WindowsAzure.Commands.Storage.Common.TaskOutputStream.ConfirmRequest(ConfirmTaskCompletionSource tcs)\\\\n--- End of stack trace from previous location where exception was thrown ---\\\\n at Microsoft.WindowsAzure.Commands.Storage.Blob.StorageDataMovementCmdletBase.ConfirmOverwriteAsync(Object source, Object destination)\\\\n at Microsoft.Azure.Storage.DataMovement.TransferControllers.TransferControllerBase.CheckOverwriteAsync(Boolean exist, Object source, Object dest)\\\\n at Microsoft.Azure.Storage.DataMovement.TransferControllers.BlockBlobWriter.HandleFetchAttributesResultAsync(Exception e)\\\\n at Microsoft.Azure.Storage.DataMovement.TransferControllers.BlockBlobWriter.FetchAttributesAsync()\\\\n at Microsoft.Azure.Storage.DataMovement.TransferControllers.BlockBlobWriter.DoWorkInternalAsync()\\\\n at Microsoft.Azure.Storage.DataMovement.TransferControllers.SyncTransferController.DoWorkInternalAsync()\\\\n at Microsoft.Azure.Storage.DataMovement.TransferControllers.TransferControllerBase.DoWorkAsync()\\\\n at Microsoft.Azure.Storage.DataMovement.TransferScheduler.ExecuteJobInternalAsync(TransferJob job, CancellationToken cancellationToken)\\\\n at Microsoft.Azure.Storage.DataMovement.SingleObjectTransfer.ExecuteAsync(TransferScheduler scheduler, CancellationToken cancellationToken)\\\\n at Microsoft.Azure.Storage.DataMovement.TransferManager.DoTransfer(Transfer transfer, TransferContext transferContext, CancellationToken cancellationToken)\\\\n at Microsoft.WindowsAzure.Commands.Storage.Common.DataMovementTransferHelper.DoTransfer(Func`1 doTransfer, ProgressRecord record, TaskOutputStream outputStream)\\\\n at Microsoft.WindowsAzure.Commands.Storage.Blob.SetAzureBlobContentCommand.Upload2Blob(Int64 taskId, IStorageBlobManagement localChannel, String filePath, CloudBlob blob)\\\\n at Microsoft.WindowsAzure.Commands.Storage.Common.LimitedConcurrencyTaskScheduler.RunConcurrentTask(Int64 taskId, Task task)\\\\r\\\\nat , /mnt/azscripts/azscriptinput/userscript.ps1: line 16\\\\r\\\\nat , : line 1\\\\r\\\\nat , /mnt/azscripts/azscriptinput/DeploymentScript.ps1: line 239. Please refer to https://aka.ms/DeploymentScriptsTroubleshoot for more deployment script information.\\\"\\r\\n }\\r\\n ]\\r\\n }\\r\\n}\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n}"}]}}
Contributor guide
No contributing guide indexed for this repository
Research direction
Read quickstarts/microsoft.cdn/front-door-standard-premium-storage-static-website/main.bicep and scripts/enable-storage-static-website.ps1, especially line 15, then reproduce the deployment with az deployment group create. Modify the script as described and rerun the deployment; done means the second deployment succeeds and the updated static-site text is available at the reported endpoint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100