Azure静态WebApp部署错误:应用程序构建未能产生伪影文件夹

发布于 2025-01-25 19:10:29 字数 1648 浏览 4 评论 0 原文

我正在尝试使用 git Action workflow 静态Web应用程序部署到Azure。我的Web应用程序正在使用ASP.NET Core。

为了提供最低工作示例(MWE),我创建了一个测试public github repo

问题在某种程度上是在路径中。无论如何,我为 output_location 设置了哪个路径,我总是会遇到一个错误,即应用程序构建未能产生artifact文件夹

如何正确设置我的

我的azure配置:

”在此处输入图像说明”

ps:我已经检查了有关MS Doc Page的描述,for

      ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
      # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
      app_location: "/TestASPStaticWebsite/TestASPStaticWebsite/" # App source code path
      api_location: "/TestASPStaticWebsite/TestASPStaticWebsite/" # Api source code path - optional
      output_location: "build" # Built app content directory - optional
      ###### End of Repository/Build Configurations ######

I am trying to deploy an Static Web app to Azure using Git Actions workflow. My web application is using ASP.NET Core.

To provide a minimum working example (MWE), I have created a test public Github Repo here.

Somehow the problem is in the paths. No matter, what path I set for the output_location, I always get an error that The app build failed to produce artifact folder

How do I set the paths correctly in my workflow YML file?

My Azure Configuration:

enter image description here

PS: I already checked the description about the path variables at MS Doc page for Build configuration for Azure Static Web Apps

      ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
      # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
      app_location: "/TestASPStaticWebsite/TestASPStaticWebsite/" # App source code path
      api_location: "/TestASPStaticWebsite/TestASPStaticWebsite/" # Api source code path - optional
      output_location: "build" # Built app content directory - optional
      ###### End of Repository/Build Configurations ######

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

西瓜 2025-02-01 19:10:29

测试后,我可以得出的结论是,Azure静态Web应用不支持ASP.NET核心项目。

仔细阅读后,我们可以发现Azure静态Web应用程序仅支持可以生成构建,区域和其他文件夹的前端框架项目。

因为我没有找到一个文档,说ASP.NET核心项目得到了支持,所以我认为不支持它。如果支持它,为什么 azure web应用程序存在。

希望我的测试结果能帮助您,您可以使用Azure WebApp创建应用程序。无需继续花费时间在Azure静态WebApp上,如果您有纯的前端应用程序,则可以将来继续使用Azure static WebApp。

After my testing, what I can conclude is that azure static web app does not support asp.net core project.

Azure static web app support Framework

After careful reading, we can find that azure static web app only supports front-end framework projects that can generate build, dist and other folders.

Because I didn't find a document saying that the asp.net core project is supported, I think it is not supported. If it is supported, why does the azure web app exist.

I hope my test result will help you, you can use azure webapp to create applications. No need to continue to spend time on azure static webapp, if you have pure front-end applications, you can continue to use azure static webapp in the future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文