Overview of deploying applications using Appveyor CI and PowerShell

Source: Internet
Author: User
Tags configuration settings visual studio

Opening language

You can find a lot of articles on how to set up continuous integration for a single ASP.net Web application. These articles are written about how to build a perfect environment with web deploy to deploy simple Web applications that simply modify vs.net templates. Everything goes smoothly in this perfect environment.

However, it is not easy to actually deploy the application. There are always problems in the following situations: When you need to configure settings in the registry (Registry) or custom folders, or when you need to deploy to a Web cluster.

In this article, we use PowerShell Remoting (PowerShell remoting) and Appveyor ci for a asp.net Web application and Windows The service solution is configured for continuous integration in its staging (staging) and product environment.

Solution Overview

Our example contains 4 items:

Demoapp.web-asp. NET application, front-end

DemoApp.Web.Tests-WEB Application unit tests using the Visual Studio Test framework

Demoapp.service-Windows service that hosts the WCF service, backend

DemoApp.Service.Tests-Windows Service Unit test using the NUnit framework

The code base for the sample application is hosted by BitBucket:

How exactly are we going to deploy?

The first question we encountered was how to deploy Windows service? We do not have a "publish" menu for Windows service, nor do we have a corresponding configuration transformation. Can't use Web Deploy at all. To automate the deployment of the project, we will use the PowerShell deployment framework-Approlla.

Approlla uses PowerShell remoting to perform deployment tasks on the target machine. The deployment task downloads the application package, unpack, update configuration settings, and then create or update the application Web site and pool. The application package is simply a compressed package with an application folder, uploaded to the external store via HTTP. There is nothing special about it-the module is written in PowerShell and is easily viewable and modified.

To get a glimpse of PowerShell deployment, we now build a simple Web application and deploy it to the server.

Perhaps the most challenging part of the whole process is to set up PowerShell remoting with SSL authentication. We strongly recommend using HTTPS to communicate with a remote server because all data traffic is encrypted.

When you create a new virtual machine on Windows Azure, PowerShell remote is automatically activated and configured. The firewall will allow PowerShell remote HTTPS endpoint Port 5986, and we will also add the HTTP endpoint to the sample server:

If you need to set up other services, you can refer to the specific details of the link: Guide on the How to configure PowerShell Remoting.

To quickly install IIS7.5 on the instance machine, we use the following PowerShell command:

Add-windowsfeature-name web-default-doc,web-dir-browsing,web-http-errors,web-static-content,web-http-logging, Web-stat-compression,web-filtering,web-net-ext,web-net-ext45,web-asp-net,web-asp-net45,web-isapi-ext, Web-mgmt-console

We created a simple Web application with "Hello World" and then deployed it to the sample server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.