Skip to content

Commit 2bf443a

Browse files
authored
Merge pull request #47813 from Mikhail-msft/patch-2
Update azure-web-apps.md to show how to use the connection strings
2 parents fe65bd5 + 4d6623a commit 2bf443a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

articles/azure-monitor/app/azure-web-apps.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ In order to enable telemetry collection with Application Insights, only the Appl
169169
|ApplicationInsightsAgent_EXTENSION_VERSION | Main extension, which controls runtime monitoring. | `~2` |
170170
|XDT_MicrosoftApplicationInsights_Mode | In default mode only, essential features are enabled in order to insure optimal performance. | `default` or `recommended`. |
171171
|InstrumentationEngine_EXTENSION_VERSION | Controls if the binary-rewrite engine `InstrumentationEngine` will be turned on. This setting has performance implications and impacts cold start/startup time. | `~1` |
172-
|XDT_MicrosoftApplicationInsights_BaseExtensions | Controls if SQL & Azure table text will be captured along with the dependency calls. Performance warning: this setting requires the `InstrumentationEngine`. | `~1` |
172+
|XDT_MicrosoftApplicationInsights_BaseExtensions | Controls if SQL & Azure table text will be captured along with the dependency calls. Performance warning: application cold start up time will be affected. This setting requires the `InstrumentationEngine`. | `~1` |
173173

174174
### App Service Application settings with Azure Resource Manager
175175

@@ -226,6 +226,10 @@ Below is a sample, replace all instances of `AppMonitoredSite` with your site n
226226
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
227227
"value": "[reference('microsoft.insights/components/AppMonitoredSite', '2015-05-01').InstrumentationKey]"
228228
},
229+
{
230+
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
231+
"value": "[reference('microsoft.insights/components/AppMonitoredSite', '2015-05-01').ConnectionString]"
232+
},
229233
{
230234
"name": "ApplicationInsightsAgent_EXTENSION_VERSION",
231235
"value": "~2"
@@ -304,9 +308,6 @@ Below is a sample, replace all instances of `AppMonitoredSite` with your site n
304308
}
305309
```
306310

307-
> [!NOTE]
308-
> The template will generate application settings in “default” mode. This mode is performance optimized, though you can modify the template to activate whichever features you prefer.
309-
310311
### Enabling through PowerShell
311312

312313
In order to enable the application monitoring through PowerShell, only the underlying application settings need to be changed. Below is a sample, which enables application monitoring for a website called "AppMonitoredSite" in the resource group "AppMonitoredRG", and configures data to be sent to the "012345678-abcd-ef01-2345-6789abcd" instrumentation key.
@@ -316,8 +317,9 @@ In order to enable the application monitoring through PowerShell, only the under
316317
```powershell
317318
$app = Get-AzWebApp -ResourceGroupName "AppMonitoredRG" -Name "AppMonitoredSite" -ErrorAction Stop
318319
$newAppSettings = @{} # case-insensitive hash map
319-
$app.SiteConfig.AppSettings | %{$newAppSettings[$_.Name] = $_.Value} #preserve non Application Insights Application settings.
320-
$newAppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"] = "012345678-abcd-ef01-2345-6789abcd"; # enable the ApplicationInsightsAgent
320+
$app.SiteConfig.AppSettings | %{$newAppSettings[$_.Name] = $_.Value} # preserve non Application Insights application settings.
321+
$newAppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"] = "012345678-abcd-ef01-2345-6789abcd"; # set the Application Insights instrumentation key
322+
$newAppSettings["APPLICATIONINSIGHTS_CONNECTION_STRING"] = "InstrumentationKey=012345678-abcd-ef01-2345-6789abcd"; # set the Application Insights connection string
321323
$newAppSettings["ApplicationInsightsAgent_EXTENSION_VERSION"] = "~2"; # enable the ApplicationInsightsAgent
322324
$app = Set-AzWebApp -AppSettings $newAppSettings -ResourceGroupName $app.ResourceGroup -Name $app.Name -ErrorAction Stop
323325
```
@@ -366,7 +368,7 @@ Below is our step-by-step troubleshooting guide for extension/agent based monito
366368
* If a similar value is not present, it means the application is not currently running or is not supported. To ensure that the application is running, try manually visiting the application url/application endpoints, which will allow the runtime information to become available.
367369

368370
* Confirm that `IKeyExists` is `true`
369-
* If it is false, add `APPINSIGHTS_INSTRUMENTATIONKEY with your ikey guid to your application settings.
371+
* If it is `false`, add `APPINSIGHTS_INSTRUMENTATIONKEY` and `APPLICATIONINSIGHTS_CONNECTION_STRING` with your ikey guid to your application settings.
370372

371373
* Confirm that there are no entries for `AppAlreadyInstrumented`, `AppContainsDiagnosticSourceAssembly`, and `AppContainsAspNetTelemetryCorrelationAssembly`.
372374
* If any of these entries exist, remove the following packages from your application: `Microsoft.ApplicationInsights`, `System.Diagnostics.DiagnosticSource`, and `Microsoft.AspNet.TelemetryCorrelation`.

0 commit comments

Comments
 (0)