Share via


az containerapp github-action

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Commands to manage GitHub Actions.

Commands

Name Description Type Status
az containerapp github-action add

Add a GitHub Actions workflow to a repository to deploy a container app.

Core GA
az containerapp github-action add (containerapp extension)

Add a GitHub Actions workflow to a repository to deploy a container app.

Extension GA
az containerapp github-action delete

Remove a previously configured Container Apps GitHub Actions workflow from a repository.

Core GA
az containerapp github-action show

Show the GitHub Actions configuration on a container app.

Core GA

az containerapp github-action add

Add a GitHub Actions workflow to a repository to deploy a container app.

az containerapp github-action add --repo-url
                                  [--branch]
                                  [--context-path]
                                  [--ids]
                                  [--image]
                                  [--login-with-github]
                                  [--name]
                                  [--registry-password]
                                  [--registry-url]
                                  [--registry-username]
                                  [--resource-group]
                                  [--service-principal-client-id]
                                  [--service-principal-client-secret]
                                  [--service-principal-tenant-id]
                                  [--subscription]
                                  [--token]

Examples

Add GitHub Actions, using Azure Container Registry and personal access token.

az containerapp github-action add -g MyResourceGroup -n my-containerapp --repo-url https://github.com/userid/repo --branch main --registry-url myregistryurl.azurecr.io --service-principal-client-id 00000000-0000-0000-0000-00000000 --service-principal-tenant-id 00000000-0000-0000-0000-00000000 --service-principal-client-secret ClientSecret --token MyAccessToken

Add GitHub Actions, using Azure Container Registry and log in to GitHub flow to retrieve personal access token.

az containerapp github-action add -g MyResourceGroup -n my-containerapp --repo-url https://github.com/userid/repo --branch main --registry-url myregistryurl.azurecr.io --service-principal-client-id 00000000-0000-0000-0000-00000000 --service-principal-tenant-id 00000000-0000-0000-0000-00000000 --service-principal-client-secret ClientSecret --login-with-github

Add GitHub Actions, using Docker Hub and log in to GitHub flow to retrieve personal access token.

az containerapp github-action add -g MyResourceGroup -n my-containerapp --repo-url https://github.com/userid/repo --branch main --registry-username MyUsername --registry-password MyPassword --service-principal-client-id 00000000-0000-0000-0000-00000000 --service-principal-tenant-id 00000000-0000-0000-0000-00000000 --service-principal-client-secret ClientSecret --login-with-github

Required Parameters

--repo-url

The GitHub repository to which the workflow file will be added. In the format: https://github.com//.

Optional Parameters

--branch -b

The branch of the Github repo. Assumed to be the Github repo's default branch if not specified.

--context-path

Path in the repo from which to run the docker build. Defaults to "./".

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--image -i

Container image name that the Github Action should use. Defaults to the Container App name.

--login-with-github

Interactively log in with Github to retrieve the Personal Access Token.

Default value: False
--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--registry-password

The password of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.

--registry-url

The container registry server, e.g. myregistry.azurecr.io.

--registry-username

The username of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-principal-client-id

The service principal client ID.

--service-principal-client-secret

The service principal client secret.

--service-principal-tenant-id

The service principal tenant ID.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--token

A Personal Access Token with write access to the specified repository. For more information: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az containerapp github-action add (containerapp extension)

Add a GitHub Actions workflow to a repository to deploy a container app.

az containerapp github-action add --repo-url
                                  [--branch]
                                  [--build-env-vars]
                                  [--context-path]
                                  [--ids]
                                  [--image]
                                  [--login-with-github]
                                  [--name]
                                  [--registry-password]
                                  [--registry-url]
                                  [--registry-username]
                                  [--resource-group]
                                  [--service-principal-client-id]
                                  [--service-principal-client-secret]
                                  [--service-principal-tenant-id]
                                  [--subscription]
                                  [--token]

Examples

Add GitHub Actions, using Azure Container Registry and personal access token.

az containerapp github-action add -g MyResourceGroup -n my-containerapp --repo-url https://github.com/userid/repo --branch main --registry-url myregistryurl.azurecr.io --service-principal-client-id 00000000-0000-0000-0000-00000000 --service-principal-tenant-id 00000000-0000-0000-0000-00000000 --service-principal-client-secret ClientSecret --token MyAccessToken

Add GitHub Actions, using Azure Container Registry and personal access token, configure image build via build environment variables.

az containerapp github-action add -g MyResourceGroup -n my-containerapp --repo-url https://github.com/userid/repo --branch main --registry-url myregistryurl.azurecr.io --service-principal-client-id 00000000-0000-0000-0000-00000000 --service-principal-tenant-id 00000000-0000-0000-0000-00000000 --service-principal-client-secret ClientSecret --token MyAccessToken --build-env-vars BP_JVM_VERSION=21 BP_MAVEN_VERSION=4

Add GitHub Actions, using Azure Container Registry and log in to GitHub flow to retrieve personal access token.

az containerapp github-action add -g MyResourceGroup -n my-containerapp --repo-url https://github.com/userid/repo --branch main --registry-url myregistryurl.azurecr.io --service-principal-client-id 00000000-0000-0000-0000-00000000 --service-principal-tenant-id 00000000-0000-0000-0000-00000000 --service-principal-client-secret ClientSecret --login-with-github

Add GitHub Actions, using Docker Hub and log in to GitHub flow to retrieve personal access token.

az containerapp github-action add -g MyResourceGroup -n my-containerapp --repo-url https://github.com/userid/repo --branch main --registry-username MyUsername --registry-password MyPassword --service-principal-client-id 00000000-0000-0000-0000-00000000 --service-principal-tenant-id 00000000-0000-0000-0000-00000000 --service-principal-client-secret ClientSecret --login-with-github

Required Parameters

--repo-url

The GitHub repository to which the workflow file will be added. In the format: https://github.com//.

Optional Parameters

--branch -b

The branch of the Github repo. Assumed to be the Github repo's default branch if not specified.

--build-env-vars
Preview

A list of environment variable(s) for the build. Space-separated values in 'key=value' format.

--context-path

Path in the repo from which to run the docker build. Defaults to "./".

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--image -i

Container image name that the Github Action should use. Defaults to the Container App name.

--login-with-github

Interactively log in with Github to retrieve the Personal Access Token.

Default value: False
--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--registry-password

The password of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.

--registry-url

The container registry server, e.g. myregistry.azurecr.io.

--registry-username

The username of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-principal-client-id

The service principal client ID.

--service-principal-client-secret

The service principal client secret.

--service-principal-tenant-id

The service principal tenant ID.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--token

A Personal Access Token with write access to the specified repository. For more information: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az containerapp github-action delete

Remove a previously configured Container Apps GitHub Actions workflow from a repository.

az containerapp github-action delete [--ids]
                                     [--login-with-github]
                                     [--name]
                                     [--resource-group]
                                     [--subscription]
                                     [--token]

Examples

Remove GitHub Actions using a personal access token.

az containerapp github-action delete -g MyResourceGroup -n MyContainerapp --token MyAccessToken

Remove GitHub Actions using log in to GitHub flow to retrieve personal access token.

az containerapp github-action delete -g MyResourceGroup -n MyContainerapp --login-with-github

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--login-with-github

Interactively log in with Github to retrieve the Personal Access Token.

Default value: False
--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--token

A Personal Access Token with write access to the specified repository. For more information: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az containerapp github-action show

Show the GitHub Actions configuration on a container app.

az containerapp github-action show [--ids]
                                   [--name]
                                   [--resource-group]
                                   [--subscription]

Examples

Show the GitHub Actions configuration on a Containerapp.

az containerapp github-action show -g MyResourceGroup -n MyContainerapp

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.