Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Environment Variable #818

Open
devhl-labs opened this issue May 3, 2024 · 1 comment
Open

Dynamic Environment Variable #818

devhl-labs opened this issue May 3, 2024 · 1 comment
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@devhl-labs
Copy link

I need to connect to a private Azure Devops artifact feed when my devcontainer starts. The command looks like this

CARGO_REGISTRIES_MYPROJECT_PUBLICPACKAGES_TOKEN="$(az account get-access-token --query "join(' ', ['Bearer', accessToken])" --output tsv)"

How can I get this set so it's not just the literal string?

@chrmarti
Copy link
Contributor

chrmarti commented May 8, 2024

You could add it to the container's ~/.bashrc either from your Dockerfile or the devcontainer.json. E.g., in the devcontainer.json add:

"postCreateCommand": "echo 'export TOKEN=\"$(az account ...)\"' >>~/.bashrc"

@chrmarti chrmarti self-assigned this May 8, 2024
@chrmarti chrmarti added the info-needed Issue requires more information from poster label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants