Created
March 21, 2019 04:26
-
-
Save clarenceb/482c60e4edd1afc4d2f83891906edb8d to your computer and use it in GitHub Desktop.
Lab 5: Create release annotations to see impact of changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note: currently, release annotations only work with the classic metrics explorer. | |
# Guidance/Steps: | |
- Enable Application Insights for the prod web app | |
- Ensure the App Insights Instrumentation Key is correct in the web app Application Settings, set APPINSIGHTS_INSTRUMENTATIONKEY (to be extra safe, also add Keys:ApplicationInsights:InstrumentationKey with the same value since the code looks that setting up) | |
- Restart the web app (prod) and navigate to a few URLs in the web app, check that you can see metrics (server response time) appears in App Insights (prod) – reduce time scale to 30 mins | |
## Add release annotations | |
- See: https://docs.microsoft.com/en-us/azure/azure-monitor/app/annotations | |
- Edit the prod stage in the release pipeline | |
- Add a “Release Annotation” task after the deploy to azure app service task (you need to install the Release Annotations for Azure Application Insights” task from the marketplace the first time) | |
- In App Insights (prod), go to Configure / API Access and create a new API key. Note the key and Application ID somewhere (e.g. notepad) | |
- Add the Application ID and API Key to the Release Annotation task (the ApiKey can be a variable or put the literal value in the text box) | |
- Save changes and trigger a release (you can create a release from the last good artefact if you like) | |
- Reload the prod web app, visit some pages and verify the annotation appears (annotations only appear in classic explorer or workbooks) | |
- From App Insights (prod), click Investigate / Metrics / Classic Explorer | |
- Edit the chart (click “Edit” on far right) | |
- Select chart type: Area, Metrics: Server / Server response time | |
- Click “Time range” on top nav menu, set to “Last hour”, click Save favourite and enter a name (e.g. Release annotations) | |
- You should see the annotation and server response times (click the annotation to bring up more details) | |
- You can get back to this graph via the “Overview” link for App Insights, then click “Favourites” from the top nav bar | |
## Introduce a server delay: | |
- Go to repos, edit file: PartsUnlimited-aspnet45/src/PartsUnlimitedWebsite/Controllers/HomeController.cs | |
- In method public ActionResult Index(), add the code “System.Threading.Thread.Sleep(12000);” directly below the brace “{“. | |
- Commit change, track the build and result. | |
- Refresh the home page (click “Home”) of the prod app a few times to verify slowness | |
- Go back to your metrics explorer chart and you should see another release annotation and the server response time has gone up since that release (click Refresh link to update chart) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment