azure - 无法访问带有 scm 关键字的发布 URL,这导致 VS 部署失败

标签 azure azure-devops azure-functions azure-web-app-service azure-appservice

我正在尝试发布 VS 2019 中的代码。它发布在 url 上: https:xxx.scm.xxx 。我检查了发布配置文件,它的 url 中有 scm,这是正确的(如其他堆栈溢出帖子中所述)

1>Publishing C:\CLOUD\ADX\ADX-Integration\src\Adx.Integration\obj\Debug\netcoreapp3.1\PubTmp\Adx.Integration - 202207061539128.zip to https://XXXX.scm.azurewebsites.net/api/zipdeploy...1>The attempt to publish the ZIP file through https://XXXX.scm.azurewebsites.net/api/zipdeploy failed with HTTP status code Forbidden.

即使我无法在浏览器中访问它。它的状态为错误 403:禁止。图片如附件所示: enter image description here

但是当我尝试在没有 scm 的情况下访问相同的网址时,它显示如下。

enter image description here

我检查了多个堆栈溢出帖子,但没有一个解决了目的。我通过声明 0.0.0.0/0 允许访问限制中的所有 IP,但仍然发布到门户和浏览器,使用 scm 对地址 url 进行访问失败。请告诉我如何解决这个问题?

最佳答案

我重现该问题并修复的解决方法之一是:

  • 在所有托管计划(例如消费计划、应用服务计划、高级计划)中创建了 Azure .NET Core 6 Function App,并向所有托管计划发布了该函数应用。
  • 检查了函数应用网站以及 Kudu/SCM 网站 - 两者均运行良好。

消费计划功能应用结果:

enter image description here

应用服务计划功能应用:

enter image description here

高级计划功能应用程序:也适用于高级计划功能应用程序。

但我观察到的一件事是在访问限制页面中,无论函数应用部署的托管计划如何:

  1. 为了尝试,我在 SCM 站点中添加了将我的系统 IP 地址拒绝的规则并进行了检查:

enter image description here

结果: enter image description here

因此,请检查门户中 Azure Function App 的访问限制页面,其中您的 IP 地址被 SCM 站点拒绝。要解决此问题,请在 Azure Function App 的访问限制页面下添加您的 IP 地址,以允许在 Function App 站点和 SCM 站点中使用。

关于azure - 无法访问带有 scm 关键字的发布 URL,这导致 VS 部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72881866/

相关文章:

java - 将动态值作为请求正文发布

c# - 如何裁剪字节数组图像

node.js - 如何在timerTrigger Azure Functions中设置环境变量或输入?

azure - 记录 Azure 上的数据库使用情况

azure - 使用 Azure 逻辑应用 HTTP 连接器返回的 JSON

asp.net-mvc - 当 Copy-Local 设置为 True 时,为什么 Azure 部署中缺少 DLL?

azure - 从 Azure DevOps 项目的菜单中隐藏存储库

vue.js - 使用 azure devops 发布管道部署 Vue.js 应用程序

node.js - 在 Express 包装的 Azure NextJs 应用程序上部署后,应用程序将永久加载

.net - Azure DevOps : Search Commit History of Author on ALL Branches