通过


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

az acr webhook

管理Azure容器注册表的 Webhook。

命令

名称 说明 类型 Status
az acr webhook create

为Azure 容器注册表创建 Webhook。

Core GA
az acr webhook delete

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

Core GA
az acr webhook get-config

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

Core GA
az acr webhook list

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

Core GA
az acr webhook list-events

列出 Webhook 的最新事件。

Core GA
az acr webhook ping

为 Webhook 触发 ping 事件。

Core GA
az acr webhook show

获取 Webhook 的详细信息。

Core GA
az acr webhook update

更新 Webhook。

Core GA

az acr webhook create

为Azure 容器注册表创建 Webhook。

az acr webhook create --actions {chart_delete, chart_push, delete, push, quarantine}
                      --name
                      --registry
                      --uri
                      [--acquire-policy-token]
                      [--change-reference]
                      [--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。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--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。

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

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

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False

az acr webhook delete

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

az acr webhook delete --name
                      --registry
                      [--acquire-policy-token]
                      [--change-reference]
                      [--resource-group]

示例

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

az acr webhook delete -n mywebhook -r myregistry

必需参数

--name -n

Webhook 的名称。

--registry -r

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

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--resource-group -g

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

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False

az acr webhook get-config

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

az acr webhook get-config --name
                          --registry
                          [--acquire-policy-token]
                          [--change-reference]
                          [--resource-group]

示例

获取 Webhook 的配置信息。

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

必需参数

--name -n

Webhook 的名称。

--registry -r

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

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--resource-group -g

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

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False

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

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False

az acr webhook list-events

列出 Webhook 的最新事件。

az acr webhook list-events --name
                           --registry
                           [--acquire-policy-token]
                           [--change-reference]
                           [--resource-group]

示例

列出 Webhook 的最新事件。

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

必需参数

--name -n

Webhook 的名称。

--registry -r

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

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--resource-group -g

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

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False

az acr webhook ping

为 Webhook 触发 ping 事件。

az acr webhook ping --name
                    --registry
                    [--acquire-policy-token]
                    [--change-reference]
                    [--resource-group]

示例

为 Webhook 触发 ping 事件。

az acr webhook ping -n mywebhook -r myregistry

必需参数

--name -n

Webhook 的名称。

--registry -r

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

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--resource-group -g

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

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False

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

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False

az acr webhook update

更新 Webhook。

az acr webhook update --name
                      --registry
                      [--acquire-policy-token]
                      [--actions {chart_delete, chart_push, delete, push, quarantine}]
                      [--add]
                      [--change-reference]
                      [--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>配置默认注册表名称。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--actions

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

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

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

属性
参数组: Generic Update Arguments
默认值: []
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--force-string

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

属性
参数组: Generic Update Arguments
默认值: False
--headers

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

--remove

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

属性
参数组: Generic Update Arguments
默认值: []
--resource-group -g

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

--scope

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

--set

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

属性
参数组: Generic Update Arguments
默认值: []
--status

指示是否已启用 Webhook。

属性
接受的值: disabled, enabled
--tags

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

--uri

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

全局参数
--debug

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

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

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

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

--subscription

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

--verbose

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

属性
默认值: False