简体   繁体   English

如何将具有多个组件的应用程序部署到Azure?

[英]How do I deploy an app with multiple components to Azure?

So my application is composed of a handful of separate .NET components that all run in Azure. 因此,我的应用程序由几个单独的.NET组件组成,所有这些组件都在Azure中运行。 To give you an idea of what's involved: 让您了解其中涉及的内容:

  • A main ASP.NET MVC5/Web API 2 REST service that runs as an Azure website (I think they renamed these to web apps?). 作为Azure网站运行的主要ASP.NET MVC5 / Web API 2 REST服务(我认为他们将其重命名为Web应用程序?)。
  • A SQL database that the main REST service uses. 主要REST服务使用的SQL数据库。
  • Another internal Web API REST service that the main REST service talks to that runs as an Azure website. 主REST服务与之通信的另一个内部Web API REST服务作为Azure网站运行。
  • An Azure storage table that the the internal Web API REST service uses. 内部Web API REST服务使用的Azure存储表。
  • 3 scheduled jobs (just .NET exe's) that do work in the background and also talk to the main SQL database. 3个计划的作业(仅是.NET exe),它们在后台运行并且还与主SQL数据库通信。

All that's running great in Azure right now. 现在,所有这些在Azure中运行得都很好。 My problem is automating the deployment and configuration. 我的问题是自动化部署和配置。

Right now it's all manual. 现在,一切都是手动的。 I right-click and publish both web apps from Visual Studio. 我右键单击并从Visual Studio发布两个Web应用程序。 I build and FTP up the web jobs. 我建立并通过FTP上传网络作业。 The database and Azure storage already exist so I don't have to re-set them up. 数据库和Azure存储已经存在,因此我不必重新设置它们。

But say something bad happens - a datacenter goes down or something. 但是,请说发生了一些不好的事情-数据中心发生故障或其他情况。 I'd like to be able spin up a new version of my app (with all those components) that is ready to go with minimal effort. 我希望能够以最小的努力启动我的应用程序的新版本(包含所有这些组件)。

I'm pretty new to the world of Azure so I'm not sure where to start. 我对Azure领域很陌生,所以我不确定从哪里开始。 What are my options? 我有什么选择?

You are looking to automating deployments in Azure. 您正在寻求自动化Azure中的部署。 I recommend to use ElasticBox to solve it. 我建议使用ElasticBox解决它。

To achieve the automation you will need to create a box for every different service or component you need to deploy (a box is the abstraction unit that uses to define the installation and configuration of the deployment of a service or application in any cloud). 为了实现自动化,您需要为需要部署的每个不同服务或组件创建一个框(框是用于定义任何云中服务或应用程序部署的安装和配置的抽象单元)。

It's possible also to create boxes based on VM Instances, VM Roles, or Worker Roles and also automate the deploy of Microsoft SQL Servers. 还可以根据VM实例,VM角色或辅助角色创建框,并自动执行Microsoft SQL Server的部署。 Let's say near every option offered by Azure. 比方说Azure提供的每个选项。

Then with those boxes completed (that can be customized and reuse your legacy code from your previous manual installation), you can deploy the multiple vms with near no manual intervention, just one click or a command with some parameters. 然后,完成这些框(可以对其进行自定义,并重复使用以前的手动安装中的旧代码),您可以在几乎没有手动干预的情况下部署多个虚拟机,只需单击一下或使用带有某些参数的命令即可。

A box includes the variables necessary for your deployment (you can set default values for those variables) and your legacy scripts (In this case probably PowerShell, but they could be bash, python, perl, java, or any other language) 一个框包含部署所需的变量(您可以为这些变量设置默认值)和旧脚本(在这种情况下可能是PowerShell,但它们可以是bash,python,perl,java或任何其他语言)

When you deploy your boxes: 部署盒子时:

  • Creates a Cloud Service or VM in the location that you choose and with the Azure configuration that you preconfigured. 在您选择的位置并使用预先配置的Azure配置创建Cloud Service或VM。 It takes care of provision the vm in your Azure provider, or near any other cloud provider in the market. 它负责在您的Azure提供程序中或在市场上其他任何云提供程序附近配置虚拟机。

  • Installs, configure files with your specified variables and execute your SQL or Web services that you have defined. 安装,使用指定的变量配置文件并执行您定义的SQL或Web服务。

Other ways to interact with the service: 与服务交互的其他方式:

  • Jenkins' Plugin could be used to build a CI environment connecting your code updated or a Pull Request with automated deployments in Azure or any other public cloud. Jenkins的插件可用于构建CI环境,以将更新的代码或请求请求与Azure或任何其他公共云中的自动部署连接起来。

  • Command line tool that enables to do VM deployments of your boxes and also you can manage your deployed vm instances with it. 使用命令行工具可以对机器进行VM部署,还可以使用它来管理已部署的vm实例。

Azure Resource Manager (ARM) is intended to solve exactly the issues you described. Azure资源管理器 (ARM)旨在解决您所描述的问题。

The basic idea is that you use a JSON template to describe all your services. 基本思想是使用JSON模板描述所有服务。 You can then give that template to ARM and it will create the services as defined in the template. 然后可以将该模板提供给ARM,它将按模板中的定义创建服务。 If you want to make a change, instead of doing it imperatively (via powershell or manually in the portal) just update your template, pass it to ARM and it will make whatever changes are necessary to make the services match your template. 如果要进行更改,而不必强制性地进行更改(通过Powershell或在门户中手动进行),只需将模板更新,然后将其传递给ARM,它将进行必要的更改以使服务与您的模板匹配。

Some resources: 一些资源:

I think your looking for something to help you handel deploys to your windows Azure servers. 我认为您正在寻找可以帮助您将其部署到Windows Azure服务器的东西。 If that is the case I recommend looking into Jenkins CI . 如果是这种情况,我建议您查看Jenkins CI There are many resources available online you can look into in terms of having Jenkins and Azure work together. 关于让Jenkins和Azure一起工作,您可以在线研究许多可用资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在VPC上部署Azure应用服务 - How can I deploy an Azure App Service on VPC 如何使用身份模型将应用程序部署到Azure上的生产环境? - How can I deploy an app using Identity Model to Production on Azure? 如何使用Azure SDK将Web应用程序部署到Azure - how to deploy web app to azure with azure sdk 当我在 azure devops 在 iis 中部署此项目时,如何显示 app_offline 页面? - how to display the app_offline page when i deploy this projects in azure devops in iis? 如何将C#套接字服务器应用程序部署到Azure VM? 这真的是个好主意吗? - How can I deploy my C# Socket Server app into an Azure VM ? Is it really a good idea? 如何从应用程序以管理员身份访问Azure移动服务? - How do I access an Azure Mobile Service as an admin from an app? 如何使用 Azure Function 设置应用设置值? - How do I set app setting value using Azure Function? 如何将Azure功能应用程序连接到MYOB? - How do I Connect an Azure Function App to MYOB? 如何在Azure App Service中插入具有1:n关系的实体 - How do I insert entities with a 1:n relationship in Azure App Service 如何在Azure移动应用服务客户端中实现AOP? - How do I implement AOP in an Azure Mobile App Services client?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM