Skip to content

Commit fda812c

Browse files
authored
Merge pull request #106412 from TimothyMothra/patch-1
Update asp-net-core.md
2 parents b3fba0f + d57827b commit fda812c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

articles/azure-monitor/app/asp-net-core.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ The preceding steps are enough to help you start collecting server-side telemetr
155155
@Html.Raw(JavaScriptSnippet.FullScript)
156156
</head>
157157
```
158+
159+
Alternatively to using the `FullScript` the `ScriptBody` is available starting in SDK v2.14. Use this if you need to control the `<script>` tag to set a Content Security Policy:
160+
161+
```cshtml
162+
<script> // apply custom changes to this script tag.
163+
@Html.Raw(JavaScriptSnippet.ScriptBody)
164+
</script>
165+
```
158166

159167
The `.cshtml` file names referenced earlier are from a default MVC application template. Ultimately, if you want to properly enable client-side monitoring for your application, the JavaScript snippet must appear in the `<head>` section of each page of your application that you want to monitor. You can accomplish this goal for this application template by adding the JavaScript snippet to `_Layout.cshtml`.
160168

0 commit comments

Comments
 (0)