|
| 1 | +--- |
| 2 | +title: Track a web app outage using Change Analysis |
| 3 | +description: Learn how to identify the root cause of a web app outage using Azure Monitor Change Analysis. |
| 4 | +ms.topic: tutorial |
| 5 | +ms.author: hannahhunter |
| 6 | +author: hhunter-ms |
| 7 | +ms.contributor: cawa |
| 8 | +ms.reviewer: cawa |
| 9 | +ms.date: 05/09/2022 |
| 10 | +ms.subservice: change-analysis |
| 11 | +ms.custom: devx-track-azurepowershell |
| 12 | +--- |
| 13 | + |
| 14 | +# Track a web app outage using Change Analysis |
| 15 | + |
| 16 | +When issues happen, one of the first things to check is what changed in application, configuration and resources to triage and root cause issues. Change Analysis provides a centralized view of the changes in your subscriptions for up to the past 14 days to provide the history of changes for troubleshooting issues. |
| 17 | + |
| 18 | +In this tutorial, you learn how to: |
| 19 | + |
| 20 | +> [!div class="checklist"] |
| 21 | +> * Enable Change Analysis to track changes for Azure resources and for Azure Web App configurations |
| 22 | +> * Troubleshoot a Web App issue using Change Analysis |
| 23 | +
|
| 24 | +## Pre-requisites |
| 25 | + |
| 26 | +An Azure Web App with a Storage account dependency. Follow instructions at [ChangeAnalysis-webapp-storage-sample](https://github.com/Azure-Samples/changeanalysis-webapp-storage-sample) if you haven't already deployed one. |
| 27 | + |
| 28 | +## Enable Change Analysis |
| 29 | + |
| 30 | +In the Azure portal, navigate to theChange Analysis service home page. |
| 31 | + |
| 32 | +If this is your first time using Change Analysis service, the page may take up to a few minutes to register the `Microsoft.ChangeAnalysis` resource provider in your selected subscriptions. |
| 33 | + |
| 34 | +:::image type="content" source="./media/change-analysis/change-analysis-blade.png" alt-text="Screenshot of Change Analysis in Azure portal."::: |
| 35 | + |
| 36 | +Once the Change Analysis page loads, you can see resource changes in your subscriptions. To view detailed web app in-guest change data: |
| 37 | + |
| 38 | +- Select **Enable now** from the banner, or |
| 39 | +- Select **Configure** from the top menu. |
| 40 | + |
| 41 | +In the web app in-guest enablement pane, select the web app you'd like to enable: |
| 42 | + |
| 43 | +:::image type="content" source="./media/change-analysis/enablement-pane.png" alt-text="Screenshot of Change Analysis enablement pane."::: |
| 44 | + |
| 45 | +Now Change Analysis is fully enabled to track both resources and web app in-guest changes. |
| 46 | + |
| 47 | +## Simulate a web app outage |
| 48 | + |
| 49 | +In a typical team environment, multiple developers can work on the same application without notifying the other developers. Simulate this scenario and make a change to the web app setting: |
| 50 | + |
| 51 | +```azurecli |
| 52 | +az webapp config appsettings set -g {resourcegroup_name} -n {webapp_name} --settings AzureStorageConnection=WRONG_CONNECTION_STRING |
| 53 | +``` |
| 54 | + |
| 55 | +Visit the web app URL to view the following error: |
| 56 | + |
| 57 | +:::image type="content" source="./media/change-analysis/outage-example.png" alt-text="Screenshot of simulated web app outage."::: |
| 58 | + |
| 59 | +## Troubleshoot the outage using Change Analysis |
| 60 | + |
| 61 | +In the Azure portal, navigate to the Change Analysis overview page. Since you've triggered a web app outage, you'll see an entry of change for `AzureStorageConnection`: |
| 62 | + |
| 63 | +:::image type="content" source="./media/change-analysis/entry-of-outage.png" alt-text="Screenshot of outage entry on the Change Analysis pane."::: |
| 64 | + |
| 65 | +Since the connection string is a secret value, we hide this on the overview page for security purposes. With sufficient permission to read the web app, you can select the change to view details around the old and new values: |
| 66 | + |
| 67 | +:::image type="content" source="./media/change-analysis/view-change-details.png" alt-text="Screenshot of viewing change details for troubleshooting."::: |
| 68 | + |
| 69 | +The change details blade also shows important information, including who made the change. |
| 70 | + |
| 71 | +Now that you've discovered the web app in-guest change and understand next steps, you can proceed with troubleshooting the issue. |
| 72 | + |
| 73 | +## Next steps |
| 74 | + |
| 75 | +Learn more about [Change Analysis](./change-analysis.md). |
0 commit comments