In this book, we will use PaaS offerings of Microsoft Azure such as App Service, database services, and storage services. We will also utilize other services such as Azure Active Directory, App Insights, and Traffic Manager. We will use all these services for managing the application life cycle for tasks such as application deployment, databases authentication, monitoring, and high availability.
Overview of Microsoft Azure Service
App Service - Microsoft Azure Web Apps
App Service is one of the most popular offering from Microsoft Azure. It is a PaaS. There are four kinds of applications that are created in App Service:
In this book, our focus is on Web Apps. Web Apps are a PaaS offering that have computing resources and runtime environments managed by Microsoft Azure while the user is only responsible for the application and configurations related to Web Apps and high availability.
The following are some quick points about Azure Web Apps:
- Web Apps runs on virtual machines – virtual machines are managed by Microsoft Azure
- Five pricing tiers are available – Free, Shared, Basic, Standard, and Premium
- Web Apps support applications written in Java, ASP.NET, PHP, Node.js, and Python
- We can integrate Web Apps with Visual Studio or GitHub
- We can create Web Apps from the Azure portal and also from the command line using PowerShell commands; thus it is easier to automate the creation process
- We can set CI and CD or deployment using Build and Release of VSTS
- We can configure autoscaling and make it available across the regions; we can set high availability as well
Let's see some basic difference between Azure Virtual Machines and Azure Web Apps:
Microsoft Azure virtual machines | Microsoft Azure Web Apps | |
Offering | IaaS | PaaS |
Support | Support for Linux, Windows Server, SQL Server, Oracle, IBM, and SAP | Linux (in preview), Windows |
Categories |
General purpose Compute optimized Memory optimized GPU High performance compute |
Free Share Basic Standard Premium |
Cost | Per-minute billing | Per-minute billing |
Virtual infrastructure responsibility | User | Microsoft Azure |
Out-of-the-Box support for VSTS | No | Yes |
Management overhead | Yes | No |
Installation and configuration are required | Yes, the customer is responsible for managing the resources | Web Apps come with a platform that supports different programming languages; we only need to configure the application settings |
To have a quick hands on, follow these steps:
- Go to https://tryappservice.azure.com. Select Web App:
- Select a template, in our case it is a Java template. Click on Create:
- The web app is ready. Note the URL given to access it:
- Visit the web app at a given URL:
This is how we can create a sample Azure web app.
Data and storage
The Microsoft Azure SQL Database is a RDBMS in the cloud. It supports the SQL Server engine and hence we can use existing SQL Server tools, libraries, and APIs to manage the SQL Database in the cloud. It comes in different pricing tiers such as Basic, Standard, and Premium service tiers that have different capacities for different workloads.
Microsoft Azure Storage is a cloud storage offering that is highly available, scalable, and durable. Microsoft Azure Storage services provide Blob storage, Table storage, Queue storage, and File storage:
- Blob storage (Object storage): This is used to store unstructured object data such as documents, media files, and binary data
- Table storage: This is used to store structured data such as NoSQL key-attribute data
- Queue storage: This is for reliable messaging
- File storage: This is used to store file data that can be used by Azure virtual machines and cloud services
Azure Active Directory (Azure AD) is a cloud-based, multitenanted, and highly available identity management service from Microsoft. It can manage users, groups, and multi-factor authentication; add an application organization that is developing for authentication; add an application from the gallery for authentication; add a custom domain; add role-based access control; and so on.
To access Azure AD from the Azure portal, go to https://portal.azure.com and click on Azure Active Directory.
Verify the Overview details with Users and groups, App registrations, and Azure AD Connect.
The application Gallery supports 2,771 applications for Azure AD integration at the time of writing this chapter. Categories include Business Management, Collaboration, Construction, Content management, CRM, Data Services, Developer Services, E-commerce, Education, ERP, Finance, Health, Human resources, IT infrastructure, Mail, Marketing, Media, Mobile Device Management, Productivity, Project Management, Security, Social, Supply Management, Telecommunications, Travel, and Web Design and Hosting.
Major applications supported are Office365, Salesforce, ServiceNow, Google Apps, and so on.
Go to https://manage.windowsazure.com to access Azure AD from the classic portal:
One of the biggest benefits that we will utilize in this book is the way we can provide authentication to access Azure Web Apps. We can configure Azure Web Apps with Directory so only specific users can access the application hosted on Azure Web Apps.
Application Insights
Visual Studio Application Insights is a flexible analytics service. It helps us to get the insights of performance and usage of an application. It can be used for .NET- or J2EE-based applications that are hosted on-premise or in the cloud. We will cover only a few important features that come with this service in this book.
Create a sample application and go to its MONITORING section. Click on Application Insights. Select Create new and click on OK:
We can create a web test for testing the availability of applications from multiple regions. We can select a ping test or multi-step test to check the availability. The alert criteria can also be configured.
Performance testing is also a very interesting feature available in App Insights. It is more of a load testing based on the number of users for a specific duration.
We will see the how to of both in this book where we intend to cover monitoring.
Traffic Manager
Microsoft Azure Traffic Manager provides a feature to distribute user traffic to different endpoints. These endpoints can be Azure App Service (Azure Web Apps), cloud services, Azure Virtual Machines, and external endpoints. It is a DNS-based traffic routing. Azure Traffic Manager supports three traffic routing methods to decide how traffic can be routed to different endpoints. In simple terms, it is a way to decide which endpoint should serve the DNS request.
There are two different deployment models in Microsoft Azure—the classic deployment and Resource Manager deployment models. Microsoft Azure Traffic Manager uses different terminology for traffic routing methods (known as the load-balancing method in the classic deployment model):
- Priority method (Failover method): Select the Priority or Failover method for traffic routing when you need resources in a specific region to serve all the traffic and only use other endpoints if the main endpoint is unavailable.
Often this method is cost-optimized and the usage of the application is very well known and specific to a region.
- Weighted method (Round-robin method): Select the Weighted or Round-robin method for traffic routing when you need resources to serve in a different region or across a set of different endpoints.
Let's say we know that our application hosted in Azure Web Apps is going to be equal or in a specific ratio, then the Weighted method can be more appropriate.
- Performance method: Select Performance for the traffic routing method when we want to provide equal performance to the user of the resources hosted in Azure.
So, in simple terms, users will be redirected to the nearest endpoint to serve the response.
Some benefits of Microsoft Azure Traffic Manager are as follows:
- Easy to use and configure
- Easy learning curve
- Configuration is available from Azure Portal as well as Azure PowerShellÂ
- DNS level traffic routing
- Helps in high availability of the business critical application
- Provides automatic failover
- Supports multiple endpoints: Microsoft Azure and external endpoints
- Helps to support the scenario of planned maintenance
- We can combine hybrid applications as it supports multiple endpoints