API Tokens in Azure Release Pipelines #3033
-
Hello, Following the documentation I generated an API Token and created an environmental variable in the Release Pipeline. This works fine - but only if the API Token is not "hidden". If I hide the API Token (which is the most secure, especially when using external developers), wrangler2 will return the following error: So, my question is: Is there anyway to hide the API Token, in the variable list? Or is that simply not possible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Ran into the same issue, worked around it by storing the api token in base64 as a secret in the pipeline variables, and then before invoking wrangler I decoded it and set the appropriate environment variable in the execution scope to the decoded value. steps:
- powershell: |
npm install wrangler -g --loglevel=error
$env:CLOUDFLARE_API_TOKEN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("$env:CLOUDFLARE_API_TOKEN_BASE64"))
wrangler pages deploy build --project-name $env:CloudflarePagesProjectName
env:
CLOUDFLARE_API_TOKEN_BASE64: $(CLOUDFLARE_API_TOKEN_BASE64) |
Beta Was this translation helpful? Give feedback.
-
I updated the VM used in the pipeline. This seems to have solved the issue and the token can be hidden correctly. |
Beta Was this translation helpful? Give feedback.
I updated the VM used in the pipeline. This seems to have solved the issue and the token can be hidden correctly.