Skip to content
New issue

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

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

Already on GitHub? # to your account

[Issue] Docker buildargs does not support interpolation #4062

Closed
crgarcia12 opened this issue Jul 3, 2024 · 3 comments · Fixed by #4369
Closed

[Issue] Docker buildargs does not support interpolation #4062

crgarcia12 opened this issue Jul 3, 2024 · 3 comments · Fixed by #4369
Assignees
Labels
aca Azure Container Apps enhancement
Milestone

Comments

@crgarcia12
Copy link

Describe the bug
If you have a Static App (like React) and a backend api in ACA, it would be nice if we could take the output of the infra deployment (the url) and pass it as buildArgs in the dockerfile:

For example:

# main.biceps
...
output REACT_APP_BACKEND_URL string = backend.outputs.uri
# azure.yaml - Notice the environment variables!
...
    frontend:
        project: "src/frontend"
        host: containerapp
        language: ts
        dist: build
        docker:
            path: Dockerfile
            buildArgs:
                - REACT_APP_BACKEND_URL=${REACT_APP_BACKEND_URL}
# deploy infra and populate outputs as environment variables
azd provision --environment dev
# utilize environment variables to interpolate the azure.yaml
azd deploy 
@jongio
Copy link
Member

jongio commented Jul 8, 2024

@vhvb1989 This should work right?

@vhvb1989
Copy link
Member

vhvb1989 commented Jul 8, 2024

@vhvb1989 This should work right?

No. build-args don't support references to env values. This is a feature request (which is not that hard). The only thing to consider is security, as you will want to use --secret instead of --build-arg when referencing a secret from the system environment.

@vhvb1989
Copy link
Member

vhvb1989 commented Jul 8, 2024

@wbreza FYI

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
aca Azure Container Apps enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants