0

I am trying to access it as recommended here: https://vitejs.dev/guide/env-and-mode.html#:~:text=console.log(import.meta.env.VITE_SOME_KEY)%20//%20123

The problem is how do I pass Environment variables to VITE after the container image is built?

I tried creating Variables like:

APP_API_KEY and assign a value to it.

On my code, I try to call it with import.meta.env.APP_API_KEY

But all I get is undefined.

tried to follow this https://stackoverflow.com/questions/72705471/how-to-reference-secrets-in-azure-container-apps?rq=1#:~:text=let%20db_password%20%3D%20process.env.DB_PASSWORD%3B

But it didn't work.

0

1 Answer 1

0

prefix with VITE_

vite env-variable docs

Sign up to request clarification or add additional context in comments.

2 Comments

That would work during BUILD, but not after - as these are simply read from the environment and then injected into dist
Azure doesn't allow "_" in the secret key name. So how do we get around this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.