Track a web app outage using Change Analysis
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.
To track an outage, we will:
- Clone, create, and deploy a sample web application with a storage account.
- Enable Change Analysis to track changes for Azure resources and for Azure Web App configurations
- Troubleshoot a Web App issue using Change Analysis
Pre-requisites
- Install .NET 7.0 or above.
- Install the Azure CLI.
Set up the test application
Clone
- In your preferred terminal, log in to your Azure subscription.
az login
az account set --s {azure-subscription-id}
git clone https://github.com/Azure-Samples/changeanalysis-webapp-storage-sample.git
- Change the working directory to the project folder.
cd changeanalysis-webapp-storage-sample
Run the PowerShell script
Open
Publish-WebApp.ps1
.Edit the
SUBSCRIPTION_ID
andLOCATION
environment variables.Environment variable Description SUBSCRIPTION_ID
Your Azure subscription ID. LOCATION
The location of the resource group where you'd like to deploy the sample application. Run the script from the
./changeanalysis-webapp-storage-sample
directory.
./Publish-WebApp.ps1
Enable Change Analysis
In the Azure portal, navigate to the Change Analysis standalone UI. Page loading may take a few minutes as the Microsoft.ChangeAnalysis
resource provider is registered.
Once the Change Analysis page loads, you can see resource changes in your subscriptions. To view detailed web app in-guest change data:
- Select Enable now from the banner, or
- Select Configure from the top menu.
In the web app in-guest enablement pane, select the web app you'd like to enable:
Now Change Analysis is fully enabled to track both resources and web app in-guest changes.
Simulate a web app outage
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:
az webapp config appsettings set -g {resourcegroup_name} -n {webapp_name} --settings AzureStorageConnection=WRONG_CONNECTION_STRING
Visit the web app URL to view the following error:
Troubleshoot the outage using Change Analysis
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
:
Since the connection string is a secret value, we hide it 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:
The change details pane also shows important information, including who made the change.
Now that you've discovered the web app in-guest change and understand next steps, you can proceed with troubleshooting the issue.
Virtual network changes
Knowing what changed in your application's networking resources is critical due to their effect on connectivity, availability, and performance. Change Analysis supports all network resource changes and captures those changes immediately. Networking changes include:
- Firewalls created or edited
- Network critical changes (for example, blocking port 22 for TCP connections)
- Load balancer changes
- Virtual network changes
The sample application includes a virtual network to make sure the application remains secure. Via the Azure portal, you can view and assess the network changes captured by Change Analysis.
Next steps
Learn more about Change Analysis.
Feedback
Submit and view feedback for