Azure存储静态网站错误-找不到资源或内容不存在 [英] Azure Storage Static website error - Resource not found or content doesn't exist

查看:151
本文介绍了Azure存储静态网站错误-找不到资源或内容不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要查看静态网站在Azure存储中的工作方式,我创建了一个基本的angular应用程序,并将dist文件夹中的文件上传到了静态网站.但是,当我尝试访问URL时,我收到一条404错误消息,内容为: "请求的内容不存在".

To see how static websites work in Azure storage, I created a basic angular app and uploaded the files in dist folder to the static website. But when I try to access the URL, I get a 404 error message that says "The requested content doesn't exist".

此外,我可以看到文件位于$web路径下,但是当我单击文件URL <azurestorageurl>/$web/index.html时,浏览器会抛出错误消息"未找到资源".

Also, I can see that files are present under $web path, but when I click on the file URL <azurestorageurl>/$web/index.html the browser throws an error message "Resource not found".

.

推荐答案

出现此错误的原因是,默认情况下,$web blob容器的ACL是Private.

The reason you're getting this error is because the ACL of the $web blob container is Private by default.

请将ACL更改为Blob(推荐)或Container,您应该不会看到此错误.

Please change the ACL to either Blob (recommended) or Container and you should not see this error.

更新

因此,我联系了Azure存储团队,并提请他们注意此问题.他们很友好地向我解释了这种行为.

So I reached out to Azure Storage team and brought this question to their attention. They were kind enough to explain the behavior to me.

基本上,如果您通过静态网站终结点(例如account.z5.web.core.windows.net)访问静态网站的内容,则无需更改Blob容器的ACL.即使$web的ACL为Private,也应该可以访问内容.当您通过Blob存储端点(例如account.blob.core.windows.net)访问内容时,Blob容器的ACL就会出现.

Essentially if you access the static website's contents through the static website endpoint (e.g. account.z5.web.core.windows.net), there's no need to change the blob container's ACL. Contents should be accessible even if the ACL of $web is Private. Blob container's ACL comes into picture when you access the content through blob storage endpoint (e.g. account.blob.core.windows.net).

这篇关于Azure存储静态网站错误-找不到资源或内容不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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