【问题标题】:How to deploy proxy.ashx in Azure app Service如何在 Azure 应用服务中部署 proxy.ashx
【发布时间】:2022-07-29 20:38:21
【问题描述】:

我正在寻找在 Azure 应用服务中部署 proxy.ashx 并使其像在 Windows VM 上一样工作的人,但当我部署在应用服务上时它不起作用

【问题讨论】:

  • 您是否在 web.config 中包含了 <httpHandlers> ?
  • 我在 web.config 中添加了 httphandler,但它给出了 500.13 通用错误,你有一个示例项目,你已经在应用服务上部署了 httphandler 代理吗?
  • 不是真的......我什至不知道这是否可能。我建议您将您的应用程序容器化并尝试从中运行

标签: azure azure-web-app-service ashx azure-appservice


【解决方案1】:

如何在 Azure 应用服务中部署 proxy.ashx

  • 正如 Thiago Custodio 在评论中提到的,我们需要在 web.config 文件中包含 httphandlers,以便 httphandlers 在 Azure Web App 中工作。
  • 根据这个SO Thread,Azure使用集成模式,所以我们需要注册HTTP Handlers集成模式
<system.webServer>
    <handlers>
      <!-- Register the HttpHandler used for My Handler requests (IIS 7.0+ running in Integrated Mode)  -->
      <add name="SampleHandler" preCondition="integratedMode" 
        verb="GET" path="SampleHandler.ashx"
        type="YourWebApp.Web.SampleHandler"/>
    </handlers>  
   </system.webServer> 
  • httphandlers添加到Azure Web App Service的bin文件夹,这可以通过在Azure Portal-KUDU Console-https://DeployedAppName.scm.azurewebsites.net中添加扩展来完成

500.13 一般错误

请按照此处提供的步骤处理Troubleshooting 500 系列错误

参考资料取自

ASP.NET HTTP Handlers on Azure

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-30
    • 1970-01-01
    • 2021-07-13
    • 2021-11-07
    • 1970-01-01
    • 1970-01-01
    • 2019-08-14
    相关资源
    最近更新 更多