【问题标题】:CORS for Azure Function in a Azure Static Web AppAzure 静态 Web 应用中 Azure 函数的 CORS
【发布时间】:2021-08-24 06:33:27
【问题描述】:

Azure Functions 允许在函数应用中使用 configuring CORS policies。但是我们如何为Function created in a Azure Static Web app 做同样的事情。

Static Web App UI 没有配置 CORS 的功能(如下截图)。

【问题讨论】:

    标签: azure api cors azure-functions azure-static-web-app


    【解决方案1】:

    您不必单独设置 CORS,当您从 Azure 静态 Web 应用程序站点中的静态页面调用 Function 端点时,默认情况下会为您设置所有 CORS settings .

    如果您想从外部端点访问 Azure 静态 Web 应用程序中的 API,如 here 所述,不支持。

    【讨论】:

      猜你喜欢
      • 2021-05-23
      • 1970-01-01
      • 2020-11-20
      • 2020-12-16
      • 2021-03-02
      • 1970-01-01
      • 2021-04-11
      • 1970-01-01
      • 2022-01-20
      相关资源
      最近更新 更多