An offline data processing utility is written in C# and runs on an Azure Linux VM. You configure telemetry by writing the following code block to log lifecycle events:
csharp
var configuration = new TelemetryConfiguration();
var client = new TelemetryClient(configuration);
client.TrackEvent("JobStarted");
During testing, you notice that no events are captured in the Application Insights logs. You must update the code to ensure telemetry is transmitted correctly.
Which TWO actions should you take to resolve this issue? (Select TWO.)
- Initialize the telemetry configuration object using TelemetryConfiguration.CreateDefault() instead of new TelemetryConfiguration().Cevap
- Configure the Application Insights connection string by assigning it to the ConnectionString property of the TelemetryConfiguration instance.Cevap
- CAssign the instrumentation key directly to the deprecated InstrumentationKey property of the TelemetryConfiguration instance.
- DRetrieve the connection string from Azure Key Vault and configure the VM's user-assigned managed identity with only Key Vault decrypt permissions.
Cevap
Initialize the telemetry configuration object using TelemetryConfiguration.CreateDefault() and configure the Application Insights connection string by assigning it to the ConnectionString property of the TelemetryConfiguration instance.
To manually configure the Application Insights SDK in a non-web application, you must use TelemetryConfiguration.CreateDefault() to build the default telemetry pipeline, including the channel and default processors. Additionally, you must specify the ConnectionString of the Application Insights resource so the SDK knows where to send the telemetry.
Adım Adım Çözüm
Anahtar Kavram
Manual initialization of Application Insights SDK using TelemetryConfiguration and TelemetryClient in non-web environments.
Tahmini Süre:1m 30s