问题描述
如何将带有.NET Core 2.0 Web API应用程序的Angular 6部署到Microsoft Azure?
How to deploy Angular 6 with .NET Core 2.0 Web API Application to Microsoft Azure?
我创建了ASP.NET Core 2.0 Web API(服务器端应用程序)应用程序,并在其中创建了Angular 6.0应用程序(客户端应用程序).这两个应用程序均在本地环境(数据库-MongoDB:mLab服务器)中构建并成功运行.
I have created ASP.NET Core 2.0 Web API (Server-Side app) application and inside that created Angular 6.0 app (Client-Side app). Both apps are build and running successfully in a local environment (Database - MongoDB: mLab server).
现在,我想在单个Web应用程序服务(将提供客户端应用程序和服务器应用程序(Web API)在其中)中将具有.net核心Web API应用程序的角度应用程序部署到Azure环境.
Now, I want to deploy an angular app with .net core web API app to Azure environment in a single web app service (where client app and server app (web API) will serve).
但是,我将有角度的应用程序(客户端)部署到了Azure环境,但没有使用.net.
However, I deployed an angular app (client-side) to the Azure environment but not with .net.
推荐答案
我知道您询问如何在单个API应用程序中同时部署客户端和服务器,但是您应该创建两个 Azure Web应用程序:
I know you ask about how to deploy both the client and the server in a single API app but you should create two Azure Web Apps:
- 托管基于.NET核心的Web API的Azure API应用
- 一个Azure Web应用,该服务为Angular应用提供服务(很可能仅包含静态文件),并可能消耗您的API应用.
- An Azure API App that hosts your .NET core based Web API
- A Azure Web App that serves your Angular application (most likely only contains static files) and probably consumes your API app.
这将允许您部署e. G.该API中的修复程序,而无需重新部署您的UI.这也不会增加额外的成本,因为您可以将两个应用程序托管在一个应用程序服务计划中,并且可以简化CI/CD流程.
This will allow you to deploy e. g. a fix in the API without the need to redeploy your UI. This also won't add additional costs since you can host both apps in a single App Service plan and will simplify your CI / CD process.
这篇关于如何将带有.NET Core 2.0 Web API应用程序的Angular 6部署到Microsoft Azure?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!