简体   繁体   中英

Access static content from Azure service

We have storage account on Azure with public access of container. We have already shared this public URL of this blob with our customer. Due to security reason, we have to make this container private so we can restrict anonymous access.

Now the problem is that how we can access static content (eg js) from private container?

  1. One option is SAS url but this won't work because our customer needs to access js file and SAS url has some expiry. So all time we need to renew sas url and customers have to replace it with older one which increases maintenance.
  2. AAD is also not an option.
  3. Azure cdn can work with sas token only.

Any other suggestions or input on how to access static js files from storage container with private access level. Also suggest if there is any other Azure service which can fulfil this requirement. Thanks in advance.

One option is SAS url but this won't work because our customer needs to access js file and SAS url has some expiry.

What you can do is create a SAS token with expiry as 9999-12-31T23:59:59Z . That way your SAS token would never expire.

However please note that your SAS token will become invalid if you ever regenerate the account key for your storage account.

If you're going down SAS token route, I would recommend that you use Blob Container Access Policy to create the SAS token. In case your SAS token is compromised or if you need to revoke access to the resources protected by this SAS token, you will simply need to delete the access policy (no need to regenerate the account key).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM