Hi @Haseeb Ahmed
Welcome to Microsoft Q&A Forum and thanks for posting your query here!
As per the error message mentioned above, we see that it could be typically due to the authorization process when accessing Azure Storage. The error message suggests that the request is not authenticated.
Please consider checking the following suggestions 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. Try shortening the expiration time to 1 year.
- 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
Couple of additional work arounds mentioned here: https://stackoverflow.com/questions/24492790/azurestorage-blob-server-failed-to-authenticate-the-request-make-sure-the-value
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.