Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share variables between different projects in Azure DevOps

I hope you are all well!

I need to ask a question about azure devops, I already read the documentation, but I did not find a way to resolve these doubts

I have the X, Y and Z projects and in the X project create in the Pipeline >> Libray a group of variables called general that I would like to be shared with the Y and Z pipelines, when configuring this group I enabled the option "Allow Access to all pipelines" .

In the YAML of the Y and Z pipelines I made the following configuration:

variables:
- group: general

When running the pipeline he returns an authorization request and even clicking authorize it, according to the print below:

Print Authorization error

The text reads:

There was a resource authorization issue:
"An error occurred while loading the YAML build pipeline.
Variable group was not found or is not authorized for use.
For authorization details, refer to https://aka.ms/yamlauthz ."

My question is, is there any way to share variables between pipelines of different purposes, if there is, can you please send me some documentation that can help me to configure this?

like image 305
Leandro Moreira Avatar asked Jun 28 '26 11:06

Leandro Moreira


1 Answers

Testing in my side and I can reproduce this issue, setting the Allow access to all pipelines option will enable the variable group to be accessible for any pipelines in current project not across projects. It should be a known limitation and this is the feedback ticket. You can vote and follow this ticket. You can also create a new suggestion ticket here. The product group will review these tickets regularly, and consider to take it as roadmap.

In addition, as a workaround, you could try to add these shared variables to Azure Key Vault, and then use Azure Key Vault task to fetch the latest values of all or a subset of secrets from the vault, and set them as variables that can be used in subsequent tasks of a pipeline. See: Use Azure Key Vault secrets in Azure Pipelines for details.

like image 65
Edward Han-MSFT Avatar answered Jun 30 '26 01:06

Edward Han-MSFT