event though azresource graph module installed giving error search-azgraph is not recognized

Varma 1,230 Reputation points
2024-05-09T17:24:11.8966667+00:00

event though azresource graph module installed giving error search-azgraph is not recognized,

I have used below commands but still did not work

Get-Module -Name PowerShellGet

Install-Module -Name Az.ResourceGraph -Repository PSGallery -Scope CurrentUser

Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
258 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 19,396 Reputation points Microsoft Employee
    2024-05-20T05:39:59.26+00:00

    @Varma Thanks for your patience and time over the call. 

    I attempted to run the shared script in my environment through the release pipeline. Despite making several changes and attempts, I was only able to install the latest module (v0.13.1) and list the commands of the Az.ResourceGraph module. However, I was unable to find the Search-AzGraph cmdlet from the listed cmdlets, and the pipeline failed with the following error.

    A screen shot of a computerDescription automatically generated

    Based on the error message it seems like an issue with azure devops pipeline end. As Azure Devops is not supported in Microsoft Q&A forum. I would suggest you try raise/report your problem in the devops forum here.

    Alternatively, to achieve your requirement running the resource graph query from the pipeline you can use the AzureCLI@2  

    Task and select the script as bash as shown below.

     A screenshot of a computer programDescription automatically generated

    Note: Please modify you query, script and refer to this samples mentioned here in this document on how to run graph queries using az graph cmdlet.

    Hope this helps, let me know if you have still any further questions on this.

    0 comments No comments