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

az connection

注意

此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 详细了解扩展。

用于管理服务的命令连接或本地连接,允许本地环境连接 Azure 资源。 如果要管理计算服务的连接,请运行“az webapp/containerapp/spring connection”。

命令

名称 说明 类型 状态
az connection create

创建从本地到目标资源的连接。

核心和扩展 GA
az connection create app-insights

创建服务连接或与 app-insights 建立本地连接。

核心 GA
az connection create appconfig

创建服务连接或与 appconfig 建立本地连接。

核心 GA
az connection create confluent-cloud

创建与 confluent-cloud 的本地连接。

核心 GA
az connection create cosmos-cassandra

创建服务连接或与 cosmos-cassandra 建立本地连接。

核心 GA
az connection create cosmos-gremlin

创建与 cosmos-gremlin 的服务连接或本地连接。

核心 GA
az connection create cosmos-mongo

创建与 cosmos-mongo 的服务连接或本地连接。

核心 GA
az connection create cosmos-sql

创建与 cosmos-sql 的服务连接或本地连接。

核心 GA
az connection create cosmos-table

创建与 cosmos-table 的服务连接或本地连接。

核心 GA
az connection create eventhub

创建服务连接或与 eventhub 的本地连接。

核心 GA
az connection create keyvault

创建与 keyvault 的服务连接或本地连接。

核心 GA
az connection create mysql

创建与 mysql 的服务连接或本地连接。

核心 GA
az connection create mysql-flexible

创建服务连接或与 mysql 灵活连接的本地连接。

核心 GA
az connection create mysql-flexible (serviceconnector-passwordless 扩展)

创建服务连接或与 mysql 灵活连接的本地连接。

扩展 GA
az connection create postgres

创建与 postgres 的服务连接或本地连接。

核心 GA
az connection create postgres (serviceconnector-passwordless 扩展)

创建与 postgres 的服务连接或本地连接。

扩展 GA
az connection create postgres-flexible

创建服务连接或本地连接以灵活发布。

核心 GA
az connection create postgres-flexible (serviceconnector-passwordless 扩展)

创建服务连接或本地连接以灵活发布。

扩展 GA
az connection create redis

创建与 redis 的服务连接或本地连接。

核心 GA
az connection create redis-enterprise

创建与 redis-enterprise 的服务连接或本地连接。

核心 GA
az connection create servicebus

创建与 servicebus 的服务连接或本地连接。

核心 GA
az connection create signalr

创建与信号器的服务连接或本地连接。

核心 GA
az connection create sql

创建与 sql 的服务连接或本地连接。

核心 GA
az connection create sql (serviceconnector-passwordless 扩展)

创建与 sql 的服务连接或本地连接。

扩展 GA
az connection create storage-blob

创建服务连接或与 storage-blob 的本地连接。

核心 GA
az connection create storage-file

创建服务连接或与存储文件的本地连接。

核心 GA
az connection create storage-queue

创建服务连接或存储队列的本地连接。

核心 GA
az connection create storage-table

创建服务连接或存储表的本地连接。

核心 GA
az connection create webpubsub

创建与 webpubsub 的服务连接或本地连接。

核心 GA
az connection delete

删除服务连接或本地连接。

核心 GA
az connection generate-configuration

生成服务连接或本地连接的配置。 结果应放入应用程序配置文件或设置为环境变量。

核心 GA
az connection list

列出服务连接or 的本地连接。

核心 GA
az connection list-support-types

列出本地连接支持的客户端类型和身份验证类型。

核心 GA
az connection preview-configuration

预览本地连接的预期配置。

核心 GA
az connection preview-configuration app-insights

预览到 app-insights 的本地连接的预期配置。

核心 GA
az connection preview-configuration appconfig

预览到 appconfig 的本地连接的预期配置。

核心 GA
az connection preview-configuration confluent-cloud

预览到 confluent-cloud 的本地连接的预期配置。

核心 GA
az connection preview-configuration cosmos-cassandra

预览到 cosmos-cassandra 的本地连接的预期配置。

核心 GA
az connection preview-configuration cosmos-gremlin

预览到 cosmos-gremlin 的本地连接的预期配置。

核心 GA
az connection preview-configuration cosmos-mongo

预览与 cosmos-mongo 的本地连接的预期配置。

核心 GA
az connection preview-configuration cosmos-sql

预览到 cosmos-sql 的本地连接的预期配置。

核心 GA
az connection preview-configuration cosmos-table

预览到 cosmos-table 的本地连接的预期配置。

核心 GA
az connection preview-configuration eventhub

预览到 eventhub 的本地连接的预期配置。

核心 GA
az connection preview-configuration keyvault

预览到 keyvault 的本地连接的预期配置。

核心 GA
az connection preview-configuration mysql

预览到 mysql 的本地连接的预期配置。

核心 GA
az connection preview-configuration mysql-flexible

预览与 mysql 灵活连接的本地连接的预期配置。

核心 GA
az connection preview-configuration postgres

预览到 postgres 的本地连接的预期配置。

核心 GA
az connection preview-configuration postgres-flexible

预览本地连接与 postgres 灵活连接的预期配置。

核心 GA
az connection preview-configuration redis

预览到 redis 的本地连接的预期配置。

核心 GA
az connection preview-configuration redis-enterprise

预览到 redis-enterprise 的本地连接的预期配置。

核心 GA
az connection preview-configuration servicebus

预览到 servicebus 的本地连接的预期配置。

核心 GA
az connection preview-configuration signalr

预览到信号器本地连接的预期配置。

核心 GA
az connection preview-configuration sql

预览到 sql 的本地连接的预期配置。

核心 GA
az connection preview-configuration storage-blob

预览到 storage-blob 的本地连接的预期配置。

核心 GA
az connection preview-configuration storage-file

预览与存储文件本地连接的预期配置。

核心 GA
az connection preview-configuration storage-queue

预览到存储队列的本地连接的预期配置。

核心 GA
az connection preview-configuration storage-table

预览与存储表的本地连接的预期配置。

核心 GA
az connection preview-configuration webpubsub

预览到 Webpubsub 的本地连接的预期配置。

核心 GA
az connection show

获取服务连接或本地连接的详细信息。

核心 GA
az connection update

更新服务连接或本地连接。

核心 GA
az connection update app-insights

将本地更新到 app-insights 连接。

核心 GA
az connection update appconfig

更新 appconfig 连接的本地连接。

核心 GA
az connection update confluent-cloud

将本地连接更新到 confluent-cloud。

核心 GA
az connection update cosmos-cassandra

将本地更新到 cosmos-cassandra 连接。

核心 GA
az connection update cosmos-gremlin

更新 cosmos-gremlin 连接的本地连接。

核心 GA
az connection update cosmos-mongo

更新 cosmos-mongo 连接的本地连接。

核心 GA
az connection update cosmos-sql

更新 cosmos-sql 连接的本地连接。

核心 GA
az connection update cosmos-table

更新 cosmos-table 连接的本地连接。

核心 GA
az connection update eventhub

将本地更新到 eventhub 连接。

核心 GA
az connection update keyvault

更新 keyvault 连接的本地连接。

核心 GA
az connection update mysql

更新 mysql 连接的本地连接。

核心 GA
az connection update mysql-flexible

更新本地到 mysql 灵活连接。

核心 GA
az connection update postgres

将本地更新为 postgres 连接。

核心 GA
az connection update postgres-flexible

将本地更新为灵活连接。

核心 GA
az connection update redis

将本地更新为 redis 连接。

核心 GA
az connection update redis-enterprise

将本地更新为 redis-enterprise 连接。

核心 GA
az connection update servicebus

更新服务总线连接的本地连接。

核心 GA
az connection update signalr

更新本地信号器连接。

核心 GA
az connection update sql

更新本地到 sql 连接。

核心 GA
az connection update storage-blob

更新存储 Blob 连接的本地连接。

核心 GA
az connection update storage-file

更新存储文件连接的本地连接。

核心 GA
az connection update storage-queue

更新存储队列连接的本地连接。

核心 GA
az connection update storage-table

更新存储表连接的本地连接。

核心 GA
az connection update webpubsub

更新 Webpubsub 连接的本地连接。

核心 GA
az connection validate

验证服务连接或本地连接。

核心 GA
az connection wait

将 CLI 置于等待状态,直到满足连接条件。

核心 GA

az connection delete

删除服务连接或本地连接。

az connection delete [--connection]
                     [--id]
                     [--location]
                     [--no-wait]
                     [--resource-group]
                     [--yes]

示例

以交互方式删除本地连接

az connection delete

按连接名称删除本地连接

az connection delete -g resourceGroup --connection MyConnection

按连接 ID 删除本地连接

az connection delete --id /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}

可选参数

--connection

连接的名称。

--id

连接的 ID。

--location -l

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

--no-wait

不等待长时间运行的操作完成。

默认值: False
--resource-group -g

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

--yes -y

不提示确认。

默认值: False
全局参数
--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 connection generate-configuration

生成服务连接或本地连接的配置。 结果应放入应用程序配置文件或设置为环境变量。

az connection generate-configuration [--connection]
                                     [--id]
                                     [--location]
                                     [--resource-group]

示例

按连接名称生成连接的本地配置

az connection generate-configuration -g resource_group --connection MyConnection

按连接 ID 生成连接的本地配置

az connection generate-configuration --id /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}

可选参数

--connection

连接的名称。

--id

连接的 ID。

--location -l

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

--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 connection list

列出服务连接or 的本地连接。

az connection list --resource-group
                   [--location]

示例

按资源组列出连接

az connection list -g resource_group

按源资源组和位置列出连接

az connection list -g resource_group --location eastus

必需参数

--resource-group -g

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

可选参数

--location -l

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

全局参数
--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 connection list-support-types

列出本地连接支持的客户端类型和身份验证类型。

az connection list-support-types [--target-type {app-insights, appconfig, confluent-cloud, cosmos-cassandra, cosmos-gremlin, cosmos-mongo, cosmos-sql, cosmos-table, eventhub, keyvault, mysql, mysql-flexible, postgres, postgres-flexible, redis, redis-enterprise, servicebus, signalr, sql, storage-blob, storage-file, storage-queue, storage-table, webpubsub}]

示例

列出所有支持的目标资源类型和身份验证类型

az connection list-support-types -o table

列出特定目标资源类型支持的身份验证类型

az connection list-support-types --target-type storage-blob -o table

可选参数

--target-type -t

目标资源类型。

接受的值: app-insights, appconfig, confluent-cloud, cosmos-cassandra, cosmos-gremlin, cosmos-mongo, cosmos-sql, cosmos-table, eventhub, keyvault, mysql, mysql-flexible, postgres, postgres-flexible, redis, redis-enterprise, servicebus, signalr, sql, storage-blob, storage-file, storage-queue, storage-table, webpubsub
全局参数
--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 connection show

获取服务连接或本地连接的详细信息。

az connection show [--connection]
                   [--id]
                   [--location]
                   [--resource-group]

示例

以交互方式获取连接

az connection show

按连接名称获取连接

az connection show -g resourceGroup --connection MyConnection

按连接 ID 获取连接

az connection show --id /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}

可选参数

--connection

连接的名称。

--id

连接的 ID。

--location -l

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

--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 connection validate

验证服务连接或本地连接。

az connection validate [--connection]
                       [--id]
                       [--location]
                       [--resource-group]

示例

以交互方式验证连接

az connection validate

按连接名称验证连接

az connection validate -g resourceGroup --connection MyConnection

按连接 ID 验证连接

az connection validate --id /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}

可选参数

--connection

连接的名称。

--id

连接的 ID。

--location -l

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

--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 connection wait

将 CLI 置于等待状态,直到满足连接条件。

az connection wait [--connection]
                   [--created]
                   [--custom]
                   [--deleted]
                   [--exists]
                   [--id]
                   [--interval]
                   [--location]
                   [--resource-group]
                   [--timeout]
                   [--updated]

示例

等待连接成功创建。

az connection wait --id /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName} --created

可选参数

--connection

连接的名称。

--created

等待在“Succeeded”中使用“provisioningState”创建。

默认值: False
--custom

等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到删除为止。

默认值: False
--exists

等待资源存在。

默认值: False
--id

连接的 ID。

--interval

轮询间隔(以秒为单位)。

默认值: 30
--location -l

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

--resource-group -g

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

--timeout

最大等待(以秒为单位)。

默认值: 3600
--updated

等到 provisioningState 更新为“Succeeded”。

默认值: False
全局参数
--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 获取完整的调试日志。