Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to turn on App Insights in a Web App through Azure CLI #30030

Open
JaimeStill opened this issue Oct 4, 2024 · 3 comments
Open

No way to turn on App Insights in a Web App through Azure CLI #30030

JaimeStill opened this issue Oct 4, 2024 · 3 comments
Assignees
Labels
app-service-general Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor az monitor question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Similar-Issue Web Apps az webapp

Comments

@JaimeStill
Copy link

Describe the bug

az monitor app-insights component connect-webapp is used to link a web app to an app insights instance. However, as far as I have been able to find, there is not an automated way of turning on app insights in the web app as you can on the Azure Portal:

image

Related command

az monitor app-insights component connect-webapp

Errors

There are no errors associated, just missing functionality.

Issue script & Debug output

Currently configuring Azure Monitor as follows:

# create log analytics workspace
az monitor log-analytics workspace create `
    --name $LogWorkspace `
    --resource-group $ResourceGroup

# create app insights
az monitor app-insights component create `
    --app $AppInsights `
    --location $Location `
    --resource-group $ResourceGroup `
    --workspace $LogWorkspace

# connect webapp to app insights
az monitor app-insights component connect-webapp `
    --app $AppInsights `
    --web-app $AppName `
    --resource-group $ResourceGroup

I have tried using az webapp config appsettings to compare the webapp configuration before and after turning on Application Insights.

Adjusting the following configuration values seemed to turn on app insights, but it was not actually receiving telemetry data from my deployed web app:

az webapp config appsettings set `
    --name $AppName `
    --resource-group $ResourceGroup `
    --settings `
    ApplicationInsightsAgent_EXTENSION_VERSION=~3 `
    XDT_MicrosoftApplicationInsights_Mode=recommended `
    APPINSIGHTS_PROFILERFEATURE_VERSION=1.0.0 `
    DiagnosticServices_EXTENSION_VERSION=~3 `
    APPINSIGHTS_SNAPSHOTFEATURE_VERSION=1.0.0

Expected behavior

One of the following two scenarios:

  1. When executing az monitor app-insights component connect-webapp, this should subsequently turn on Application Insights if it is not currently.

  2. An az webapp sub-command should allow you to explicitly turn on / off application insights.

Environment Summary

azure-cli                         2.64.0

core                              2.64.0
telemetry                          1.1.0

Extensions:
application-insights               1.2.2

Dependencies:
msal                              1.30.0
azure-mgmt-resource               23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/home/jaime/.azure/cliextensions'

Python (Linux) 3.11.8 (main, Aug 28 2024, 05:45:18) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

@JaimeStill JaimeStill added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 4, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 4, 2024

Thank you for opening this issue, we will look into it.

Copy link

github-actions bot commented Oct 4, 2024

Here are some similar issues that might help you. Please check if they can solve your problem.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Web Apps az webapp Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot Monitor az monitor labels Oct 4, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that app-service-general labels Oct 4, 2024
@JaimeStill
Copy link
Author

Here are some similar issues that might help you. Please check if they can solve your problem.

* ["az functionapp create --app-insights" doesn't link Application Insights #15176](https://github.com/Azure/azure-cli/issues/15176)

These are separate issues. In my case, app insights is linked to the specified web app. There is just no way to turn on application insights through the Azure CLI after they are connected.

@yonzhan yonzhan removed bug This issue requires a change to an existing behavior in the product in order to be resolved. Azure CLI Team The command of the issue is owned by Azure CLI team labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-service-general Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor az monitor question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. Similar-Issue Web Apps az webapp
Projects
None yet
Development

No branches or pull requests

4 participants