- Local deployment into a local IIS is pretty straightforward. We won't talk about it here.
- Remote web deployments are the legacy way of pushing Web applications to the (Azure) cloud that works with IDE, CI or command line. Compiled and static application artifacts that are then sent to the remote application servers via FTP. The servers unpack the archive and deploys it.
- Remote SCM deployments are a relatively new and interesting way to support automated deployments and to support multiple branches with little work. The IDE or build system pushes source code to a monitored repository. Azure (Kudu) monitors the source code repository, runs a build and deploys the resulting artifacts to the cloud.
There are a lot of many variations in deployment models. These are some of the most common. The diagram may be getting carried away when creating visuals.
|Any build server would work in place of Visual Studio Team Services: |
Jenkins, Team City, TFS, etc.
Every Azure web site has an associated, Kudu, SCM service. The SCM can bind to a variety of repositories. Kudu has a micro build server and source code repository. It can build a variety of platforms. This makes it possible to create a CI/CD pipeline with no external components.
A single application can be deployed multiple ways. A team might support web deployments for individual developers, build server web deploy when running tests and repository (Kudu) deployments for Continuous Delivery environments This is often a philosophical decision build-once vs build-every. Note: Kudu deployments look like "rebuild every" as of 10/2016.
Repository based deployment with Kudu in Azure
Some folks may be surprised to know that Microsoft has added an integrated Source Code Management system and build server with every Azure Web App. This means you can build and deploy code in Azure from inside Azure without standing up additional services.
Kudu supports ASP.NET, nodes.js, python and basic web sites. It also has Deployment , Web Integration and Post Deployment hooks that let you customize or supplement the Continuous Integration environment. Deployments are done in a windows environment.
I tested this with the example ASP.NET core application.
- Create an Azure web site.
- Create a local GIT repository.
- Create an application.
- Commit local changes to local GIT
- Push changes to GIT tied to your web site.
- Test the web site after Kudu builds and deploys your application
This next diagram shows a couple alternative ways of integrating an external SCM with Kudu and Azure SCM services. The same model works with any build system or external repository. I used Visual Studio Team Services. You could use others like Team City or Jenkins. External lets you implement more sophisticated processes based on your existing system.
I tested this with the following flow:
- Create an Azure web site.
- Create a local GIT repository
- Create an application
- Commit local changes to GIT
- Push changes to the develop branch in VSTS.
- Run a ASP.NET core build in VSTS.
- Have the build merge the changes to a GIT branch in VSTS.
- Push the merged branch changes to GIT in Azure
- Test the web site after Kudu builds and deploys the application.
There are plenty of internet sites that show how to deploy an application in Azure based on this SCM integration.
Integration is configured in the Azure portal under App Deployment --> Deployment Options. The image on the right shows an application configured to deploy an application that is stored in a GIT repository managed by Visual Studio Team Services (VS Online)
Web Deploy via IDE and build servers
Azure still supports standard Web App (FTP?) deployments from developer workstations and from build servers. Azure doesn't care where the deployments come from.
Here we have a simple web application that is deployed to a local IIS server and to an Azure web application. The developer/deployer can use Visual Studio's "run application" for IIS and "Publish" to deploy to Azure.
Here we have a simple web application that is deployed to Azure. The build server, VSTS in this case, runs a deployment phase that pushes the application to Azure.
- ASP.NET Core
- Continuous Deployment in Azure (with Kudu)
- Project Kudu Wiki
- Project Kudu on GitHub
- Extending Kudu to take into account unit tests
- Building DotNet Core
- Building Dot Net core on VSTS
- Building Dot Net core in Azure (with Kudu) - It just works