部署到天蓝色然后获得403-禁止访问 [英] Deploy to azure then get 403 - Access Forbidden

查看:46
本文介绍了部署到天蓝色然后获得403-禁止访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试部署到Azure(Silverlight应用程序);我已经迁移了数据库,更新了连接字符串,并将应用程序发布到了Azure,但是当我单击服务URL时,会得到以下提示:

I'm trying to deploy to Azure (Silverlight application); I've migrated my DB, updated connection strings and published my application to Azure but when I click the service URL I get this:

403-禁止访问:拒绝访问.您无权使用您提供的凭据查看此目录或页面.

403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.

知道我需要更改什么吗?

Any idea what I need to change?

非常感谢

推荐答案

如果捆绑包的名称与文件系统中的路径匹配,则Azure上的IIS将抛出403 Forbidden错误.

If the name of your bundle matches the path in the file system then IIS on Azure will throw the 403 Forbidden error.

因此,如果您的解决方案中有一个名为/Content/css 的路径,并且您有一个名为 bundles.Add(new StyleBundle(〜/Content/css")的捆绑包名称).在 BundleConfig.cs 中包含(... ,它在您的中显示为 @ Styles.Render(〜/Content/css")_Layout.cshtml 文件.然后出现该错误.

So if you have a path in your solution called /Content/css and you have a bundle name called bundles.Add(new StyleBundle("~/Content/css").Include( ... in BundleConfig.cs which is displayed like this @Styles.Render("~/Content/css") in your _Layout.cshtml file. Then you get that error.

我通过将捆绑包的名称从/Content/css 更改为/Style/css

I solved this by changing the name of my bundle from /Content/css to /Style/css

  1. bundles.Add(新的StyleBundle(〜/Content/css").Include(... BundleConfig.cs 中成为 bundles.Add(新的StyleBundle(〜/Style/css").Include(...
  2. @ Styles.Render(〜/Content/css")在您的 _Layout.cshtml 中成为 @ Styles.Render(〜/Style/css)在您的 _Layout.cshtml
  1. bundles.Add(new StyleBundle("~/Content/css").Include( ... in BundleConfig.cs becomes bundles.Add(new StyleBundle("~/Style/css").Include( ...
  2. @Styles.Render("~/Content/css") in your _Layout.cshtml becomes @Styles.Render("~/Style/css") in your _Layout.cshtml

您可以使用任何喜欢的名称,没有特定限制.我想您可以继续在解决方案中重命名文件夹,并且应该可以.

You can use any names you like there is no specific limitations. I imagine you can go ahead and rename the folders in your solution too and that should work.

NB:捆绑软件的名称变成了浏览器可以向其请求的虚拟目录.如果它类似于物理文件夹结构,则会抛出 403 .

NB: The name of the bundle turns into a virtual directory that the browser can request from. If it resembles a physical folder structure then it will throw back the 403.

这篇关于部署到天蓝色然后获得403-禁止访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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