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

App Insights is not turned on by default #2023

Open
potashkeren opened this issue Oct 6, 2024 · 1 comment
Open

App Insights is not turned on by default #2023

potashkeren opened this issue Oct 6, 2024 · 1 comment
Assignees

Comments

@potashkeren
Copy link

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Application Insights is not enabled by default, even though AZURE_USE_APPLICATION_INSIGHTS is set to true.
After deploying the app and checking Application Insights under the web app resource in the Azure portal, I noticed that Application Insights is not enabled, no Application Insights resource was created automatically, and the web app was not connected to it.
I see this page:
image

To ensure that Application Insights is enabled as part of the deployment process using Bicep, we need to add the one property in the appservice.bicep file under the resource configAppSettings:

ApplicationInsightsAgent_EXTENSION_VERSION: '~2' 

The final code should look like this after adding the line above:

  resource configAppSettings 'config' = {
    name: 'appsettings'
    properties: union(appSettings,
      {
        SCM_DO_BUILD_DURING_DEPLOYMENT: string(scmDoBuildDuringDeployment)
        ENABLE_ORYX_BUILD: string(enableOryxBuild)
        ApplicationInsightsAgent_EXTENSION_VERSION: '~2'
      },
      runtimeName == 'python' ? { PYTHON_ENABLE_GUNICORN_MULTIWORKERS: 'true' } : {},
      !empty(applicationInsightsName) ? { APPLICATIONINSIGHTS_CONNECTION_STRING: applicationInsights.properties.ConnectionString } : {},
      !empty(keyVaultName) ? { AZURE_KEY_VAULT_ENDPOINT: keyVault.properties.vaultUri } : {})
  }

Thanks for your help!

Any log messages given by the failure

None

Expected/desired behavior

Application Insights is enabled by default.

OS and Version?

Debian GNU/Linux 12 (bookworm)

azd version?

1.10.1 (commit 31409a33266fb4a5fdbb644bc83988e725d6c7c9)

Mention any other details that might be useful


Thanks! We'll be in touch soon.

@pamelafox pamelafox self-assigned this Oct 17, 2024
@pamelafox
Copy link
Collaborator

I checked with the App Service team and they confirmed the need for the env var as well. It's documented here:
https://learn.microsoft.com/en-us/azure/azure-monitor/app/codeless-app-service?tabs=python#automate-monitoring

If you want to send a PR for the change, I'm happy to review. Otherwise I'll make the PR when I'm able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants