Deploying Kentico to Microsoft Azure – Know your web hosting options
Deploying Kentico to Microsoft Azure can have a significant impact on the capabilities and reach of your application. Azure, Microsoft’s cloud solution, is a vast, world-wide network of systems providing instant resources around the globe. Since its initial release, Azure has constantly been improved and updated to provide more options and functionality for businesses to leverage. In this article, I will cover the different hosting options for your Kentico site and providing guidance on when to use them. In a follow-up blog I will cover data, session, and storage options, so keep an eye out of that in a few weeks. Now let’s get to good stuff!
Web Hosting Options
Azure provides several options for hosting applications, each with their own benefits and drawbacks. Before we get into those comparison, I want to provide an overview of each option. From a high-level, the options all do the same thing: host your site. How they are managed and the amount of control that you have over the site is where they differ. I have deployed solutions to all of these platforms and think they can all benefit companies, but in different ways.
Cloud Services
“Cloud Services” is the grandfather of the Azure world, as it was the first option companies had to which to deploy. Based on the Platform-as-a-Service (PaaS) model, Cloud Services extract all of the setup and maintenance from the company by having everything handled by Microsoft. Developers package their application locally and deploy it to the cloud, where a new server is created, configured, and brought online. Once online, the uploaded deployment package is applied to the server and the application is created. Additional actions can be scripted and executed on the servers, allowing companies to configure Windows Services, integrate their applications with back-end systems, and other complex requirements. Additionally, developers can configure the deployment to allow remote access, giving them ability to access and administrate the server, if needed.
Cloud Services are much less work for the client because most of the heavy configuration and administration is handled by the system. This allows companies to focus on their application and not on the hardware. While in theory this is a great scenario for businesses, Microsoft did not see the expected level of adoption when Azure was first introduced. This was largely due to the market’s familiarity with other hosting options the need for direct server access.
Another factor in the low level of adoption is the packaging and deploying concept used by Cloud Services. Developers are required to configure their application as a Web Application prior to deployment. Additionally, they need to package their application as a “snapshot” and deploy it to the cloud. Azure pulls from this “snapshot” to create the application. This creates a scenario where every change to the application requires a full deployment, a daunting task for a large Kentico application.
Virtual Machines (VMs)
After the initial launch of Azure, Microsoft realized companies needed more options for hosting their applications. Many had legacy applications that required specific, older OS versions and frameworks. To address these concerns, Microsoft introduced Virtual Machines (VMs). VMs are a “traditional” virtualized server solution. This is very similar to other hosting providers in that Azure provides the metal and connectivity, but the client is responsible for the OS and applications. This solution gives the most control to the company so they can install, configure, and administrate any aspect of the server. Azure provides power, hardware, and connectivity.
A unique aspect of Azure VMs is the ability to choose from a gallery of images for the virtual machine. Microsoft provides options for Windows, Linux, Ubuntu, CoreOS, and others. Developers have the option to choose nearly any configuration of SQL Server, BizTalk Server, or even Visual Studio for a cloud-hosted development machine. All of the licenses costs for the OS and Azure-provided software is included in the monthly fee.
Kentico applications that require a lot of customization may benefit from a VM deployment because the developer has the ability to control every aspect of the environment. Any change to the code is made right on the server and allows direct file access to system. Additionally, complex services and integrations can be easily managed via RDP. Finally, legacy Kentico applications that cannot be converted to a web application can easily be set up on the desired OS and managed like an on-premise solution.
Web Apps (formerly Web Sites)
With Cloud Services and VMs in place, Microsoft had a very strong product offering for enterprises wanting to deploy to the cloud. There was, however, a lack of lost-cost, easy-to-maintain solutions for smaller, less-complex applications. Initially designed as a “testing” environment for companies, Azure Web Apps were introduced to accommodate this growing need in the industry. This new model took from the PaaS model and offered a solution that would allow developers to focus on their code, while abstracting the management of the server even further.
With Web Apps, companies deploy their application via a number of protocols (FTP, Git, etc.) and never have direct server access. Azure does provide a number of application-level settings which developers can set in order to control certain aspects of their deployment. However, they cannot get direct server access.
From a Kentico perspective, Web Apps offer a lot of options for deployment. Projects can be either Web Sites or Web Applications, and run on multiple versions of .NET. Because the deployment is done via FTP/Web Deploy, changes are easily rolled out and applied to the application. This makes Kentico development a fast and simple process where changes can be completed and deployed, all from within Visual Studio. Combine this with integration to an online source control (Visual Studio Online, Git, etc.), and the development lifecycle gets even more defined and controlled with automated testing and continuous integration.
Web Hosting Options Pros & Cons
Every technical decision has both good and bad tradeoffs. With Azure, choosing a specific hosting option will enable you to have a certain level of functionality, but may introduce other limitations that developers don’t like. The following is a break-down of the benefits and downsides of each option.
Here is a great image from the Microsoft Azure site comparing the different options.
Cloud Services
Pros
- Allows for direct server access, while offloading server administration
- Allows for 3rd party systems/applications/services
- Longest supported Azure hosting option for Kentico
- Built-in scalability of servers
- Allows for scripting startup tasks on application creation
- Integration with VSO/Git/Source Control for Continuous Integration
- Can be integrated with external systems via VPN
- Kentico Azure projects have native Azure code built-in
- Can get a reserved outbound IP address
Cons
- Lengthy deployment process for Kentico applications (build/package times)
- Every modification requires a complete deployment
- Requires a solid understanding of Azure and the underlying systems
- Error handling requires special configuration/considerations
- Must use Web Application project types
VM
Pros
- Allows for complete control of OS and environment
- Allows for installation of legacy Kentico installations
- Allows for 3rd party systems/applications/services
- Great for virtualizing existing services and deploying to the cloud
- Allows for configuration of startup tasks on application creation
- Allows Web Site or Web Application project types
- Can be integrated with external systems via VPN
- Can get a reserved outbound IP address
Cons
- All administration is client’s responsibility
- Provides less flexibility
- Scalability will require additional networking configuration
Web Apps
Pros
- Fastest deployment model
- Built-in scalability of servers
- Simplified system management
- Integration with VSO/Git/Source Control for Continuous Integration
- Allows Web Site or Web Application project types
- Familiar deployment/hosting model for many developers
Cons
- No direct server access
- Limited application configuration options
- Limited .NET Frameworks supported
- Limited connectivity with external systems
So, which one is right for you?
As you can see, each hosting option has its benefits and drawbacks. When it comes to deploying Kentico, knowing what your application will require will help you determine the optimal solution. I’ll try and provide some high-level guidance, but you should know that every project is different and the solution is not always clear.
Cloud Services
- Applications that require VPN connectivity with external systems
- Enterprise-level systems with integration points to several systems via Windows Services/3rd party applications
- Applications with in-frequent updates/deployments
VMs
- Legacy applications
- Non-Azure compatible language/component
- May require VPN connectivity
- Existing VMs
- Implementations that require direct server access and lots of customizations
Web Apps
- Simple/Moderate applications requiring little integration
- Stand-alone applications with no additional services/systems
- Applications with frequent updates/deployments
Final Verdict
What is my final thought about when to use each option? Here’s a mental checklist which I use when deciding the best option:
Start with Azure Websites
- Do you need server access?
- Do you have 3rd party MSIs/services which need to be installed?
- Do you have custom server configurations that have to be made for your application to run?
- Do you have legacy code, such as ASP (Gasp!), .NET 1.1/20, etc., which needs to be deployed as part of your application?
- Do you need to support a VPN connection to an external system for your application to run?
- Do you need a reserved outbound IP address for your application?
If you answered “yes” to any of those, you may want to consider either Cloud Services or VMs. Both give you server-level access and the ability to customize the hosting environment. Cloud Services will require more knowledge about Azure but will provide more scaling options and less administration.
If you can’t answer yes to any of those, I would definitely start with Azure Web Apps. They will offer the fastest deployment method and a large number of options for you to use when configuring your application. Moreover, Microsoft is continually adding functionality to Web Apps and expanding their capabilities and usefulness. Because of these points, Web Apps are definitely the way to go if your project can run on them.
Thank you for reading. Hopefully this guide helps in your project planning and decision making about which hosting option is best. I’d love to hear your thoughts and questions so please include them in the comments below.
Good luck!