Azure App Services Reference

App Services Reference

This document provides detailed reference information for Azure App Services, covering its core components, configuration options, deployment strategies, and operational aspects.

App Service Plan

An App Service plan defines a set of compute resources for your web apps, API apps, and mobile apps to run. When you choose an App Service plan, you choose a region, the size of the virtual machines (SKUs), and the number of instances.

Web App

Web Apps are Azure's Platform-as-a-Service (PaaS) offering for hosting web applications, REST APIs, and mobile backends.

API App

API Apps are designed specifically for hosting RESTful APIs. They offer features like built-in support for Swagger/OpenAPI, authentication, and hybrid connection capabilities.

Logic App

While not directly hosted within App Services in the same way as Web/API Apps, Logic Apps are often integrated with App Services to orchestrate business processes and workflows.

Deployment Methods

Azure App Services supports a wide range of deployment methods to suit different workflows:

Continuous Integration

Automate your build and deployment process. Configure App Services to automatically deploy new code whenever changes are pushed to your connected Git repository or build pipeline.

Tip: For a smooth CI/CD experience, use Azure DevOps or GitHub Actions.

Deployment Slots

Deployment slots allow you to deploy different versions of your application to separate environments. You can then swap these slots to perform blue-green deployments, staging, or rollback operations with zero downtime.

App Settings

App settings are environment variables that your application can read at runtime. These are useful for storing configuration values like API keys, database endpoints, and feature flags. They are scoped per App Service instance.


# Example of reading an app setting in Node.js
const apiKey = process.env.MY_API_KEY;
            

Connection Strings

Connection strings store the information needed to connect to external data sources, such as databases. They are also scoped per App Service instance and are masked in the Azure portal for security.


# Example of reading a connection string in Python (using a hypothetical library)
import os
db_connection_string = os.environ.get('DATABASE_URL')
            
Note: For sensitive information, consider using Azure Key Vault.

Custom Domains

Map your own domain names (e.g., www.yourcompany.com) to your App Service. This involves configuring DNS records with your domain registrar.

SSL/TLS Bindings

Secure your custom domain with an SSL/TLS certificate. App Services supports uploading your own certificates or purchasing certificates directly from Azure.

Application Insights

Application Insights is an extensible Application Performance Management (APM) service for developers. Use it to monitor your live web application, detect anomalies, diagnose issues, and understand how users interact with your app.

Diagnostic Logs

Configure diagnostic settings to send logs (application logs, web server logs, deployment logs, etc.) to various destinations, including Log Analytics, Azure Storage, or Event Hubs, for long-term storage and analysis.

Monitoring Metrics

Azure App Services provides a rich set of metrics that can be used for monitoring performance and health. These include requests, response times, CPU percentage, memory percentage, data in/out, and more.

Warning: Regularly monitor key metrics to proactively identify and address potential issues.

Virtual Network Integration

Connect your App Service to an Azure Virtual Network (VNet) to access resources within your private network securely. This is crucial for applications that need to interact with databases, storage accounts, or other services within a VNet.

Private Endpoints

Use private endpoints to securely access your App Service from within your virtual network without exposing it to the public internet. This enhances security by keeping traffic within the Azure backbone network.