Hello Fahima Chowdhury,
Greetings! Welcome to Microsoft Q&A Platform.
I understand that you are trying to perform get file operation and getting error with SAS token which is failing to authenticate ('Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature) as the error is related to authentication. The error message suggests that the request is not authenticated.
Please consider checking the following factors to resolve the issue,
- Check if the SAS token has expired. Even though the SAS token has valid dates, it is possible that it has expired. Make sure that the SAS token is still valid and has not expired.
- Check if the SAS token has the correct permissions. Make sure that the SAS token has the correct permissions to upload files to the Azure storage account.
- Check if the SAS token has the correct format. Make sure that the SAS token has the correct format and that it includes all the required parameters.
- Check if there are any network connectivity issues. Make sure that there are no network connectivity issues that may be preventing the request from being authenticated.
- Verify System Time (Make sure that the system time on the machine generating the SAS token is accurate. A significant time discrepancy could lead to authentication failures)
- Try to regenerate New SAS token and upload
- For testing purpose can you upload using Storage account key and Storage explorer or azcopy tool?
Try to create a SAS URI at the storage account level instead of container level to fix the authentication issue. More examples are available in the CLI documentation. Make sure you include all the necessary permissions for the SAS token, a list can be found here.
refer - https://learn.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas
Few more workaround options are discussed at this link: azurestorage-blob-server-failed-to-authenticate-the-request-make-sure-the-value
Similar SO thread for reference - https://stackoverflow.com/questions/58565283/azure-blob-storage-sas-error-authenticationfailed, https://stackoverflow.com/questions/25038429/azure-shared-access-signature-signature-did-not-match, https://github.com/Azure/azure-sdk-for-java/issues/38467.
Please let us know if this solves the issue and do let us know if you have any further queries.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.