Nov 14 2022
07:47 PM
- last edited on
Mar 05 2024
02:10 PM
by
TechCommunityAP
Nov 14 2022
07:47 PM
- last edited on
Mar 05 2024
02:10 PM
by
TechCommunityAP
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
type: string
jobs:
- job: deleteOfflineAgents_${{ parameters.jobName }}
displayName: Delete Offline Agents in ${{ parameters.AgentPoolName }} pool
steps:
- script: |
AgentPAT=`aws secretsmanager get-secret-value --secret-id secret --query SecretString --output text | jq -r .secret`
.azurepipelines/scripts/offline-azp-agent-cleaner.sh
displayName: 'Delete Offline Agents'
env:
ORG_NAME: ${{ parameters.OrganizationName }}
AGENT_POOLNAME: ${{ parameters.AgentPoolName }}
API_VERSION: ${{ parameters.ApiVersion }}
AZURE_DEVOPS_AGENT_PAT: $(AgentPAT)
````
when echo AZURE_DEVOPS_AGENT_PAT shows "$(AgentPAT)" not the PAT key "keysample123asd13"
Nov 15 2022 11:28 AM
Feb 07 2023 01:58 AM