Hi Roeder, Marcus,
Thank you for reaching out on Microsoft Q&A forum
We understand your problem & will try to help you as possible.
400 Bad Request Error: Azure Blob Storage is likely enforcing strict header validation, and non-ASCII characters can lead to requests being rejected. This is generally tied to how HTTP headers must comply with certain specifications.
Metadata Key and Value Names
Metadata for a container or blob resource is stored as name-value pairs associated with the resource. Metadata key names must adhere to the following naming rules:
Must start with a letter or underscore
Any following characters may be letters, numbers, or underscores
Metadata key name must be valid ASCII
Metadata value names must also be valid ASCII. Note that metadata names preserve the case with which they were created, but are case-insensitive when set or read. If two or more metadata headers with the same name are submitted for a resource, the Blob service returns status code 400 (Bad Request).
Blob and container names are passed to the Blob service within a URL. Certain characters must be percent-encoded to appear in a URL, using UTF-8 (preferred) or MBCS(Multi-Byte Character Set). This encoding occurs automatically when you use the Azure Storage client libraries. However, there are certain characters that are not valid in URL paths even when encoded. If these characters appear in blob or container names, the request may fail.
Unicode characters not recommended for use in container or blob names.
For detailed understanding of Naming and Referencing Containers, Blobs, and Metadata, please find the reference link: https://free.blessedness.top/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#unicode-characters-not-recommended-for-use-in-container-or-blob-names
So we can try with some workarounds:
1.You can look into Cloudflare's settings to see if there's an option to modify or sanitize these headers before they're sent to Azure Blob Storage. Perhaps instead of sending the original city names, you can map them to a set of ASCII-only names.
- Go to Rules > Transform Rules > HTTP Request Headers
- Create a rule:
- If hostname matches
*.blob.core.windows.netor your custom domain - Remove header:
cf-ipcity
- If hostname matches
2.If you need the geo headers elsewhere, introduce an intermediate proxy between Cloudflare and Azure to remove or sanitize the problematic headers before passing to Azure.
3.Raise a Support Ticket with Microsoft Azure Since this behaviour is strict and affects legitimate traffic, raising a formal support request may help to escalate the issue.
If you find this comment helpful, please “up-vote” for the information provided , this can be beneficial to community members.
Kindly let us know if you have any additional questions.
Thanks