Azure

Configuration in Azure App Service

App Service provides a flexible configuration model that lets you manage settings, connection strings, and environment variables directly from the Azure portal, CLI, or ARM templates.

Application Settings

Application settings are stored as key/value pairs and are injected into your app as environment variables at runtime. They override any settings defined in your code.

{
  "properties": {
    "appSettings": [
      {
        "name": "WEBSITE_NODE_DEFAULT_VERSION",
        "value": "18.17.0"
      },
      {
        "name": "CUSTOM_CONNECTION_STRING",
        "value": "Server=myServer;Database=myDb;User Id=myUser;Password=myPass;"
      }
    ]
  }
}

Connection Strings

Store database connection strings securely and reference them in your code using standard environment variable names.

{
  "properties": {
    "connectionStrings": [
      {
        "name": "MyDb",
        "connectionString": "Server=tcp:myserver.database.windows.net,1433;Initial Catalog=mydb;User Id=myuser;Password=mypassword;",
        "type": "SQLAzure"
      }
    ]
  }
}

Runtime Stack

Select the runtime stack (Node, .NET, Java, PHP, Python, Ruby) that matches your application. You can change it without redeploying.

Scaling Settings

Configure auto-scale rules based on CPU, memory, or custom metrics.

{
  "sku": {
    "name": "S1",
    "tier": "Standard",
    "capacity": 2
  }
}

Advanced Settings

Enable HTTP/2, configure always-on, and set custom domains in the Settings section.

Resources