Skip to content

Commit ec50db8

Browse files
committed
Document configuring the connection string at runtime
1 parent 706ec8d commit ec50db8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

articles/azure-monitor/app/java-standalone-config.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,34 @@ Cloud role name overrides allow you to override the [default cloud role name](#c
323323
}
324324
```
325325

326+
## Connection string configured at runtime
327+
328+
Starting from version 3.4.8, if you need the ability to configure the connection string at runtime,
329+
add this property to your json configuration:
330+
331+
```json
332+
{
333+
"connectionStringConfiguredAtRuntime": true
334+
}
335+
```
336+
337+
and add `applicationinsights-core` to your application:
338+
339+
```xml
340+
<dependency>
341+
<groupId>com.microsoft.azure</groupId>
342+
<artifactId>applicationinsights-core</artifactId>
343+
<version>3.4.8</version>
344+
</dependency>
345+
```
346+
347+
and use the static `configure(String)` method in the class
348+
`com.microsoft.applicationinsights.connectionstring.ConnectionString`.
349+
350+
> [!NOTE]
351+
> Any telemetry that is captured prior to configuring the connection string will be dropped,
352+
> so it is best to configure it as early as possible in your application startup.
353+
326354
## Autocollect InProc dependencies (preview)
327355

328356
Starting from version 3.2.0, if you want to capture controller "InProc" dependencies, use the following configuration:

0 commit comments

Comments
 (0)