You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add `UseAzureMonitor()` to your application startup, located in your `program.cs` class:
175
175
176
176
```csharp
177
+
// Import the Azure.Monitor.OpenTelemetry.AspNetCore namespace.
177
178
usingAzure.Monitor.OpenTelemetry.AspNetCore;
179
+
178
180
varbuilder=WebApplication.CreateBuilder(args);
179
181
180
182
// Add OpenTelemetry and configure it to use Azure Monitor.
@@ -283,6 +285,9 @@ To copy the connection string:
283
285
284
286
To paste your connection string, select from the following options:
285
287
288
+
> [!NOTE]
289
+
> We recommend setting the connection string through code only in local development and test environments. For production, use an environment variable or configuration file (Java only).
290
+
286
291
* Set via environment variable
287
292
288
293
Replace `<Your connection string>` in the following command with *your* unique connection string.
@@ -303,14 +308,15 @@ To paste your connection string, select from the following options:
303
308
304
309
Replace `<Your connection string>` in the preceding JSON with *your* unique connection string.
305
310
306
-
<!-- Violates MSFT security guidelines
307
-
C. Set via Code - ASP.NET Core, Node.js, and Python Only (Not recommended)
311
+
* Set via code - ***ASP.NET Core, Node.js, and Python only***
308
312
309
-
See [connection string configuration](opentelemetry-configuration.md#connection-string) for an example of setting connection string via code.
310
-
-->
313
+
See [connection string configuration](opentelemetry-configuration.md#connection-string) for an example of setting connection string via code.
311
314
312
315
> [!NOTE]
313
-
> If you set the connection string in multiple places, the environment variable will be prioritized over the configuration file.
316
+
> If you set the connection string in multiple places, the environment variable will be prioritized in the following order:
0 commit comments