Azure 静态 Web 应用程序部署错误 : The app build failed to produce artifact folder

标签 azure asp.net-core github azure-static-web-app azure-static-website-hosting

我正在尝试使用Git Actions 工作流程静态 Web 应用部署到 Azure。。我的 Web 应用程序正在使用 ASP.NET Core。

为了提供最小工作示例 (MWE),我创建了一个测试公共(public) Github Repo here .

不知何故,问题出在路径上。无论我为 output_location 设置什么路径,我总是收到一个错误:应用程序构建无法生成工件文件夹

如何在我的 workflow YML file 中正确设置路径?

我的 Azure 配置:

enter image description here

PS:我已经在MS Doc页面上检查了 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 ######

最佳答案

经过我的测试,我可以得出的结论是,azure static web app不支持asp.net core项目。

Azure static web app support Framework

仔细阅读可以发现,azure static web app只支持可以生成build、dist等文件夹的前端框架项目。

因为没有找到文档说支持asp.net core项目,所以我认为是不支持的。如果支持的话,为什么azure web app存在。

希望我的测试结果对您有帮助,您可以使用azure webapp来创建应用程序。无需继续花时间在azure static webapp上,如果你有纯前端应用,以后可以继续使用azure static webapp。

关于Azure 静态 Web 应用程序部署错误 : The app build failed to produce artifact folder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72099377/

相关文章:

c# - 将接口(interface)传递给 Startup.cs ConfigureServices 中的另一个服务

c# - 使用 PhysicalFile 时如何正确捕获 FileNotFoundException

mongodb - 使用 Polly 处理 CosmosDb Mongo 429 错误的正确方法

git - 我可以使用与基础和比较分支相同的分支来创建 pull 请求吗?

github - BeautifulSoup 部分div类匹配

github - 为 Github GraphQL 搜索选择 *

azure - [U-SQL]][FlexExtractor] 我无法加入。表达式必须都是列

azure - 任务 - 在 Azure Synapse Serverless SQL 中生成脚本

python - 使用 BlobServiceClient 和 Python V12 SDK 将本地文件夹上传到 Azure Blob 存储

c# - Azure SSO OnTokenValidated 不起作用