I have noticed that there is a general sense of mystery around Azure Cloud Service. Some equate it to Cloud Services in general while others get confused with the relation of Azure Cloud Service and Virtual Machines while some one else gets confused about using Azure Web Apps (formerly Websites) with webjobs over Azure Cloud Service. If you have been in a similar dilemma as I have been in the past, I will try and clarify the confusion and get you started on Azure Cloud Service through this tutorial series.
So Azure Cloud Services is not Cloud Services ?
No. This is probably the biggest confusion as a newbie to Azure. When we speak about Cloud Services, we generally talk about the entire gamut of cloud services, ranging from IaaS, PaaS to SaaS. However, when we talk about Azure Cloud Service we actually are focusing on PaaS, aka Platform-as-a-Service. Lets dig in a little bit of history to understand this.
When Azure had started, cloud infrastructure was synonymous to hosting services with a Website being hosted which could have some background processing and a backend database. Each of these components can be thought of as ‘Compute’ components. The idea was that all the management of this entire infrastructure will be taken care by a hosting service provider (in this case Windows Azure – yes it was Windows Azure then and now it is Microsoft Azure) while the developer will only be concerned about developing their portal. This is the classic Platform-as-a-Service paradigm.
Getting back to the Compute components: the front end was referred to as ‘Web Role’ while the background job was called as ‘Worker Role’. This was and is Azure Cloud Service as we know today. Each of these roles are supported on ‘instances’ which can be thought of as stateless Windows Server Machines with IIS installed. One does not have complete access to these instances. As time went by, the requirement was a deeper control and access to these ‘instances’ to get the requisite flexibility and customizability. This is what gave rise to Infrastructure-as-a-Service or Virtual Machines as we know them today.
Point being: Azure Cloud Service is P-a-a-S with Web Role (front end website) and Worker Role (Background Job Process) where as cloud services are generally the entire gamut of hosted services.
So Azure Cloud Services are Virtual Machines ?
No. Azure Cloud Service is Platform-as-a-Service (P-a-a-S) where as Virtual Machines are Infrastructure-as-a-Service (I-a-a-S). Azure Cloud Services can be thought of as a stateless virtual machine running Windows Server and IIS (for WebRole) where you don’t have full access to the VM which abstracts the service management of the box for you unlike in Virtual Machines.
As mentioned before, Azure Cloud Services can have 2 kind of roles: Web role and Worker Role. Each can be thought of as an instance running different aspects of the same project: Web Role (the website) interfacing with the external traffic where as Worker Role (the background job) processes the jobs. The communication between them is carried out using Queues or Service Bus Queues. Logically both of these instances can be grouped together in one Azure Cloud Service. Alternatively think of them as a logical grouping of stateless virtual machines with a common point of access to the external traffic which load balances and this logical grouping also takes into account of high availability and resilience architecture. Due to this logical grouping and communication mechanism, the traffic between these instances within the cloud service does not go through public internet and is therefore secure and fast.
Hope you are able to clearly differentiate between VMs and Azure Cloud Service now. We will dig into this deeper in the next part of this tutorial series.
How does Azure Cloud Service differ from Azure WebApp (formerly Azure Website)?
So I just described Azure Cloud Service as Web Role (front end Website) and Worker Role (background job) which can be accomplished by using Azure Web Apps in conjunction with Azure Webjobs. Yes, both are P-a-a-S solutions but Azure Cloud Service provides a tad bit more flexibility and control with access to startup tasks and login to instances supporting the Web role and Worker Role which is not possible in Azure Websites.
On a related point, if you need more flexibility to your instance such as Stateful needs or migrating existing on-prem solutions on the cloud, using VMs to host this application is the best way to go as you can configure your VM as per the configuration of your on-prem design but your management overhead increases accordingly.
Important Point to Note: There is a tradeoff between customizability/flexibility vs service management when you move from I-a-a-S to P-a-a-S.
Since instances in a Azure Cloud Service communicate with each other, how does this fit in with Azure Virtual Networks?
Yes, when instances communicate with each other in a azure cloud service, the traffic does not go through the external network and is taken care by direct communication between them through internal ports. Hence, Azure cloud service can connect to a Virtual network when it needs to talk to other cloud services in the virtual network or to a public network. We will discuss how to connect a cloud service in a virtual network in detail in a following article.
This post was primarily tuned towards clarifying the confusion around Azure Cloud Service. I often think, if I had my way, I might have considered to rename this service just to remove the confusion from a terminology perspective. However, guess that is not an option. However, the point is to understand the capability and power of using Azure Cloud Service. You can find more documentation around Cloud Service here. In the following posts in this series, I will detail one topic at a time such as Cloud Service and Websites, Cloud Service and VMs, etc. Stay tuned to learn and get started with Azure Cloud Services. Share your Azure stories with me @AdarshaDatta.