How to update environment variables of a Init Container using Azure CLI ?

Yasitha Gunarathne 40 Reputation points
2024-05-16T12:10:20.9433333+00:00

I'm using the "az container app update" command to update the environment variables of sidecar containers. However, I can't use the same command to update the environment variables of an Init Container. What is the solution?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
451 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
401 questions
0 comments No comments
{count} votes

Accepted answer
  1. akinbade abiola 18,715 Reputation points
    2024-05-16T12:36:23.44+00:00

    Hello Yasitha Gunarathne

    Thanks for your question.

    To update this, I would recommend you define this in a YAML file. You can export current config

    az containerapp show -n my-containerapp -g MyResourceGroup --output yaml 
    

    Then proceed to edit as needed using on the yaml file you have defined above

    az containerapp update -n my-containerapp -g MyResourceGroup  --yaml container.yaml
    
    

    See: https://learn.microsoft.com/en-us/azure/container-instances/container-instances-environment-variables?source=recommendations#yaml-deployment

    Please let me know if you have further questions

    You can mark it 'Accept Answer' if this helped.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.