Configuring Azure App Services

This document provides detailed information on configuring your Azure App Service to meet your application's specific requirements.

Application Settings

Application settings are key-value pairs that define the environment for your application. These are accessible via environment variables within your running application.

  • Connection Strings: Store database or other service connection information securely.
  • App Settings: General key-value pairs for your application's configuration.

You can manage these settings directly through the Azure portal, Azure CLI, or programmatically using Azure SDKs.

az webapp config appsettings set --resource-group MyResourceGroup --name MyApp --settings MY_SETTING="myValue" ANOTHER_SETTING="anotherValue"

General Settings

These settings control fundamental aspects of your App Service, including the runtime stack, platform, and web sockets.

  • Runtime Stack: Select the programming language and version (e.g., Node.js 18 LTS, Python 3.10, .NET 7).
  • Platform: Choose between 32-bit or 64-bit operating systems.
  • Web Sockets: Enable or disable support for real-time bidirectional communication.
  • Always On: Keep your application loaded and ready to respond to requests, preventing cold starts.
  • Managed Identity: Configure managed identities for your app to securely access other Azure services.

Authentication and Authorization

Secure your App Service by integrating with identity providers and defining access policies.

  • Provider Integration: Configure authentication with Azure Active Directory, Google, Facebook, Microsoft Account, or Twitter.
  • Unauthenticated requests: Define how unauthenticated requests should be handled (e.g., redirect to login, allow anonymous access).
  • Authorization: Implement role-based access control (RBAC) or custom authorization logic.

Note: For more robust authentication, consider using Azure AD B2C or Azure Key Vault for managing secrets.

Custom Domains and TLS/SSL Settings

Map custom domain names to your App Service and secure your site with TLS/SSL certificates.

  • Add Custom Domain: Associate your own domain name (e.g., www.example.com) with your App Service.
  • TLS/SSL Certificates: Upload your own certificates or purchase App Service Managed Certificates.
  • TLS/SSL Bindings: Securely bind certificates to your custom domains.
  • Enforce HTTPS: Ensure all traffic to your application is over HTTPS.

Tip: Always enforce HTTPS to protect your users' data and improve SEO rankings.

Path Mappings

Configure how requests to different URL paths are handled, including mapping to specific application directories or virtual applications.

  • Virtual Applications: Map sub-paths of your App Service URL to different application directories.
  • Path Overrides: Define custom handling for specific URL patterns.

Background Jobs

Configure scheduled tasks or background processes for your application.

  • WebJobs: Learn how to integrate and manage background tasks that run alongside your web app.
  • Triggers: Set up triggers for your background jobs (e.g., schedule-based, queue-based).

Deployment Slots

Use deployment slots to manage different versions of your application in production environments.

  • Create Slots: Set up staging, testing, or production slots.
  • Swap Slots: Easily swap slots with zero downtime.
  • Configuration: Configure settings specific to each slot.

Warning: Ensure you thoroughly test applications in staging slots before swapping to production.