Skip to main content

Triage and Remediation

Remediation

Using Console

Enabling Always On for App Services in Azure ensures that your web application is always running and responsive. Here are the steps to remediate this misconfiguration in Azure using the Azure console:
  1. Log in to the Azure portal (https://portal.azure.com/).
  2. Navigate to the App Service that needs to be remediated.
  3. Click on the “Configuration” blade on the left-hand side of the screen.
  4. Scroll down to the “General settings” section and locate the “Always On” setting.
  5. Toggle the switch next to “Always On” to the “On” position.
  6. Click “Save” to apply the changes.
  7. Restart the App Service to ensure that the changes take effect.
Once you have completed these steps, your App Service will be configured to use Always On, ensuring that it is always running and responsive.

To remediate the misconfiguration “Enable Always On for App Services” in Azure using Azure CLI, you can follow these steps:
  1. Open the Azure CLI command prompt.
  2. Run the following command to set the resource group where the App Service is deployed:
  1. Run the following command to enable Always On for the App Service:
  1. Verify that Always On is enabled for the App Service by running the following command:
This command should return a value of “true”, indicating that Always On is enabled for the App Service.By following these steps, you can remediate the misconfiguration “Enable Always On for App Services” in Azure using Azure CLI.
To remediate the misconfiguration “Enable Always On For App Services” in Azure using Python, follow these steps:
  1. Import the necessary libraries:
  1. Authenticate with Azure using the DefaultAzureCredential:
  1. Instantiate a WebSiteManagementClient object:
  1. Get the current configuration of the web app:
  1. Check if Always On is enabled:
  1. If Always On is not enabled, update the configuration:
The complete code to remediate the misconfiguration “Enable Always On For App Services” in Azure using Python would look like this:
Substitute:
  • APP_SERVICE_NAME with your App Service name.
  • RG_NAME with your existing azurerm_resource_group resource name.
  • APP_SERVICE_PLAN_NAME with your existing azurerm_service_plan resource name.
This change is in-place (no resource replacement); terraform plan should show an update to the existing App Service with site_config.always_on changing from false (or unset) to true.