Are you trying to edit a variable group in an Azure DevOps Library, and getting the error “you do not have permission to create a variable group within library”? Continue on to find out how to rectify this issue.
The problem
DevOps project settings - these don’t apply to variable groups
Variable groups within Azure DevOps can have different permissions to your project settings. This can be useful to limit the number of people who can view and edit your config values, but can be confusing.
As such, while you may have appropriate permissions to edit and your project you may find yourself unable to create variable groups within your Azure DevOps instance.
If this has happened to you, you’ll be shown an error something along the lines of “Error: you do not have permission to create a variable group within library.”
The fix
Luckily there’s a quick fix to this issue, although it will require you to find someone with the correct administrator privileges first.
Once you’ve found the person who has the correct privileges, navigate to your project in the DevOps portal, and create a new group. Alternatively, if this is an existing group click on the title of the group you wish to edit.
If you did create a new group, name it and make sure at least one variable exists. Note that this can be a dummy value - but without a variable DevOps won’t let you save the new group.
Then, within the edit group screen, select “Security”. The title of the modal that appears should be something like “Assign security roles for Library/”. If it’s not, make sure you selected the group first and that you haven’t clicked “Security” from the main Library screen.
Security roles apply to variable groups
DevOps libraries have 3 tiers of roles/permissions:
- Reader: Can only view items within the library
- User: Can use items within the library, but can’t edit them
- Administrator: Can use AND manage items within the library
Search for the user(s) you want to be able to add and edit variables (and to avoid the above error) and choose the “administrator” role.
Click “Add”, close the modal and then click “Save”. The above error should no longer occur for users trying to edit or create variables in the DevOps library.