Forum Discussion
JoeffreyChaucer4
Nov 15, 2022Copper Contributor
How to pass you variable to env in azure devops?
How to pass you variable to env in azure devops? ```` parameters: - name: OrganizationName type: string - name: AgentPoolName type: string - name: ApiVersion type: string - name: jobName ty...
Loredan6
Nov 15, 2022Copper Contributor
Hello, if you want to assign to the AZURE_DEVOPS_AGENT_PAT the value of the $(AgentPAT) , please make sure that the $(AgentPAT) --> AgentPAT is part of a variable group, in the pipelines section you have "Library" then you need to create a variable group, and in that variable group you need to create an entry with the AgentPAT value and the pair that is the actual - secret. or link it yo an existing keyvault and reference it like that . and you also need to add that variable group into the pipeline. eg. variable group name : PatTokens
variables:
- group: PatTokens
This means you imported the variable group and the variables in that group can no be refferenced as you want and assigned into the pipeline just as your code does above.
variables:
- group: PatTokens
This means you imported the variable group and the variables in that group can no be refferenced as you want and assigned into the pipeline just as your code does above.
Vincent_MajewskiMV
Feb 07, 2023Copper Contributor
Hello Loredan6,
I think that the value of $(AgentPAT), will be different based on the environment. Do you know how we can load this library dynamically (without having to hardcode the environment in the pipeline) ?
more information in the related ticket : https://developercommunity.visualstudio.com/t/stage-dependencies-and-group-variable--/10265756
Thank you for you help
I think that the value of $(AgentPAT), will be different based on the environment. Do you know how we can load this library dynamically (without having to hardcode the environment in the pipeline) ?
more information in the related ticket : https://developercommunity.visualstudio.com/t/stage-dependencies-and-group-variable--/10265756
Thank you for you help