Help with installing Azure monitor client on Windows 10 devices

Robert D. Crane 46 Reputation points MVP
2023-08-01T04:22:16.7266667+00:00

I have followed the documentation on install the client on Windows devices here:

https://learn.microsoft.com/EN-us/azure/azure-monitor/agents/azure-monitor-agent-windows-client

all goes well until I have to run the PowerShell onboarding script:

https://learn.microsoft.com/EN-us/azure/azure-monitor/agents/azure-monitor-agent-windows-client#using-powershell-for-onboarding

I have updated my PowerShell modules. I'm running as a Global admin on device. I get errors like:
Image

Anyone have any troubleshooting tips for getting this working?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sedat SALMAN 14,280 Reputation points MVP Volunteer Moderator
    2023-08-01T06:43:28.19+00:00

    can you check the available modules for you

    Get-Module -ListAvailable -Name Az.Accounts
    

    and also the version

    Get-Module -ListAvailable -Name Az.Accounts
    

    Get-AzAccessToken is available in Az.Accounts module version 2.2.0 or later

    if it is old please update your module

    Update-Module -Name Az.Accounts
    

    also try to import module manually

    Import-Module Az.Accounts
    

  2. Robert D. Crane 46 Reputation points MVP
    2023-08-01T06:54:03.8966667+00:00

    User's image


  3. AnuragSingh-MSFT 21,566 Reputation points Moderator
    2023-08-08T04:27:33.71+00:00

    @Robert D. Crane , Apologies for the inconvenience.

    Based on the question and discussion so far, it seems that there are multiple potential issues:

    1. Conflict caused due to version of Az.* powershell modules installed.
    2. The $PATH environment variable not getting resolved correctly.

    Also, from the screenshot, I can see that there are multiple versions installed on this machine.

    I would suggest doing an uninstall of the Az.* module using the steps mentioned in the link here - Uninstall Azure PowerShell Module

    This will serve mainly 2 purposes - remove conflicting modules (if any) and set the environment correctly for the module to be loaded and used.

    Hope this helps. Please let us know if you have any questions.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.