Skip to content

Connect Appservice to application insights in a different resource group #2641

Answered by brwilkinson
sreejaptfa asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sreejaptfa Here are the docs for the Application insights.

https://docs.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps?tabs=net#automate-the-creation-of-an-application-insights-resource-and-link-to-your-newly-created-app-service

As you can see you can pass in the reference to the AppInsights via the AppSettings on the site.

There are a few different syntaxes that you could use.

example 1 - very similar to ARM/json style, just in bicep.

var appInsightsName = 'myAppInsights'
var appInsightsID = resourceId('otherRG','Microsoft.insights/components/', appInsightsName)

...

    siteConfig: {
      appSettings: [
        {
          name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
          

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by brwilkinson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants