你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az acr webhook

管理 Azure 容器注册表的 Webhook。

命令

名称 说明 类型 状态
az acr webhook create

为 Azure 容器注册表创建 webhook。

核心 GA
az acr webhook delete

从 Azure 容器注册表中删除 webhook。

核心 GA
az acr webhook get-config

获取 webhook 的服务 URI 和自定义标头。

核心 GA
az acr webhook list

列出 Azure 容器注册表的所有 webhook。

核心 GA
az acr webhook list-events

列出 webhook 的最近事件。

核心 GA
az acr webhook ping

触发 webhook 的 ping 事件。

核心 GA
az acr webhook show

获取 webhook 详细信息。

核心 GA
az acr webhook update

更新 Webhook。

核心 GA

az acr webhook create

为 Azure 容器注册表创建 webhook。

az acr webhook create --actions {chart_delete, chart_push, delete, push, quarantine}
                      --name
                      --registry
                      --uri
                      [--headers]
                      [--location]
                      [--resource-group]
                      [--scope]
                      [--status {disabled, enabled}]
                      [--tags]

示例

为将 docker 推送和删除事件传送到服务 URI 的 Azure 容器注册表创建 Webhook。

az acr webhook create -n mywebhook -r myregistry --uri http://myservice.com --actions push delete

为Azure 容器注册表创建 Webhook,以便使用基本身份验证标头将 docker 推送事件传送到服务 URI。

az acr webhook create -n mywebhook -r myregistry --uri http://myservice.com --actions push --headers "Authorization=Basic 000000"

为Azure 容器注册表创建 Webhook,用于将 helm 图表推送和删除事件传送到服务 URI。

az acr webhook create -n mywebhook -r myregistry --uri http://myservice.com --actions chart_push chart_delete

必需参数

--actions

触发 Webhook 发布通知的操作的空间分隔列表。

接受的值: chart_delete, chart_push, delete, push, quarantine
--name -n

Webhook 的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

--uri

用于发布通知的 Webhook 的服务 URI。

可选参数

--headers

将添加到 Webhook 通知的“key[=value]”格式的空间分隔自定义标头。 使用“”清除现有标头。

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--scope

可以触发事件的存储库范围。 例如,“foo:*”表示存储库“foo”下所有标记的事件。 “foo:bar”仅表示“foo:bar”的事件。 “foo”等效于“foo:latest”。 空表示所有存储库的事件。

--status

指示是否已启用 Webhook。

接受的值: disabled, enabled
默认值: enabled
--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr webhook delete

从 Azure 容器注册表中删除 webhook。

az acr webhook delete --name
                      --registry
                      [--resource-group]

示例

从 Azure 容器注册表中删除 webhook。

az acr webhook delete -n mywebhook -r myregistry

必需参数

--name -n

Webhook 的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr webhook get-config

获取 webhook 的服务 URI 和自定义标头。

az acr webhook get-config --name
                          --registry
                          [--resource-group]

示例

获取 Webhook 的配置信息。

az acr webhook get-config -n mywebhook -r myregistry

必需参数

--name -n

Webhook 的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr webhook list

列出 Azure 容器注册表的所有 webhook。

az acr webhook list --registry
                    [--resource-group]

示例

列出 Webhook 并在表中显示结果。

az acr webhook list -r myregistry -o table

必需参数

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr webhook list-events

列出 webhook 的最近事件。

az acr webhook list-events --name
                           --registry
                           [--resource-group]

示例

列出 webhook 的最近事件。

az acr webhook list-events -n mywebhook -r myregistry

必需参数

--name -n

Webhook 的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr webhook ping

触发 webhook 的 ping 事件。

az acr webhook ping --name
                    --registry
                    [--resource-group]

示例

触发 webhook 的 ping 事件。

az acr webhook ping -n mywebhook -r myregistry

必需参数

--name -n

Webhook 的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr webhook show

获取 webhook 详细信息。

az acr webhook show --name
                    --registry
                    [--resource-group]

示例

获取 webhook 详细信息。

az acr webhook show -n mywebhook -r myregistry

必需参数

--name -n

Webhook 的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr webhook update

更新 Webhook。

az acr webhook update --name
                      --registry
                      [--actions {chart_delete, chart_push, delete, push, quarantine}]
                      [--add]
                      [--force-string]
                      [--headers]
                      [--remove]
                      [--resource-group]
                      [--scope]
                      [--set]
                      [--status {disabled, enabled}]
                      [--tags]
                      [--uri]

示例

更新 Webhook 的标头。

az acr webhook update -n mywebhook -r myregistry --headers "Authorization=Basic 000000"

更新 Webhook 的服务 URI 和操作。

az acr webhook update -n mywebhook -r myregistry --uri http://myservice.com --actions push delete

禁用 Webhook。

az acr webhook update -n mywebhook -r myregistry --status disabled

必需参数

--name -n

Webhook 的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--actions

触发 Webhook 发布通知的操作的空间分隔列表。

接受的值: chart_delete, chart_push, delete, push, quarantine
--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>

默认值: []
--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

默认值: False
--headers

将添加到 Webhook 通知的“key[=value]”格式的空间分隔自定义标头。 使用“”清除现有标头。

--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

默认值: []
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--scope

可以触发事件的存储库范围。 例如,“foo:*”表示存储库“foo”下所有标记的事件。 “foo:bar”仅表示“foo:bar”的事件。 “foo”等效于“foo:latest”。 空表示所有存储库的事件。

--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>

默认值: []
--status

指示是否已启用 Webhook。

接受的值: disabled, enabled
--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。

--uri

用于发布通知的 Webhook 的服务 URI。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。