Welcome!
The issue arises because the customer is facing intermittent failures when uploading images to a Blob in Azure. Although the application monitoring tool shows 81 Authentication Errors, only 2 errors are found when querying the logs in the log analytic workspace. This discrepancy occurs because the analytical logging might take some time to reflect the logs when queried.
To resolve this, it is recommended to enable storage analytical logging, which provides more detailed logging information and helps troubleshoot intermittent issues effectively. Additionally, ensure that you are querying the logs at the correct timestamps when the errors occurred and using the appropriate query as mentioned in the sample queries provided by Azure documentation.
Here are the steps to enable storage analytical logging:
- Navigate to the Azure portal and select your storage account.
- Under the "Monitoring" section, click on "Diagnostic settings (classic)".
- Add a diagnostic setting and select the "StorageRead", "StorageWrite", and "StorageDelete" operations.
- Configure the destination to send the logs either to a Log Analytics workspace, Event Hub, or storage account.
- Save the configuration.
Refer to the following documentation for more details on forming the StringToSign and troubleshooting authentication issues:
Resources:
- Authentication for the Azure Storage Services
- Authorize with Shared Key (REST API) - Azure Storage
- Example to generate StringToSign using PHP
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
Please do not forget to "up-vote" wherever the information provided helps you, as this can be beneficial to other community members.