Skip to Content

Microsoft AZ-400: Which file should modify to monitor Azure Pipelines app using Application Insights instance

Question

You use Azure Pipelines to build and deploy an app named App1. You plan to monitor App1 by using Application Insights. You create an Application Insights instance named AI1. You need to configure App1 to use AI1. Which file should you modify?

A. appsettings.json
B. launchSettings.json
C. startup.cs
D. project.json

Answer

A. appsettings.json

Explanation

The correct answer is A. appsettings.json.

Here is a detailed explanation:

  • To configure an ASP.NET Core application to use Application Insights, you need to add the Application Insights connection string to the appsettings.json file. The connection string contains the instrumentation key and other optional parameters that identify the Application Insights resource.
  • The appsettings.json file is used to store various configuration settings for an ASP.NET Core application, such as logging, connection strings, and app settings. You can modify this file to change the behavior of your application at runtime.
  • The launchSettings.json file is used to store the launch profiles for an ASP.NET Core application, such as the environment variables, launch URL, and launch browser. This file is only used by Visual Studio and does not affect the application when it is deployed.
  • The startup.cs file is used to configure the services and middleware for an ASP.NET Core application, such as dependency injection, routing, authentication, and authorization. You can modify this file to change how your application handles requests and responses.
  • The project.json file was used in previous versions of ASP.NET Core to store the project metadata, such as dependencies, frameworks, tools, and scripts. This file has been replaced by the .csproj file since ASP.NET Core 1.1.

Therefore, to configure App1 to use AI1, you should modify the appsettings.json file and add the Application Insights connection string.

Reference

Designing and Implementing Microsoft DevOps Solutions AZ-400 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Designing and Implementing Microsoft DevOps Solutions AZ-400 exam and earn Designing and Implementing Microsoft DevOps Solutions AZ-400 certification.