Azure DevOps Azure PowerShell Task: Get Current Resource Group

Mike-E-angelo 486 Reputation points

In my Azure DevOps Release Pipeline I see the following information in a task:

I have bound this task to a service connection that has both a subscription and a resource group.

How do I access this resource group in the inline script?

(this system seriously needs to update its tags btw... azure-devops isn't even a candidate)

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,626 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sudipta Chakraborty - MSFT 1,101 Reputation points Microsoft Employee

    You can write the following PowerShell script to get the Resource Group in the DevOps pipeline stage:

    Get-AzResourceGroup -Name "YourResourceGroupName"

    You can check the below link for different PowerShell scripts for getting the Resource Group.


  2. JamesTran-MSFT 36,481 Reputation points Microsoft Employee

    Thank you for your post!
    Azure DevOps is currently not supported here on the Q&A forums, our Azure DevOps experts are actively answering questions in their dedicated forum here:

    Thank you for your time and patience throughout this issue.


    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.