An Azure service that offers file shares in the cloud.
Hello @86107085,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
I understand your question about the error “This request is not authorized to perform this operation” when using a SAS URL to access Azure File Shares. This usually means that the SAS token is either invalid, expired, or does not have the necessary permissions for the operation. Here are some important points to check:
- SAS Token Validity: Please check if the SAS token is still valid at the time the error occurs. Since SAS tokens are time-limited, any request made after they expire will not work. Also, make sure the client machine's clock is set correctly to UTC, as a time mismatch can make SAS tokens seem expired earlier than they actually are.
- Permissions on the SAS: Make sure the SAS token has the appropriate permissions, such as r for read, w for write, l for list, and d for delete. If you experience intermittent issues with browsing or uploading, confirm that the SAS includes both list and write permissions.
- Scope of the SAS: Ensure the SAS is assigned to the correct resource type, whether that's service, container/share, or object/file level. Remember, a file-level SAS doesn't allow directory browsing, while a share-level SAS does.
- Storage Account Settings: If you are using a Storage account firewall or network restrictions, make sure the client's IP address is permitted. Also, check if shared key access or SAS tokens are disabled at the account level.
- Token Regeneration and Rotation: If the SAS was created with a Stored Access Policy, check to ensure the policy hasn't been changed or removed. You may also want to regenerate the SAS and test with a new token to eliminate the possibility of token corruption or policy updates.
Please refer below link for more information: Grant limited access to data with shared access signatures (SAS) - Azure Storage | Microsoft Learn
Next Action: Check your current SAS token to confirm its expiry, scope, and permissions. If needed, generate a new SAS from Azure Portal or CLI with the necessary permissions and test again. If the problem continues, record the failing request’s RequestId and Timestamp from the error message, these details can help with further analysis in the Azure Storage logs.
Since you prefer to use SAS, concentrating on the checks mentioned above should help identify and resolve the occasional authorization errors.
Kindly let us know if the above helps or you need further assistance on this issue.
Please do not forget to "Accept the answer” and “up-vote it” wherever the information provided helps you, this can be beneficial to other community members__.__ It would be greatly appreciated and helpful to others.