I have a static web site including a HTML page, a few style and script files and images. They are stored in an Azure Storage Container. There is a Shared Access Signature (SAS) set up on the entire Container.
BLOB_TOKEN = '?sp=rl&st=2024-12-05T13:00:00Z&se=2025-12-06T13:00:00Z&sv=2022-11-02&sr=c&sig=SOME_SPECIAL_CHARACTERS'
In the HTML page, I had to explicitly appended the BLOB_TOKEN to every single URL for individual script, style files, images and all the other links (a href) to be able to properly load the resources.
For example,
<script>
const TK = '?sp=rl&st=2024-12-05T13:00:00Z&se=2025-12-06T13:00:00Z&sv=2022-11-02&sr=c&sig=SOME_SPECIAL_CHARACTERS'
document.write("<link rel='stylesheet' href='css/my_style_1.css"+ TK + "' />");
document.write("<script type='text/javascript' src='scripts/my_script_1.js"+ TK + "'></script>");
</script>
<img src="img/UserUploadedImages/logo.png?sp=rl&st=2024-12-05T13:00:00Z&se=2025-12-06T13:00:00Z&sv=2022-11-02&sr=c&sig=SOME_SPECIAL_CHARACTERS" width="60px" height="60px"/>
I would like to know if there is a better way to use SAS for all resources. Is it possible to configure the Azure Container to allow the html page to use any other resources in the same Container without having to attaching the SAS string to the URL of the resource?