我正在尝试使用Git Actions 工作流程将静态 Web 应用部署到 Azure。。我的 Web 应用程序正在使用 ASP.NET Core。
为了提供最小工作示例 (MWE),我创建了一个测试公共(public) Github Repo here .
不知何故,问题出在路径上。无论我为 output_location
设置什么路径,我总是收到一个错误:应用程序构建无法生成工件文件夹
如何在我的 workflow YML file 中正确设置路径?
我的 Azure 配置:
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/