Azure API App vs Web App
Published: 2021-08-10 08:34:43

<h2>Introduction</h2>
<p>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.</p>
<p>Azure App Services are so popular due to the following reasons:</p>
<ul>
<li>Provision and deploy Web and Mobile Apps in seconds</li>
<li>Build engaging iOS, Android, and Windows apps</li>
<li>Automate business processes with a visual design experience</li>
</ul>
<p>It also adds various capabilities of Microsoft Azure to your application, such as&nbsp;</p>
<ul>
<li>Security</li>
<li>Load balancing</li>
<li>Autoscaling</li>
<li>DevOps capabilities (CI/CD from Azure DevOps, GitHub, Docker Hub and more.)</li>
</ul>
<h2>Key features of App Service</h2>
<ul>
<li>Support for various languages and frameworks (ASP.NET Core, Java, Ruby, Node.js, PHP and Python)</li>
<li>Support to DevOps tooling (Azure DevOps, GitHub, BitBucket and more) High availability&nbsp;</li>
<li>Third-party integrations (SAP, SalesForce, Facebook, etc.,)</li>
<li>Security&nbsp;</li>
<li>It is a Serverless service</li>
</ul>
<h2>Below are the various App services available</h2>
<ul>
<li>Web App</li>
<li>API App</li>
<li>Mobile App</li>
<li>Logic App</li>
</ul>
<p>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.&nbsp;</p>

<h2>What is Azure Web Apps?</h2>
<p>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.</p>
<p>&nbsp;These are the main features of the Web App:</p>
<ul>
<li>High availability with auto-patching</li>
<li>Continuous deployment with Git, TFS, GitHub</li>
<li>Deployment slots, testing in production, Web Jobs and continuous integration</li>
<li>Web Apps Gallery: WordPress, Umbraco, Joomla, Drupal</li>
</ul>
<p>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.</p>
<p><strong>Multiple languages and frameworks -&nbsp;</strong>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.</p>
<p><strong>Global-scale with high availability</strong>&nbsp;- 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.&nbsp;</p>
<p><strong>Visual Studio integration -&nbsp;</strong>Dedicated tools in Visual Studio streamline the work of creating, deploying, and debugging.</p>
<p><strong>API and mobile features</strong>&nbsp;- 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.</p>
<p><strong>Serverless code</strong>&nbsp;- 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.</p>
<h2>What is Web API in Azure?</h2>
<p>Azure Web API Apps, one of the <a href="https://www.serverless360.com/blog/azure-app-service-features" rel="noopener" target="_blank">Azure App Service features</a> that offers a rich platform and ecosystem for building, consuming, and distributing APIs in the cloud and on-premises.</p>
<p>&nbsp;The key accomplishments using <a href="https://www.serverless360.com/azure-api-apps-monitoring-management" rel="noopener" target="_blank">Azure API Apps</a> are as follows:</p>
<ul>
<li>Integrate with SaaS and enterprise applications</li>
<li>Generate client proxies or APIs in your language of choice</li>
<li>Automate versioning and deployment of API Apps</li>
<li>Secure APIs with Active Directory, Single Sign-On, and OAuth</li>
<li>Share APIs internally with organizational gallery</li>
</ul>
<p>API Apps also offer:</p>
<ul>
<li>Enterprise-grade security</li>
<li>Simple access control</li>
<li>Hybrid connectivity</li>
<li>Automatic SDK generation</li>
</ul>
<p>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.</p>
<p><strong>Bring your existing API as-is</strong>&nbsp;- 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.</p>
<p><strong>Simple access control</strong>&nbsp;- 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.</p>

<h2>How do I create a Azure API app?</h2>
<p>To Create an Azure API app, the user needs to</p>
<ol>
<li>Go to the Azure Portal and select <strong>New > Web + Mobile > API App</strong></li>
<li>Name it and a plan has to chosen for hosting the API app</li>
<li>Then user has to select the required Resource Group</li>
<li>And click <strong>CREATE</strong></li>
</ol>
<p>After few minutes the API app will be created.</p>
<h2>How do I host a Web API on Azure?</h2>
<p>Azure Web API App can be hosted in Azure by following the below steps</p>
<ul>
<li>In Solution Explorer, right-click the project and select <strong>Publish.</strong></li>
<li>In the Publish dialog, select Azure and select the <strong>Next</strong> button.</li>
<li>Select Azure App Service (Windows) and select the <strong>Next</strong> button.</li>
<li>Select <strong>Create a new Azure App Service.</strong></li>
<li>Select the <strong>Create</strong> button.</li>
</ul>
<h2>What is the difference between Azure Web API vs Web App</h2>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>The section below will throw light on how Web Apps and API Apps can be better managed and monitored using Serverless360.</p>
<h3>Monitor State of Azure API App and Web App</h3>
<p>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.&nbsp;</p>
<img src="https://www.serverless360.com/wp-content/uploads/2020/02/1-1.png" alt="Monitor Azure Web app and API app" class="aligncenter size-full wp-image-80218407" />
<h3>Monitor Azure API App and Web App on their Metrics</h3>
<p>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 <a href="https://www.serverless360.com/azure-web-apps-monitoring-management" rel="noopener" target="_blank">Azure Web App</a> 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.</p>
<img src="https://www.serverless360.com/wp-content/uploads/2020/02/2-1.png" alt="monitor Azure Web app and API app" class="aligncenter size-full wp-image-80218408" />
<p>Data Monitoring can be configured for an Azure API App or Web App on an extensive set of metrics.</p>
<h3>Set of Metrics</h3>
<ul>
<li>CPU Time (Bytes)</li>
<li>Server Errors (Count)</li>
<li>Health Check Status (Count)</li>
<li>Http 101 (Count), Data In (Bytes)</li>
<li>Data Out (Bytes)</li>
<li>Average Response Time (seconds)</li>
<li>Response Time (seconds)</li>
<li>Memory Working Set (Bytes)</li>
<li>Average Memory Working Set (Bytes)</li>
<li>IO other Bytes Per Second</li>
<li>Gen 0 Garbage Collection (Count)</li>
<li>Gen 1 Garbage Collection (Count)</li>
<li>Gen 2 Garbage Collection (Count) and so on.</li>
</ul>
<p>Data Monitor can be configured with various combinations of metrics to meet the monitoring requirements.</p>


<blockquote>In comparison to <a href="https://www.serverless360.com/azure-monitor-and-serverless360-comparison" rel="noopener noreferrer" target="_blank">Azure monitor</a>, 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.</blockquote>


<h2>Serverless360 BAM to achieve end-to-end tracking</h2>
<p><a href="https://www.serverless360.com/business-activity-monitoring" rel="noopener noreferrer" target="_blank">Business Activity Monitoring</a> 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&nbsp;<a href="https://docs.serverless360.com/docs/introduction">here</a>.</p>
<h3>Service Map</h3>
<p>Through <a href="https://docs.serverless360.com/docs/composite-service-map" rel="noopener noreferrer" target="_blank">Service Maps</a> 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.</p>
<img src="https://www.serverless360.com/wp-content/uploads/2020/02/3-1.png" alt="Monitor Azure Web app and API app" width="1203" height="709" class="aligncenter size-full wp-image-80218409" />
<h2>Summary</h2>
<p>This blog highlighted the key features of<a href="https://www.serverless360.com/azure-api-apps-monitoring-management" rel="noopener noreferrer" target="_blank"> Azure API App</a> &amp; 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.</p>