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
The GitHub repository to which the workflow file will be added. In the format: https://github.com//.
Optional Parameters
The branch of the Github repo. Assumed to be the Github repo's default branch if not specified.
Path in the repo from which to run the docker build. Defaults to "./".
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.
Container image name that the Github Action should use. Defaults to the Container App name.
Interactively log in with Github to retrieve the Personal Access Token.
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.
The password of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.
The container registry server, e.g. myregistry.azurecr.io.
The username of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The service principal client ID.
The service principal client secret.
The service principal tenant ID.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The GitHub repository to which the workflow file will be added. In the format: https://github.com//.
Optional Parameters
The branch of the Github repo. Assumed to be the Github repo's default branch if not specified.
A list of environment variable(s) for the build. Space-separated values in 'key=value' format.
Path in the repo from which to run the docker build. Defaults to "./".
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.
Container image name that the Github Action should use. Defaults to the Container App name.
Interactively log in with Github to retrieve the Personal Access Token.
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.
The password of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.
The container registry server, e.g. myregistry.azurecr.io.
The username of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The service principal client ID.
The service principal client secret.
The service principal tenant ID.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
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.
Interactively log in with Github to retrieve the Personal Access Token.
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.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
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.
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.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.