az containerapp github-action
Note
此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 了解更多关于扩展的信息。
用于管理 GitHub Actions 的命令。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az containerapp github-action add |
将 GitHub Actions 工作流添加到存储库以部署容器应用。 |
Core | GA |
| az containerapp github-action add (containerapp 扩展) |
将 GitHub Actions 工作流添加到存储库以部署容器应用。 |
Extension | GA |
| az containerapp github-action delete |
从存储库中删除以前配置的容器应用 GitHub Actions 工作流。 |
Core | GA |
| az containerapp github-action show |
在容器应用上显示 GitHub Actions 配置。 |
Core | GA |
az containerapp github-action add
将 GitHub Actions 工作流添加到存储库以部署容器应用。
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]
示例
使用 Azure 容器注册表和个人访问令牌添加 GitHub Actions。
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
使用 Azure 容器注册表添加 GitHub Actions 并登录到 GitHub 流以检索个人访问令牌。
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
使用 Docker 中心添加 GitHub Actions 并登录到 GitHub 流以检索个人访问令牌。
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
必需参数
将向其添加工作流文件的 GitHub 存储库。 采用以下格式:https://github.com/<owner>/<repository-name>。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Github 存储库的分支。 假定为 Github 存储库的默认分支(如果未指定)。
从中运行 docker 生成的存储库中的路径。 默认值为“./”。
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
Github 操作应使用的容器映像名称。 默认为容器应用名称。
使用 Github 以交互方式登录以检索个人访问令牌。
| 属性 | 值 |
|---|---|
| 默认值: | False |
Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
注册表的密码。 如果使用 Azure 容器注册表,我们将尝试推断凭据(如果未提供)。
容器注册表服务器,例如 myregistry.azurecr.io。
注册表的用户名。 如果使用 Azure 容器注册表,我们将尝试推断凭据(如果未提供)。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
服务主体客户端 ID。
服务主体客户端机密。
服务主体租户 ID。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
具有对指定存储库的写入访问权限的个人访问令牌。 有关详细信息,请参阅 https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az containerapp github-action add (containerapp 扩展)
将 GitHub Actions 工作流添加到存储库以部署容器应用。
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]
示例
使用 Azure 容器注册表和个人访问令牌添加 GitHub Actions。
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
使用 Azure 容器注册表和个人访问令牌添加 GitHub Actions,通过生成环境变量配置映像生成。
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
使用 Azure 容器注册表添加 GitHub Actions 并登录到 GitHub 流以检索个人访问令牌。
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
使用 Docker 中心添加 GitHub Actions 并登录到 GitHub 流以检索个人访问令牌。
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
必需参数
将向其添加工作流文件的 GitHub 存储库。 采用以下格式:https://github.com/<owner>/<repository-name>。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Github 存储库的分支。 假定为 Github 存储库的默认分支(如果未指定)。
生成的环境变量列表。 以“key=value”格式分隔的空间值。
从中运行 docker 生成的存储库中的路径。 默认值为“./”。
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
Github 操作应使用的容器映像名称。 默认为容器应用名称。
使用 Github 以交互方式登录以检索个人访问令牌。
| 属性 | 值 |
|---|---|
| 默认值: | False |
Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
注册表的密码。 如果使用 Azure 容器注册表,我们将尝试推断凭据(如果未提供)。
容器注册表服务器,例如 myregistry.azurecr.io。
注册表的用户名。 如果使用 Azure 容器注册表,我们将尝试推断凭据(如果未提供)。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
服务主体客户端 ID。
服务主体客户端机密。
服务主体租户 ID。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
具有对指定存储库的写入访问权限的个人访问令牌。 有关详细信息,请参阅 https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az containerapp github-action delete
从存储库中删除以前配置的容器应用 GitHub Actions 工作流。
az containerapp github-action delete [--ids]
[--login-with-github]
[--name]
[--resource-group]
[--subscription]
[--token]
示例
使用个人访问令牌删除 GitHub Actions。
az containerapp github-action delete -g MyResourceGroup -n MyContainerapp --token MyAccessToken
使用登录到 GitHub 流来检索个人访问令牌,删除 GitHub Actions。
az containerapp github-action delete -g MyResourceGroup -n MyContainerapp --login-with-github
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
使用 Github 以交互方式登录以检索个人访问令牌。
| 属性 | 值 |
|---|---|
| 默认值: | False |
Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
具有对指定存储库的写入访问权限的个人访问令牌。 有关详细信息,请参阅 https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az containerapp github-action show
在容器应用上显示 GitHub Actions 配置。
az containerapp github-action show [--ids]
[--name]
[--resource-group]
[--subscription]
示例
在 Containerapp 上显示 GitHub Actions 配置。
az containerapp github-action show -g MyResourceGroup -n MyContainerapp
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
Containerapp 的名称。 名称必须包含小写字母数字字符或“-”,以字母开头,以字母数字字符结尾,不能有“--”,并且必须小于 32 个字符。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
| 属性 | 值 |
|---|---|
| Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |