@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.
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.
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.