Skip to content

[azure/storage-blob] , Intermitent failure while deploying ARM template stored in Storage account. #31411

Open

Description

  • Package Name: azure/storage-blob
  • Package Version: 12.23.0-beta.1
  • Operating system: windows
  • nodejs
    • version: 20.18.0
  • browser
    • name/version: Chrome , Edge
  • typescript
    • version:

Describe the bug
Hi , I am trying to deploy an ARM template stored in storage account by generating a URL . I am following this guide to generate URL - https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-azure-button#template-stored-in-azure-storage-account

But I am facing intermitent issues while deploying the template . Sometimes it works but sometimes it fails. We have tested it on multilple machines .We receive the following error.
Image

If we open the URL in above screenshot , in a browser . we see this error -
RestError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

AuthenticationFailed Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:03824724-601e-0041-2825-1f9ee4000000 Time:2024-10-15T17:13:39.3694765Z Signature fields not well formed.

To Reproduce
Steps to reproduce the behavior:

  1. shared sample code

Expected behavior
The upload template should work each time.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Sharing the code for reference -
We see this intermitent issue in line number 18 and line 22

  1. const sasToken = generateBlobSASQueryParameters(
  2.  	{
    
  3.  		containerName,
    
  4.  		permissions: BlobSASPermissions.parse("racwd"),
    
  5.  		expiresOn: new Date(new Date().valueOf() + 86400),
    
  6.  	},
    
  7.  	sharedKeyCredential
    
  8.  ).toString();
    
  9. 	let sasUrls: string[] = [];
    
  10. 	try {
    
  11. 		for (let i = 0; i < templates.length; i++) {
    
  12. 			const blobName = utils.generateTemplatePath(this.migrationStateModel, this._targetType, i + 1);
    
  13. 			var sasUrl = `https://${accountName}.blob.core.windows.net/${containerName}/${blobName}?${sasToken}`;
    
  14. 			sasUrls.push(sasUrl);
    
  15. 			const blockBlobClient = new BlockBlobClient(sasUrl);
    
  16. 			await blockBlobClient.upload(templates[i], templates[i].length);
    
  17. 		}
    
  18. 		for (let i = 0; i < sasUrls.length; i++) {
    
  19.                let deployToAzureUrl = 'https://portal.azure.com/#create/Microsoft.Template/uri/' + encodeURIComponent(sasUrls[i]);
    	exec(`${opener} ${deployToAzureUrl}`);
                    }
    
  20. 	}
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions