Monday, December 28, 2015

Azure App Services - The SuperHero of Cloud Resources

Preview:

Have you ever thought of deploying your web application in Azure instead of your in-house server infrastructure? Definitely it will raise a question "What will be the benefits". 
Let's think of a scenario:
You developed a web application, which is an online shopping cart. You are targeting buyers from different community across locations. You planned to inaugurate the portal during the Christmas,and based on market survey you estimated there will approx. 10,00,000 simultaneous buyers. You created a server cluster with numerous servers to support so many buyers. Its BINGO. Your inauguration was a grand success.

But post New Year, you realize that there are hardly 100 simultaneous users. You already invested on the server cluster, which are now underutilized. You can't throw them out. 

This resulted in high capex which could have been utilized somewhere else, or could have been split into numerous  opex over months/years. Obviously there are other investments related to necessary licenses & infrastructure to secure your web portal.

Its a very common issue faced while setting up an in-house data centre.

Azure gives an awesome solution through its App Services.

What is Azure App Service:

Built for developers, App Service is a fully managed platform with powerful capabilities such as continuous integration, continuous delivery with Visual Studio Team Services and GitHub, staging and production support, and automatic patching.

It allows you to create below service types:
  1. Web Apps : Quickly create and deploy mission critical Web apps that scale with your business.
  2. Mobile Apps - Engage employees, partners and customers on any device at any time
  3. API Apps - Easily build and consume Cloud APIs.
For this blog, let's concentrate on Web Apps, which is the most common usage of App Service.

Web Apps - More than just websites:

Web Apps provide a platform that will allow agility, security and scalability. Furthermore, they also provide the capability to link to their existing business system, be able to quickly deploy new code and spin up instances across the globe. With Azure App Service and Web Apps, organizations can roll out quickly and cost-effectively.


It is a fully managed platform that enables you to build, deploy and scale enterprise-grade web apps in seconds. Focus on your application code, and let Azure take care of the infrastructure to scale and securely run it for you. Web Apps is:



  • Familiar and Fast - Use your existing skills to code in your favorite language, framework, and IDE. With just a few clicks, add versioning, updating, single sign-on, identity broker, isolated storage, and performance monitoring to your existing web apps. Experience unparalleled developer productivity with cutting edge capabilities like continuous integration & continuous delivery from your Visual Studio IDE.
  • Enterprise Grade - Web Apps is designed for building and hosting secure mission-critical applications. Build Active Directory integrated business apps that connect securely to on-premises resources.
  • Global Scale - Web Apps is optimized to provide availability and automatic scale on a global data center infrastructure. Easily scale applications up or down on demand. 


Cost effective solution to reduce Capex: 


When you create a web apps in Azure, you get options to choose your own configuration. You are free to select & also to modify the size & capability of the service at your own convenience. The most important: you can configure your apps to scale up & scale down depending on the load. The load can be measured depending on CPU usage & messages in queue. The scale up & scale down will happen seamlessly without any impact or communication loss. Best You pay only for the duration of your usage.

Note: To take advantage of auto scale, make sure your web application is completely stateless.


Multiple Deployment Slots:

You must be having UAT process in your SDLC. What do you do? Do you invest on a different set of infrastructure, which remains idle for most of the development cycle. 

With Azure Web App Service you get 4 more deployment slots. You can go ahead and configure the deployment slots as per your usage like: Dev,QA,UAT,Staging and leave the primary slot as your production.

You do not need to to pay for the apps, but you may have to pay for any additional database instances. But again remember, you will be paying only when you create & use the instance. When not in use you can always terminate the instance.

Azure even provides the option of swapping the slots. Once your latest code is deployed in staging, you can even setup an auto swap, which will swap your staging with the production slot. In case of any difficulties, you can always swap back, with the least possible downtime. 

What else do you get:


Health Checkup: Web Apps provide a fantastic insight to health of your web application. With ability to integrate Insight, you can even monitor how your pages are performing. 



Backup: With your storage subscription you can schedule a backup process of your necessary artifacts.



Your own Domain: You are free to create your own domain and link it with your azure web apps.

No upfront licenses: You need not invest on any license.

Web.Config: You might have a question in your mind how will you make changes to your web.config file once the application  is deployed. Yes, you cannot. But instead, you can set up all connection strings & keys to provide the necessary values using Azure portal. Whenever your application requests for those values, azure will return the new values instead of the values defined in your web.config file.

Database: You obviously need a separate database instance where you can host your data & to which your web app can connect.

Network: You can configure your network to secure the database, and to host only the web app with public access.

Conclusion:

Can a web App give us everything? No, it can't give you everything but almost everything you need to deploy a web application.
If you need to integrate your web app with a standard desktop application, you are not allowed. In such scenario, you need to have a VM, where you can both deploy your web application and also install the necessary desktop application to integrate with your web app.

But remember, with a VM, you will have lot more responsibilities. If VM is the GOD of cloud services, then Web App is definitely the SUOPERHERO.



Note: How do you automate the deployment process your code repository? To implement continuous deployment, follow the post: Azure Web App - Continuous Delivery.