Azure App Service is a Platform as a Service (PaaS) offering that lets you host web applications, mobile backend services, and REST APIs. This HTTP-based service lets you develop using various programming languages, including Java, Node.js, .NET Core, .NET, Ruby, Python, and PHP. It lets you easily run and scale your applications on Windows and Linux environments.
App Service enables you to add Microsoft Azure security, automated management, and auto-scaling functionality to your applications. It also lets you integrate with various DevOps services, such as Azure DevOps, Docker Hub, GitHub, and provides tools for package management, TLS/SSL certificates, and custom domains.
An App Service plan defines the computing resources your web applications can use in Azure, and the applicable Azure pricing. One App Service plan can run multiple applications, including web apps, APIs, mobile apps, and Azure Functions.
When creating an app service plan, you can define each plan to a certain region and set of computing resources. The App Service plan determines the following parameters:
- Operating System—Windows or Linux.
- Region—Azure region in which your resources will run, like the West US region.
- Number of virtual machines (VMs)—the number of instances your applications require.
- Size of VM instances—small, medium, or large.
- Pricing tier—Azure provides several pricing tiers for the service, including Free, Shared, and several premium plans.
App Service pricing tiers can be categorized by the features they provide:
- Shared compute—the two base tiers are Free and Shared, which run your application on the same Azure VM applications, including apps belonging to other customers. These tiers share resources and allocate CPU quotas for each app. It does not support scale out.
- Dedicated compute—in this category, an organization’s applications run on dedicated resources which are not shared with other Azure App Service clients. However, multiple applications within the same plan run on shared resources. This includes the Basic, Standard, and Premium tiers, all of which support scaling out by adding more VM instances.
- Isolated – this category provides full network isolation and compute resource isolation. It runs a dedicated Azure VM for each application with its own Azure VNet. This group of pricing tiers includes Isolated and IsolatedV2. This category provides the most advanced scale out capabilities.
Each tier provides specific App Services including SSL/TLS, deployment slots, custom domains, and Traffic Manager integration. You can find which features each tier supports on the official pricing page.
Azure App Service stores application data in Azure Storage and enables it to be shared across the Azure environment. This means that:
- Application data is shared across multiple VMs running instances of the app
- Data is persistent and able to be modified by any instant of the app
- The same shared content folder contains logs and diagnostic files for the application
- Any new content published in an application updates the content folder, and the same content can be viewed through the source control manager (SCM) interface or the application itself.
Some applications do not use all of these capabilities. If an application needs a fast read-only data store for improved web performance, it can leverage the App Service Local Cache feature. The local cache provides the following capabilities:
- Low latency access to content without needing to remotely access Azure Storage.
- No performance impact of upgrades or downtime in Azure Storage.
- Fewer application restarts due to changes in storage shares.
Let’s see how to create and deploy a simple Node.js app in Azure App Service. This is adapted from the official quick start tutorial for Azure App Service.
Before you begin, make sure you have an active Azure subscription, and install the following on your local machine:
- NPM package manager.
- Visual Studio Code, including the Azure App Service extension.
Create a sample Node.js application on your local machine using the following command, available by default in recent versions of Node.js:
npx express-generator my Express App –view pug
Change to the application directory, which by default is my Express App, install NPM packages, and run a development server with this command:
Open a web browser and view the URL http://localhost:3000—if you see the message Welcome to Express, this means the application is successfully running.
While still in my Express App directory, execute Visual Studio Code by running:
In Visual Studio Code, click the Activity Bar, click the Azure logo, expand the App Service menu, and click Sign in to Azure… Provide the credentials for your Azure subscription.
Next, in the App Service menu, click the Deploy to Cloud button.
In the dialog that opens, select my Express App folder, click Create new Web App:
- Select a globally unique name for the app
- Under Select a runtime stack, select your version of Node.js.
- Under Select a pricing tier, select Free (F1).
- Don’t modify the rest of the options—by default the app will be deployed in a Linux container.
Wait for the resources to be created in Azure. After a few minutes, a prompt will open asking whether to Always deploy the workspace to the cloud-based application you selected. Click Yes—this means that as long as you are in the workspace, Visual Studio Code will always deploy the app to the same cloud destination.
When deployment ends, another prompt will appear. In this prompt, click Browse Website and the browser will show the Express application, now running in the Azure cloud.
In this article, I explained the basics of Azure App Service, reviewed pricing and storage considerations, and showed a brief tutorial illustrating how to deploy a simple web app to the Azure cloud. The process involves:
- Creating a Node.js application in your local machine—you can do this with the Node express-generator command, or experiment with your own Node.js applications.
- Deploying the application to Azure using Visual Studio Code—the Visual Studio Code lets you sign into Azure, and allows you to deploy the app to Azure App Service in one click. The resources are deployed in Azure and then you can access your application in the Azure cloud.
It’s that simple! I hope you enjoyed this brief review of Azure App Service and your options for deploying web applications to Azure.