Passing the project and group in azure devops

tarun k 280 Reputation points
2025-06-06T05:09:25.12+00:00

We have below script is it is working fine and we are executing this in local machine not from azure devops repos and pipelines.

so when we execute from local machine we provide project name and also group name which you can see below and then we will run the script

so now I want to parameterize inputing providing project names and also group names from azure devops pipeline and also we want to keep this script in repo.

FYI: we have many projects and many groups ,so we want to provide project name and group name and then we want to run pipeline , so that it will apply permissions on that respective group on respective projects

Azure DevOps
{count} votes

1 answer

Sort by: Most helpful
  1. Durga Reshma Malthi 4,430 Reputation points Microsoft External Staff Moderator
    2025-06-06T11:52:27.0933333+00:00

    Hi tarun k

    As we discussed in private message,

    Instead of hardcoding project names, update your script to accept pipeline parameters:

    trigger: none  
    parameters:
      - name: projectNames
        type: string
        default: "Actuarial,Brazil"
      - name: groupName
        type: string
        default: "MyGroup"
    variables:
       projectNames: "Actuarial,Brazil"
       groupName: "MyGroup"
    pool:
      vmImage: 'windows-latest'
    jobs:
      - job: RunScript
        steps:
          - checkout: self
          - task: PowerShell@2
            inputs:
              targetType: 'inline'
              script: |
                $targetProjectNames = "$(projectNames)".Split(',')
                $groupName = "$(groupName)"
                .\TFS-AzDO\AzDO_PermissionBitUpdate_ManageDeliveryPlans.ps1
    

    Hope this helps!

    Please Let me know if you have any queries.

    If you found the information helpful, please click "Upvote" on the post to let us know and consider accepting the answer as the token of appreciation. Thank You.


Your answer

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