microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.51k stars 2.62k forks source link

[FEATURE] Add support for `ApplicationInsights:InstrumentationKey` app setting when creating release annotations #14961

Open ChristopherHaws opened 3 years ago

ChristopherHaws commented 3 years ago

Required Information

Question, Bug, or Feature?
Type: Feature Enter Task Name: Common/AzureRmDeploy-common

Environment

Issue Description

Recently the ReleaseAnnotations task was deprecated due to the release annotations now being created automatically when using an AppService deployment task. The current implementation looks for the APPINSIGHTS_INSTRUMENTATIONKEY app setting/environment variable, however in the Application Insights documentation, they also list ApplicationInsights:InstrumentationKey as a valid configuration which is how we configured our application (since we configure application insights in code and not using the app service extension.

It would be helpful if the ReleaseAnnotationUtility could be updated to look for either of those app settings when attempting to create the release annotation. https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/Common/AzureRmDeploy-common/operations/ReleaseAnnotationUtility.ts#L11

Side note, I created a PR for updating the docs to make the behavior more clear. If this change happens, it should also be updated in the docs: https://github.com/MicrosoftDocs/azure-docs/pull/76698

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

ChristopherHaws commented 2 years ago

This is still valid, commenting to prevent the issue from closing.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

ChristopherHaws commented 2 years ago

This is still valid, commenting to prevent the issue from closing.

ChristopherHaws commented 2 years ago

Now the recommended way to configure app insights is via the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable (ApplicationInsights:ConnectionString app setting) which contains the instrumentation (InstrumentationKey=[INSTRUMENTATION KEY]; so this should be supported as well. (see https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core?tabs=netcore6#enable-application-insights-server-side-telemetry-no-visual-studio)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

ChristopherHaws commented 1 year ago

This is still valid, commenting to prevent the issue from closing.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

ChristopherHaws commented 1 year ago

This is still valid, commenting to prevent the issue from closing.

eric-gonzalez-tfs commented 1 year ago

This is still valid, commenting to prevent the issue from closing.

We will want to be able to set a Connection String since Instrumentation Keys are being deprecated.