在 .NET Core 版本重写后将一个 Azure App Service 的代码库切换为不同的代码库 [英] Switching one Azure App Service's codebase for different one after .NET Core version rewrite

查看:17
本文介绍了在 .NET Core 版本重写后将一个 Azure App Service 的代码库切换为不同的代码库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 Azure 上有一个 .NET Core 2.1 Web 应用作为应用服务.我们通过 Visual Studio 2017 的发布选项将其部署到 Azure(尽管它也在 Git 存储库中).它在 Azure 提供的所有域上都有一堆自定义域和 SSL.

We have a .NET Core 2.1 Web App on Azure as an App Service. We deploy it to Azure via Visual Studio 2017's publish option (though it is also in a Git repo). It has a bunch of custom domains and SSL on all of them provided by Azure.

我们在 VS 2019 中使用 .NET Core 3.1 编写了新版本的 Web 应用.功能相同,但从头开始编写,而不是尝试升级现有的 2.1 版本.

We've written a new version of the web app in .NET Core 3.1, in VS 2019. Identical functionality but written from the ground up rather than trying to upgrade the existing 2.1 version.

没有在线暂存版本 - 相反,我们在本地机器上开发,然后只使用在线测试域,这些域使用相同的服务,但环境切换为使用开发数据库和存储桶位置等,这是原因之一编写一个新的应用程序而不是升级它,而且,它看起来更干净,我看到人们在升级时遇到了一些问题......

There's no staging version online as such - instead we develop on local machines and then just use test domains online that use the same service but where the environment is switched to use dev DBs and bucket locations etc, which is one of the reasons to write a new app rather than upgrade it, also, it just seemed cleaner and I saw that people had some issues when doing upgrades...

是否有一种简单的方法可以将新的 Web 应用程序/代码切换/发布到当前的 Azure 应用程序服务中,以替换旧的应用程序服务?或者我是否需要创建一个新的应用服务,然后在将它们从旧域中删除后在其中创建所有自定义域、SSL 等?

Is there an easy way to switch/publish the new web app/code into the current Azure App Service, to replace the old one? Or will I need to create a new App Service and then create all the custom domains, SSL etc there after removing them from the old one?

或者我可以切换到 git 部署并将整个新项目推到旧项目上 - 这会奏效还是只会造成某种灾难?

Or could I perhaps switch to git deployment and push the entire new project in over the old one - would that work or just create some kind of disaster?

推荐答案

将新的应用程序版本推送到您的应用服务时通常没有问题,即使它使用新版本的 .NET Core.你必须考虑两件事:

There is usually no issue when pushing a new application version to your app service, even if it uses a new version of .NET Core. You have to consider two things:

  • Windows AppService 计划:.NET Core 3.1 运行时已在全球范围内推出,而 SDK 尚未(尚未).如有疑问,请使用独立部署.
  • Linux AppService Plan:您需要在门户中选择所需的运行时版本.使用例如Azure 管道 您可以在发布新版本的同时设置运行时版本.不确定 VisualStudio 如何处理这个问题.
  • Windows AppService Plan: .NET Core 3.1 runtime has been rolled out worldwide, while the SDK has not (yet). When in doubt, use self-contained deployment.
  • Linux AppService Plan: You need to select the desired runtime version in the portal. Using e.g. Azure Pipelines you can set the runtime version at the same time as you publish the new version. Not sure how VisualStudio handles this.

作为一般建议,您应该遵循使用 插槽部署 对您的客户的影响尽可能小.每个插槽可以有例如不同的 .NET 运行时版本,因此您可以测试暂存槽上的所有内容.

As a general recommendation, you should follow silents suggestion of using slot deployments to have as little impact for your customers as possible. Each slot can have e.g. a different .NET runtime version, so you can test everything on the staging slots.

这篇关于在 .NET Core 版本重写后将一个 Azure App Service 的代码库切换为不同的代码库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆