Skip to content

[#2562] Fix app insights wiring with connection string - #2563

Open
Matthias Raschhofer (rascmatt) wants to merge 1 commit into
microsoft:developfrom
rascmatt:fix/2562-ai-conn-str
Open

[#2562] Fix app insights wiring with connection string#2563
Matthias Raschhofer (rascmatt) wants to merge 1 commit into
microsoft:developfrom
rascmatt:fix/2562-ai-conn-str

Conversation

@rascmatt

@rascmatt Matthias Raschhofer (rascmatt) commented Jul 16, 2026

Copy link
Copy Markdown

What does this implement/fix? Explain your changes.

This PR adds support for Application Insights Connection Strings in the Azure Functions Maven plugin. It addresses the fact that Instrumentation Keys have been deprecated a while ago: https://azure.microsoft.com/en-gb/updates?id=technical-support-for-instrumentation-key-based-global-ingestion-in-application-insights-will-end-on-31-march-2025

Main changes:

  • Added a new config option: appInsightsConnectionString.
  • Wired it through parsing/config (AbstractFunctionMojo -> ConfigParser -> FunctionAppConfig / ApplicationInsightsConfig).
  • Updated Function App create/update/slot flows to handle APPLICATIONINSIGHTS_CONNECTION_STRING.
  • Kept appInsightsKey support for backward compatibility, but prefer connection string when available.
  • Added validation so users cannot set both appInsightsKey and appInsightsConnectionString explicitly.
  • Improved redeploy behavior: if neither key nor connection string is explicitly configured, only the insights instance, deployment can resolve App Insights and migrate to connection-string based wiring.

Does this close any currently open issues?

Closes #2562

Any relevant logs, screenshots, error output, etc.?

no

Any other comments?

Goal here was to improve default behavior for new and redeployed apps without breaking existing users who still rely on appInsightsKey.

Has this been tested?

  • Tests in this PR
  • Actual deployment to Azure Cloud

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

- add the option to explicitly pass the connection string
  for the connected AI instance

- on create initialize app settings with the connection string

- for existing functions, auto-migrate to connection string
  if ai-instance is configured, but no explicit ikey/constr are set
@rascmatt

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Flanker32
Hanxiao Liu (Flanker32) requested review from Hanxiao Liu (Flanker32) and a balanced review from Copilot and removed request for Copilot August 28, 2026 08:37
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

Successfully merging this pull request may close these issues.

Azure Functions Maven plugin auto-configures deprecated App Insights instrumentation key setup

1 participant