DEV Community

Cover image for Azure API App vs Web App
Madhavan kovai
Madhavan kovai

Posted on • Originally published at serverless360.com

Azure API App vs Web App

Introduction

Azure App Service, one of the most used among the Azure offered Services. When the requirement is to host web applications, REST APIs, and mobile back ends, Azure App Service is the go-to Http- based solution. Apps hosted in Azure App Service can be integrated with on-premises or cloud services. It supports both the Windows and Linux-based environments to run and scale the applications.

Azure App Services are so popular due to the following reasons:

  • Provision and deploy Web and Mobile Apps in seconds
  • Build engaging iOS, Android, and Windows apps
  • Automate business processes with a visual design experience

It also adds various capabilities of Microsoft Azure to your application, such as 

  • Security
  • Load balancing
  • Autoscaling
  • DevOps capabilities (CI/CD from Azure DevOps, GitHub, Docker Hub and more.)

Key features of App Service

  • Support for various languages and frameworks (ASP.NET Core, Java, Ruby, Node.js, PHP and Python)
  • Support to DevOps tooling (Azure DevOps, GitHub, BitBucket and more) High availability 
  • Third-party integrations (SAP, SalesForce, Facebook, etc.,)
  • Security 
  • It is a Serverless service

Below are the various App services available

  • Web App
  • API App
  • Mobile App
  • Logic App

In this article, we will discuss the two most used App services (Web App, API App) on Web development. It is necessary to understand the significant capabilities of these two services to make an informed decision while hosting your web applications. 

What is Azure Web Apps?

Web Apps are the compute resources that Azure provides for hosting a website or web application in App Service. With Web Apps get a fully managed platform to build, deploy, and scale enterprise-grade web Apps in seconds.

 These are the main features of the Web App:

  • High availability with auto-patching
  • Continuous deployment with Git, TFS, GitHub
  • Deployment slots, testing in production, Web Jobs and continuous integration
  • Web Apps Gallery: WordPress, Umbraco, Joomla, Drupal

It provides scalable and enterprise-ready systems along with continuous integration that can be built using the app services. Web development framework backing is open as well.

Multiple languages and frameworks - App Service has first-class support for the official ASP.NET site, Node.js, Java, PHP, and Python. You can also run executables on services like VMs.

Global-scale with high availability - Scale up or out manually or automatically. Host your apps anywhere in Microsoft's global data centre infrastructure, and the App Service SLA promises high availability. 

Visual Studio integration - Dedicated tools in Visual Studio streamline the work of creating, deploying, and debugging.

API and mobile features - App Service provides turn-key CORS support for RESTful API scenarios, and simplifies mobile app scenarios by enabling authentication, offline data sync, push notifications, and more.

Serverless code - Run a code snippet or script on-demand without having to explicitly provision or manage infrastructure and pay only for the compute time your code uses.

What is Web API in Azure?

Azure Web API Apps, one of the Azure App Service features that offers a rich platform and ecosystem for building, consuming, and distributing APIs in the cloud and on-premises.

 The key accomplishments using Azure API Apps are as follows:

  • Integrate with SaaS and enterprise applications
  • Generate client proxies or APIs in your language of choice
  • Automate versioning and deployment of API Apps
  • Secure APIs with Active Directory, Single Sign-On, and OAuth
  • Share APIs internally with organizational gallery

API Apps also offer:

  • Enterprise-grade security
  • Simple access control
  • Hybrid connectivity
  • Automatic SDK generation

The API Apps enhance the experience of developing, deploying, publishing, consuming, managing and monetizing RESTful Web APIs. Current APIs can take advantage of the API Apps platform with no changes, it can connect to Azure Active Directory, it allows easy connection to SaaS platforms, and it can be consumed by Logic Apps. API App is specific for developing RESTful APIs with feature like Swagger out of the box. The developers can also include built-in support for different enterprise systems such as SAP, Oracle, etc.

Bring your existing API as-is - You don't have to change any of the code in your existing APIs to take advantage of API Apps -- just deploy your code to an API app.

Simple access control - Protect an API app from unauthenticated access with no changes to your code. Built-in authentication services secure APIs for access by other services or by clients representing users. Supported identity providers include Azure Active Directory, Facebook, Twitter, Google, and Microsoft Account. Clients can use the Active Directory Authentication Library (ADAL) or the Mobile Apps SDK.

How do I create a Azure API app?

To Create an Azure API app, the user needs to

  1. Go to the Azure Portal and select New > Web + Mobile > API App
  2. Name it and a plan has to chosen for hosting the API app
  3. Then user has to select the required Resource Group
  4. And click CREATE

After few minutes the API app will be created.

How do I host a Web API on Azure?

Azure Web API App can be hosted in Azure by following the below steps

  • In Solution Explorer, right-click the project and select Publish.
  • In the Publish dialog, select Azure and select the Next button.
  • Select Azure App Service (Windows) and select the Next button.
  • Select Create a new Azure App Service.
  • Select the Create button.

What is the difference between Azure Web API vs Web App

The section above highlighted the key benefits of choosing the Azure App Services, Web App and API App. To summarize and help on the decision making on web API vs Web App: There once was a disconnect between Azure WebApp and API App. Today? The only difference is which icon/name you want that app to be flagged with. Otherwise? All features available for one is available to the other. No differences under the hood. Only different icons, name and an API Definition that is populated. All App Services features are still available to you.

When your business application has got multiple UI components to be compatible with Mobile and desktop interfaces, the UI applications can be hosted in the Mobile App and Web App respectively. However, the underlying business logic needs to be severed from a common source to maintain consistency. In this scenario hosting the business tier in an Azure API App will be the best solution.

When your business application involves multiple components hosted through the Azure offered App Services, managing and monitoring them through Serverless360 would enhance the efficiency of your Operations and Support team.

The section below will throw light on how Web Apps and API Apps can be better managed and monitored using Serverless360.

Monitor State of Azure API App and Web App

If the intention is to monitor the state of the Azure API App or Web App, say the business demands the Web App, to be always running, Serverless360 can monitor the current state of the Web App against the expected state. By associating a Web App to a Status Monitor or Threshold Monitor, it is possible to monitor the state and get alerted through configured notification channels by comparing the current state against the expected state. 

Monitor Azure Web app and API app

Monitor Azure API App and Web App on their Metrics

If the intention is to understand the efficiency, reliability or consumption of the Azure API App or Web App then the choice should be a Serverless360 Data Monitor. Data Monitoring can be configured for an Azure API App and Web Apps on an extensive set of metrics. If the requirement is to monitor, any errors encountered by the Azure Web App that makes it unavailable for the consuming application. Configure a data monitor with Http Server Errors being monitored against appropriate warning and error threshold values.

monitor Azure Web app and API app

Data Monitoring can be configured for an Azure API App or Web App on an extensive set of metrics.

Set of Metrics

  • CPU Time (Bytes)
  • Server Errors (Count)
  • Health Check Status (Count)
  • Http 101 (Count), Data In (Bytes)
  • Data Out (Bytes)
  • Average Response Time (seconds)
  • Response Time (seconds)
  • Memory Working Set (Bytes)
  • Average Memory Working Set (Bytes)
  • IO other Bytes Per Second
  • Gen 0 Garbage Collection (Count)
  • Gen 1 Garbage Collection (Count)
  • Gen 2 Garbage Collection (Count) and so on.

Data Monitor can be configured with various combinations of metrics to meet the monitoring requirements.

In comparison to Azure monitor, Serverless360 monitors offer consolidated monitoring and reporting on all the resources that constitute your business application in multiple perspectives which is hard to achieve in the Azure Monitor.

Serverless360 BAM to achieve end-to-end tracking

Business Activity Monitoring in Serverless360 can help to achieve end-to-end visibility on the messages following through multiple App Services of your business application. With little instrumentation done into your web application and API application consuming the .Net SDK exposed by Serverless360 BAM, tracking can be achieved at ease. Explore more on this feature here.

Service Map

Through Service Maps in Serverless360, keep your support team informed about the status of your App Services readily available. Achieve proactive support rather than being reactive to customer requests.

Monitor Azure Web app and API app

Summary

This blog highlighted the key features of Azure API App & Web App. We believe this would help you take an informed hosting decision. Once your business application is in production, Serverless360 can help in better managing and monitoring your App Services. Stay tuned to know more about App services.

Top comments (0)