Assign a user or a group Administrator rights to variable groups that contain a specific string (mask) the name. This repo contains 2 versions of the solution:
- add_permisson.py (should work on any machine with python3.8)
- add_permission_az_devOps.py and azure-pipelines.yml (should work on Azure pipeline)
Generate Personal Access Token (PAT) link
Solution was tested with (Scopes: Full access)
- Add your project parameters to add_permisson.py
PERSONAL_ACCESS_TOKEN = ''
PROJECT_NAME = ''
ORGANIZATION_NAME = ''- Usage syntax
python3 add_permission.py -f <filter> -n <user_or_group_name>- Example (this script adds test@gmail.com permission to variable groups contains "test" in name). Case-insensitive.
python3 add_permission.py -f test -n test@gmail.comThis solution is a little bit adapted for the Azure DevOps pipeline.
- Create variable group AZURE_DEVOPS_TOKENS in your project.
link - Create AZURE_DEVOPS_EXT_PAT variable with PAT value in AZURE_DEVOPS_TOKENS group.
- Customize azure-pipelines.yml for your project. All necessary lines have comments.
- Use variable_group_filter and user_or_group_name in azure-pipelines.yml as input parameters for add_permission_az_devOps.py script.
- Create Azure DevOps pipeline
link