Fix the mapping for container env vars to aca-secrets #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of previous PR: #2
Infrastructure was updated from putting the OMDB_API_KEY and OPENAI_API_KEY directly in the env from the container-revision to, instead, putting this values within the AzureContainerApp secrets and creating an env-var within the revision which points to the aca-secret holding the value.
The change required a strategy to set upper-case, SNAKE_CASE env variables as aca-secrets because the aca-secrets has the same naming restrictions as a KeyVault secret. So, it is not possible to set a secret with the name
OPENAI_API_KEY
as aca-secret. The implemented strategy runs lowerCase() function and replaces_
for-
.The change was done correctly, but ended up breaking the python application because the application is expecting to find
OMDB_API_KEY
andOPENAI_API_KEY
in env, but the changes from the infrastructure updated the name of this env vars asopenaiApiKey
andomdbApiKey
, here: https://github.com/savannahostrowski/cinest/pull/2/files#diff-834bc11e3cb55730076a7d70767b75f794dc9a37305f27d99926e0fd24363c13R27The change on this PR restores the name for the ENV VARS are it is expected by the python application.
The strategy mentioned before is still applied based on the new names, creating env vars for the container like:
and then, setting aca-secrets as:
Allowing the revision to pull the values from the aca-secrets.