nerdexam
Microsoft

AZ-204 · Question #640

Drag and Drop Question You have an on-premises datacenter and an Azure subscription that contains an Azure Application Insights instance. You plan to implement Azure Monitor Application Insights…

The correct answer is Install-PackageProvider with the Name parameter set to NuGet; Install-Module with the Name parameter set to PowerShellGet; Install-Module with the Name parameter set to Az.ApplicationMonitor; Enable-ApplicationInsightsMonitoring with the ConnectionString parameter set to the Application Insights ingestion endpoint. To automate Azure Monitor Application Insights Agent installation via PowerShell, you must follow a specific dependency chain: first install the NuGet package provider (Install-PackageProvider with NuGet) which is required to download modules from the PowerShell Gallery, then…

Submitted by diego_uy· Mar 30, 2026Implement an instrumentation strategy - specifically automating Azure Monitor Application Insights Agent deployment to on-premises servers using PowerShell, which falls under the AZ-400 DevOps / Azure Administrator monitoring and observability domain.

Question

Drag and Drop Question You have an on-premises datacenter and an Azure subscription that contains an Azure Application Insights instance. You plan to implement Azure Monitor Application Insights Agent to instrument web apps hosted on the on-premises servers. You need to automate the implementation by using PowerShell. Which four PowerShell cmdlets should you run in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. Answer:

Exhibit

AZ-204 question #640 exhibit

Answer Area

Drag items

Import-Module with the Name parameter set to Az.ApplicationMonitorInstall-PackageProvider with the Name parameter set to NuGetEnable-ApplicationInsightsMonitoring with the ConnectionString parameter set to the Application Insights ingestion endpointInstall-Module with the Name parameter set to Az.ApplicationMonitorInstall-Module with the Name parameter set to PowerShellGet

Correct arrangement

  • Install-PackageProvider with the Name parameter set to NuGet
  • Install-Module with the Name parameter set to PowerShellGet
  • Install-Module with the Name parameter set to Az.ApplicationMonitor
  • Enable-ApplicationInsightsMonitoring with the ConnectionString parameter set to the Application Insights ingestion endpoint

Explanation

To automate Azure Monitor Application Insights Agent installation via PowerShell, you must follow a specific dependency chain: first install the NuGet package provider (Install-PackageProvider with NuGet) which is required to download modules from the PowerShell Gallery, then install the Az.ApplicationMonitor module (Install-Module with Az.ApplicationMonitor), then import it into the session (Import-Module with Az.ApplicationMonitor), and finally enable monitoring (Enable-ApplicationInsightsMonitoring with the ConnectionString parameter pointing to the Application Insights ingestion endpoint). This sequence ensures all prerequisites are met before instrumentation is applied to the on-premises web apps.

Topics

#Azure Monitor#Application Insights#PowerShell Automation#On-Premises Monitoring

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice