Configure scaling for an App Service plan
You can scale an App Service plan either by scaling up or down the tier, or scaling out (or in) to more (or fewer) instances. Scaling up changes the pricing tier that you have selected for the plan, along with the compute, memory, storage, and other features that are included at the new tier. Scaling out multiplies the number of instances that the plan has associated with it.
This effectively doubles, triples, and so on the amount of compute and memory behind the plan depending on how many instances it has scaled to.
To scale an App Service plan, navigate to the plan from the Azure portal. To scale up, select the Scale Up (App Service plan) blade.
The user interface is similar to that you see when you are deploying an App Service. You can select the desired tier, as shown in Figure 3-67.
FIGURE 3-67 Scale Up App Service Plan
Scaling out provides additional compute and memory for the web apps associated with the App Service plan, similar to the way a Virtual Machine Scale Set can scale to provide more com- pute nodes. To scale out an App Service plan, select the Scale Out (App Service plan) blade.
There are three options for configuring instance scaling, as shown in Figure 3-68:
■ Manual Manually specify the instance count, and it will remain static until modified
again.
■ Automatic Allow Azure to manage scaling based on traffic, but you can set a
maximum instance count for cost management.
■ Rules Based Requires you to create rules to determine when and how to scale out (more capacity) or in (less capacity). Rules can be created based on common App Service metrics, such as bandwidth, requests, errors, and more.
FIGURE 3-68 Scale Out App Service Plan
Create an App Service
App Service is a hosting service that lets you build and deploy your applications to run on Win- dows, Linux, or your Docker container in a managed infrastructure. You can also choose the programming language with which you would like to build your code. App Service is currently supported on both Windows and Linux environments. Also, App Service can host your Docker containers running on either Linux or Windows, and it brings additional capabilities, such as autoscaling, load balancing, security, monitoring, and the like.
With App Service, it is easy to acquire DevOps capabilities, such as CI/CD integration with various platforms, such as Azure DevOps, GitHub, Docker Hub, or other sources. Additionally, App Service has extensive monitoring capabilities by using Application Insights and Azure Monitor.
To create a web app, from the Azure portal homepage, search for App Services. On the App Services page, select Create, Web App. In addition to selecting the Subscription Name and Resource Group, select Web App-Specific Details. You can choose either to publish your code or publish a Docker container, as shown in Figure 3-69. You will also need to select or create a new App Service plan, which is discussed earlier in this Skill.
FIGURE 3-69 Basics tab on the Create Web App blade
If you choose to publish your code, you need to select an option from the Runtime Stack drop-down menu and select the Operating System (either Windows or Linux) to run your application code. As of this writing, the supported runtime stacks for an App Service include
■ .NET
■ Java
■ Node
■ PHP
■ Python
If you choose to publish a Docker Container, select the supported operating system (either Windows or Linux) to run your container, as shown in Figure 3-70. You will need to select the Container Image on the Docker page.
FIGURE 3-70 Docker Container options for the Create Web App blade
You must choose either Single Container or Docker Compose (Preview). From the Image Source setting, you choose where to pull the images from (see Figure 3-71). Your choices are QuickStart Templates (only applicable for the Single Container option), Azure Container Registry, Docker Hub, or any other private registry.
FIGURE 3-71 Docker options for creating a web app
On the Monitoring tab, you can enable Application Insights for your application or containers. This allows you to closely monitor your web app with performance metrics. Application Insights is a separate resource that has its own management and billing. Creating an Application Insights resource with the App Service is displayed in Figure 3-72.
FIGURE 3-72 Monitoring options for a web app