Command Override in Azure Container Apps /Container App Job

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .


Azure Container Apps (ACA) provides a flexible and scalable platform for deploying containerized applications. One powerful feature it offers is the ability to customize startup commands and override default CMD or ENTRYPOINT defined in a Dockerfile. In this blog, we'll explore how to leverage the "Command Override" option using various methods in ACA and Container App Jobs.


Understanding Command Overrides

Command overrides come in handy when you need to execute specific CMD or change the ENTRYPOINT of your container at runtime.



If one wants to run "index.js" during the start of the app, but as per line number 14 in below image, the "server.js" file will execute.


It can be achieved by providing "node", "index.js" to Command Override field in ACA, in easy words, the Dockerfile will be updated for that particular revision.



Parameters for Command Override

Before we dive into the methods, let's understand the key parameters:


  • --args: Used to add startup commands during image deployment.
  • --command: Overrides the default ENTRYPOINT or command defined in the Dockerfile. If you are overriding using a file present in specific path of the directory, then provide the path of the file from the root "/" . It reads the path and finds the file from the Kubernetes level.  


Methods of Command Overrides


  1. Azure CLI

When using the Azure Command-Line Interface (CLI) to create an Azure Container App, you can specify the command override using the "--command" parameter. Here's an example:




az containerapp create --name mycontainer --image myimage:latest --command "python, /some/path/"





  1. Azure Portal

The Azure portal provides a user-friendly interface for managing container configurations. To use Command Override:


  1. Navigate to the Azure portal > Azure Container Apps.
  2. Go to the container configuration section while editing or creating a container.
  3. Check out the "Command Override" property.
  4. Provide a comma-separated list of strings without quotes. Example:

python, /some/path/



This approach offers a visual and intuitive way to customize commands without delving into the command-line intricacies.


  1. Resource Manager Template

For those who prefer infrastructure-as-code, Resource Manager templates (Bicep or ARM templates) provide a structured way to define configurations. To specify the command line property as an array of strings, use the following syntax:




"properties": {

  "command": ["python", "/some/path/"]






The Command Override in Azure Container Apps and Container App Jobs opens up possibilities for tailoring your containerized applications. Experiment with different commands and entry points to find the configuration that best suits your application's needs. Happy developing!

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.