[英]How to create an ASP Core web app deployment in Visual Studio 2022?
I'm attempting to create an Azure Pipeline that deploys an ASP Core web app to an Azure App Service.我正在尝试创建一个 Azure 管道,将 ASP Core web 应用程序部署到 Azure 应用程序服务。
I've created the Azure pipeline to build the web app.我创建了 Azure 管道来构建 web 应用程序。
The pipeline deployment expects to find a.zip deployment package in the build, so I'm expecting to configure a Publish step to create this.管道部署希望在构建中找到 a.zip 部署 package,因此我希望配置一个发布步骤来创建它。
In VS2022 the only publish option that creates a web deployment is the Web Server (IIS)
option which requires the details of an IIS server.在 VS2022 中,创建 web 部署的唯一发布选项是
Web Server (IIS)
选项,它需要 IIS 服务器的详细信息。
So how in VS2022 do I configure a simple web deployment publish step?那么如何在 VS2022 中配置一个简单的 web 部署发布步骤呢? I don't expect to have to set up IIS to do this.
我不希望必须设置 IIS 来执行此操作。
You should use do.net publish command to do this.您应该使用do.net publish命令来执行此操作。 For local development use do.net publish CLI, for Azure Pipeline you should use DotNetCoreCLI task with 'publish' command option.
对于本地开发,请使用do.net publish CLI,对于 Azure 管道,您应该使用带有“publish”命令选项的DotNetCoreCLI任务。 Example here: https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/webapp?view=azure-devops
此处示例: https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/webapp?view=azure-devops
So if I am not mistaken you question is specific to how in VS2022 you publish.因此,如果我没记错的话,您的问题是针对如何在 VS2022 中发布的。 As long as you have the Azure SDK installed this option should come up when you try to publish a ASP core web app.
只要您安装了 Azure SDK,当您尝试发布 ASP 核心 web 应用程序时,就会出现此选项。
You can choose Azure and point it to your app service or if you want VS to publish the artifacts you can choose the 'folder' option and publish to your local file system and if you zip up that folder where it was published you have your.zip deployment package.您可以选择 Azure 并将其指向您的应用程序服务,或者如果您希望 VS 发布工件,您可以选择“文件夹”选项并发布到您的本地文件系统,如果您 zip 在发布它的那个文件夹上,您就有了您的。 zip 部署 package。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.