简体   繁体   English

如何在 Visual Studio 2022 中创建 ASP Core web 应用部署?

[英]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.

相关问题 如果不签出 web.config,则无法将 ASP.NET Core 应用从 Visual Studio 2022 发布到 Azure - Publishing ASP.NET Core app from Visual Studio 2022 to Azure does not work without checking out web.config ASP.net核心应用程序的Visual Studio Team Services中的Azure App Service部署失败 - Azure App Service Deployment failure from Visual Studio Team Services for ASP.net Core Application 如何在不使用Visual Studio Code中的git的情况下将ASP.Net Core Angular Web应用发布到Azure - How can I publish my ASP.Net Core Angular web app to Azure without using git in Visual Studio Code 在没有.NET Core和Visual Studio的情况下将ASP.NET App部署到Azure Web App - Deploy ASP.NET App to Azure Web App without .NET Core and Visual Studio 在Visual Studio中,有没有一种方法可以从Empty ASP.NET Web App配置用于Web部署的默认起始页? - Is there a way in Visual Studio to configure the default start page for web deployment starting from Empty ASP.NET Web App? ASP.NET Core Web应用程序HTTP错误502.5 Visual Studio 15.2上的进程失败 - ASP.NET Core web app HTTP Error 502.5 Process Failure on Visual Studio 15.2 使用Azure Devops部署时的Asp Core Web App,404,通过Visual Studio发布时为200 - Asp Core Web App, 404 when deploying with Azure Devops, 200 when publishing via Visual studio 带有数据库的 ASP.Net Core Web 应用程序使用 Visual Studio 2019 发布到 Azure - 实体框架迁移错误 - ASP.Net Core Web App with Database publish to Azure with Visual Studio 2019 - Error with Entity Framework Migrations 从 Visual Studio 和 App 服务进行 Web 部署有什么问题? - What is going wrong with web deployment from Visual Studio and App service? Visual Studio 2022 调试 Azure 应用服务 - Visual Studio 2022 Debug Azure App Service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM