Reader small image

You're reading from  Implementing DevOps with Microsoft Azure

Product typeBook
Published inApr 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781787127029
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Mitesh Soni
Mitesh Soni
author image
Mitesh Soni

Mitesh Soni has 8 years of experience in managing software for GNU/Linux and other UNIX-like operating systems in production environment. He started working as a professional with DevOps from 2013 and has worked on several live projects related to DevOps. https://www.linkedin.com/in/alessiogarofalo
Read more about Mitesh Soni

Right arrow

Chapter 4. Continuous Development with Microsoft Azure Web Apps

Most people overestimate what they can do in one year and underestimate what they can do in ten years.                                                                                                                                                                                                                                                                           –Bill Gates

The Microsoft Azure App Service is a PaaS offering from Microsoft and it has an easy learning curve. In this chapter, we will discuss App Service (Microsoft Azure Web Apps) in detail. Web Apps are used to deploy applications in the process of CD and continuous development. It covers how we can create different web applications for environments that can be used to deploy web applications with cost benefits and isolation too. It also covers a brief description on providing secure access to all resources using role-based access that is significant from the...

Creating Azure Web Apps


Azure Web Apps is an App Service by Microsoft that can be used to deploy Java, ASP.NET, Node.js, PHP, and Python-based business web applications. The PaaS model comes with less management in the context of managing underlying resources. Hence, we need not worry about the infrastructure and we can focus on the innovations and improvements in the application logic.

App Service can be easily used in DevOps practices. VSTS can be used for continuous integration and CD or deployment using different tasks and different ways. VSTS has tasks for the application deployment in Azure App Service.

Azure Web Apps can scale and be made available in different geographies using manual and scheduled scaling operations and traffic manager simultaneously. The underlying resources can be based on Linux (in preview) or Windows and it provides this option while creating a web application. There are multiple pricing tiers available with different features and capacities to host web applications...

Configuring Web Apps with programming language specific settings


Now, once we have created web application, we can configure it based on our needs. For example, we need to configure the web application based on a 32-bit or 64-bit platform, programming language, and so on.

  1. Go to Azure web application in the Microsoft Azure portal.
  1. Search for Application settings and click on it. It will open a General settings pane. Here we can configure the application runtime environment. There are different options available for configuration such as .NET Framework version, PHP version, Java version, Python version, and Platform:
  1. We are going to deploy a Java-based application, hence we will configure Java settings in this web application. Select Java 8 in the Java version field:
  1. Select Newest in the Java Minor version field:
  1. In Web container, select Newest Tomcat 8.5:
  1. Select a 32-bit or 64-bit environment as Platform. Free and Shared pricing tiers can host a 32-bit environment only. The web application pricing...

Deployment slots – development, QA, UAT, staging, and production


App Service or Azure Web Apps is a main or production slot. In the Standard and Premium tiers, we can create deployment slots other than the main slot to deploy an application. We can use deployment slots for different environments before deploying an application into the main slot.

Slots are not different from a live web application. They have their own set of content, configurations, and hostnames. We can swap slots to roll back failures too.

  1. In the Azure portal, go to the MyPetClinic Azure web application.
  2. In the APP DEPLOYMENT category, click on the Deployment slots option:
  1. Click on +Add Slot.
  2. Provide a Name for the new slot and select Configuration Source:
  • Don't clone configuration from an existing slot
  • mypetclinic

    Select mypetclinic, and all the configuration which is available in that Azure web application (main or production slot) will be done in a new slot. Click on OK:

    1. In the normal scenario, we have different environments...

    Deployment credentials management for FTP


    We can connect to Azure web application with FTP also. We can configure FTP tasks in the VSTS for the deployment of a package file.

    Perform the following steps to get FTP-related details:

    1. In the Overview section of the Azure web application we have created, copy FTP hostname or FTPS hostname.
    2. Click on More.
    3. Select Get publish profile. It will download a file that has details about FTP username and password, which is constant and can be used for FTP connection.
    1. To set user specific FTP credentials, click on Deployment credentials, set username, and password:

    This username and password is for all subscriptions associated with the Microsoft Azure account, while the username and password in the publish profile file are per-site.

    In the next section, we will cover the basic monitoring capabilities available in the Azure portal.

     

    Azure Web Apps monitoring


    Azure Web Apps provides the easy-to-analyze Monitoring section on the App Service dashboard itself. It gives basic details on the number of requests and errors. We can also customize based on available options by clicking on Edit:

    1. In the Overview section of our web application, observe the Monitoring chart. It shows Requests and errors:
    1. Select Time Range, Chart type, and the details we need to monitor in the chart.

     

    1. Click on OK, and observe the change in the bar chart:

    We configured Azure web application with basic settings. In the next section, we will configure the role-based access for secure access of Azure Web Apps.

    Configuring role-based access for secure access of Azure Web Apps


    Microsoft Azure Role-Based Access Control (RBAC) provides role-based authorization to access specific Azure resources or resource group. With Azure RBAC, we can provide access to resources based on need. For example, server-side developers get access to resources that are used to host the web application; the testing team will have access to only testing-related resources available in the Azure portal; the database team will have access to the SQL database.

    There are three basic roles:

    • Owner: This has full access to all resources
    • Contributor: This is to create and manage all resources, but it has no privilege to grant access to others
    • Reader: This is to view available resources

    Note

    A few important things to note:

    Microsoft Azure subscription has one Azure Active Directory (Azure AD) that has many users, groups, and applications associated with it. We can grant access to users and groups for available Azure resources at three different...

    Scaling Azure Web Apps


    The scaling up and down or scaling in and out operations are required to effectively utilize underlying resources based on the requirements. For example, for an online shopping website, we can predict that it will have a huge number of requests during festival days. It may have a moderate number of requests on normal weekdays. In such a scenario, it is better to keep more resources available to manage user requests and decrease the number of resources on normal days. If we can automate this scale in and scale out operation, then it is the best utilization of resources and customers also won't face any issues.

    Both the operations are performed on the ASP.

    Scaling up and down

    In this option, we can increase the number of cores, RAM, storage, the number of instances, slots, backup, and other services.

    To scale up, go to Azure web application and select Scale up (App Service plan).

    The selected pricing tier will have a blue border around it. Change the higher pricing tier based...

    Basic tasks to manage Azure Web Apps


    As we have covered the main topics, namely creating Azure Web Apps, configuring web application with programming language specific settings, deployment slots – development, QA, UAT, staging, and production, deployment credentials management for FTP, Azure Web Apps monitoring, configuring role-based access for secure access of Azure Web Apps, and scaling Azure Web Apps, let's now see how we can perform some other tasks to manage and maintain Azure Web Apps.

    Microsoft Azure Web Apps properties

    There are specific scenarios where we may need to connect to some web services available behind the firewall and installed on-premise. 

    To consider security, we need to whitelist IP addresses from the sources where the request is originating:

    We can use OUTBOUND IP ADDRESSES to whitelist behind the firewall, so applications hosted on Azure Web Apps can access the resources available on-premise.

     

    Microsoft Azure Web Apps – App Service plan

    Azure App Service plan (ASP) is...

    Summary


    Let's revise what we have covered until now.

    In this chapter, we saw how to create Azure web applications and configure web applications with programming language specific settings, deployment slots for managing different environments in a cost-effective manner, use deployment credentials for FTP, basic Azure Web Apps monitoring, configure role-based access for secure access of Azure Web Apps, scaling up and down Azure web application resources, scaling in and out Azure web application resources, Microsoft Azure Web Apps properties, Microsoft Azure Web Apps – ASP, Azure Web Apps backups and restore from the backup, and overview of Azure Web Apps custom domains, SSL certificates, networking, security scanning, locks, and console:

    In the next chapter, we will look into ASE which is considered more secure than a normal Azure web application. An ASE is more secure and has a higher number of instances while scaling operations at the time of peak load. We will cover how to create an ASE...

    lock icon
    The rest of the chapter is locked
    You have been reading a chapter from
    Implementing DevOps with Microsoft Azure
    Published in: Apr 2017Publisher: PacktISBN-13: 9781787127029
    Register for a free Packt account to unlock a world of extra content!
    A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
    undefined
    Unlock this book and the full library FREE for 7 days
    Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
    Renews at ₹800/month. Cancel anytime

    Author (1)

    author image
    Mitesh Soni

    Mitesh Soni has 8 years of experience in managing software for GNU/Linux and other UNIX-like operating systems in production environment. He started working as a professional with DevOps from 2013 and has worked on several live projects related to DevOps. https://www.linkedin.com/in/alessiogarofalo
    Read more about Mitesh Soni