限制目标用户访问Azure存储中托管的静态网站 [英] Restrict access to static website hosted on azure storage to intended users

查看:106
本文介绍了限制目标用户访问Azure存储中托管的静态网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用静态网站功能在Azure存储中托管了一个简单的网站.该网站的网址现已公开. (拥有该网址的任何人都可以访问该网站).但是我的意图是仅向我想要的用户提供访问权限.有没有一种方法可以限制公众访问Azure存储中托管的静态网站?

I hosted a simple website in Azure storage using the static website feature. The url of the website is now publicly available. (anyone with the url can access the website). But my intention is to provide access only to the users who I want to. Is there a way that can restrict the public access to the static website hosted in Azure storage?

推荐答案

静态网站托管使文件可用于匿名访问.如果需要控制哪些人可以访问文件,则可以将文件存储在Azure blob存储中,然后生成

Static website hosting makes the files available for anonymous access. If you need to control who can access the files, you can store files in Azure blob storage and then generate Using shared access signatures (SAS) to limit access.

交付给客户端的页面中的链接必须指定资源的完整URL.如果资源由代客密钥(例如共享访问签名)保护,则该签名必须包含在URL中. https://docs.microsoft.com/zh-我们/azure/architecture/patterns/static-content-hosting

The links in the pages delivered to the client must specify the full URL of the resource. If the resource is protected with a valet key, such as a shared access signature, this signature must be included in the URL. https://docs.microsoft.com/en-us/azure/architecture/patterns/static-content-hosting

您可以尝试将CDN端点配置为通过SAS令牌访问私有Blob容器(请勿使用静态网站功能,因为该端点是完全公共的). Azure CDN本机支持此方案–在最坏的情况下,您可以编写重写规则以使用SAS令牌将请求重定向到Blob终结点.

You can try configure a CDN endpoint to hit a private Blob container (do not use Static Website feature because the endpoint is completely public) through SAS tokens. Azure CDN supports this scenario natively – in worst case you can write rewrite rules to redirect requests to the Blob endpoint with SAS tokens.

通过SAS使用Azure CDN

这篇关于限制目标用户访问Azure存储中托管的静态网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆