Hi SabrineBen ,
Welcome to Microsoft Q&A, thanks for posting your query.
It sounds like you're encountering an issue with the HTTP headers required for Azure Blob Storage when saving artifacts from your ML flow server. The error
requests.exceptions.HTTPError: 400 Client Error: An HTTP header that's mandatory for this request is not specified
typically indicates an issue related to the request headers that Azure Blob Storage expects when interacting with it.
Ensure the SAS token has the required permissions ( rwlac for reading, writing, listing, adding, and creating objects). The token should also not be expired, and it should be properly appended to the Blob Storage URL.
A SAS token is used to provide limited access to Azure Blob Storage without sharing the storage account’s access keys. The error may occur if the SAS token is not properly configured, is expired, or lacks the necessary permissions.
You mentioned using environment variables for the connection string and access key. The 400 error may indicate an issue with these variables not being set correctly or not properly configured in the ML flow setup.
Double check the environment variables and their format to make sure they match azure requirements for connection string.
Ensure the proper headers are being included in your request. If you're using a library like the ML flow, these headers should be managed automatically.
Check the networking and access policies for your Blob Storage container to ensure that access is properly configured. You can also use Azure Blob Storage access tiers to control permissions.
When saving artifacts in Azure Blob Storage, ensure that ML flow is configured correctly to point to the Blob Storage. In your ML flow setup, you should set the artifact_location
to the correct Blob Storage URL. If you're using the SAS token directly, make sure it's properly referenced in your ML flow configuration.
- here are the reference documentation. https://video2.skills-academy.com/en-us/azure/machine-learning/how-to-use-mlflow#mlflow-tracking-with-azure-blob-storage https://video2.skills-academy.com/en-us/azure/storage/common/storage-sas-overview https://video2.skills-academy.com/en-us/azure/storage/common/storage-configure-connection-string
Please let us know if you have any further queries. I’m happy to assist you further.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.