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

az containerapp session code-interpreter

注意

此参考是 Azure CLI(版本 2.53.0 或更高版本)的容器应用扩展的一部分。 该扩展将在首次运行 az containerapp session code-interpreter 命令时自动安装。 详细了解扩展。

此命令组处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

用于与代码解释器会话交互和管理的命令。

命令

名称 说明 类型 状态
az containerapp session code-interpreter delete-file

删除上传到代码解释器会话的文件。

扩展 预览
az containerapp session code-interpreter execute

在代码解释器会话中执行代码。

扩展 预览
az containerapp session code-interpreter list-files

列出上传到代码解释器会话的文件。

扩展 预览
az containerapp session code-interpreter show-file-content

显示上传到代码解释器会话的文件的内容。

扩展 预览
az containerapp session code-interpreter show-file-metadata

显示上传到代码解释器会话的文件的元数据内容。

扩展 预览
az containerapp session code-interpreter upload-file

将文件上传到代码解释器会话。

扩展 预览

az containerapp session code-interpreter delete-file

预览

命令组“containerapp 会话代码解释器”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

删除上传到代码解释器会话的文件。

az containerapp session code-interpreter delete-file --filename
                                                     --identifier
                                                     --resource-group
                                                     [--ids]
                                                     [--name]
                                                     [--no-wait]
                                                     [--session-pool-location]
                                                     [--subscription]
                                                     [--yes]

示例

删除文件。

az containerapp session code-interpreter delete-file -n MySessionPool -g MyResourceGroup --identifier MySession \ --filename example.txt

必需参数

--filename

要从会话中删除或显示的文件。

--identifier -i

会话标识符。

--resource-group -g

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

会话池名称。

--no-wait

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

默认值: False
--session-pool-location

会话池的位置。

--subscription

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

--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 containerapp session code-interpreter execute

预览

命令组“containerapp 会话代码解释器”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

在代码解释器会话中执行代码。

az containerapp session code-interpreter execute --code
                                                 --identifier
                                                 --resource-group
                                                 [--ids]
                                                 [--name]
                                                 [--no-wait]
                                                 [--session-pool-location]
                                                 [--subscription]
                                                 [--timeout-in-seconds]

示例

执行简单的 hello world。

az containerapp session code-interpreter execute -n MySessionPool -g MyResourceGroup --identifier MySession \
    --code 'print("'"Hello world"'")' --timeout-in-seconds 30 --session-pool-location eastasia

必需参数

--code

在代码解释器会话中执行的代码。

--identifier -i

会话标识符。

--resource-group -g

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

会话池名称。

--no-wait

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

默认值: False
--session-pool-location

会话池的位置。

--subscription

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

--timeout-in-seconds

会话中的持续时间(以秒为单位)代码可以在超时 0 - 60 秒之前运行,例如 30 秒。

默认值: 60
全局参数
--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 containerapp session code-interpreter list-files

预览

命令组“containerapp 会话代码解释器”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

列出上传到代码解释器会话的文件。

az containerapp session code-interpreter list-files --identifier
                                                    --resource-group
                                                    [--ids]
                                                    [--name]
                                                    [--path]
                                                    [--session-pool-location]
                                                    [--subscription]

示例

列出在代码解释器会话中上传的文件。

az containerapp session code-interpreter list-files -n MySessionPool -g MyResourceGroup --identifier MySession

必需参数

--identifier -i

会话标识符。

--resource-group -g

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

会话池名称。

--path

从会话列出文件的路径。

--session-pool-location

会话池的位置。

--subscription

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

全局参数
--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 containerapp session code-interpreter show-file-content

预览

命令组“containerapp 会话代码解释器”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

显示上传到代码解释器会话的文件的内容。

az containerapp session code-interpreter show-file-content --filename
                                                           --identifier
                                                           --resource-group
                                                           [--ids]
                                                           [--name]
                                                           [--session-pool-location]
                                                           [--subscription]

示例

显示文件的内容。

az containerapp session code-interpreter show-file-content -n MySessionPool -g MyResourceGroup --identifier MySession \ --filename example.txt

必需参数

--filename

要从会话中删除或显示的文件。

--identifier -i

会话标识符。

--resource-group -g

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

会话池名称。

--session-pool-location

会话池的位置。

--subscription

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

全局参数
--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 containerapp session code-interpreter show-file-metadata

预览

命令组“containerapp 会话代码解释器”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

显示上传到代码解释器会话的文件的元数据内容。

az containerapp session code-interpreter show-file-metadata --filename
                                                            --identifier
                                                            --resource-group
                                                            [--ids]
                                                            [--name]
                                                            [--session-pool-location]
                                                            [--subscription]

示例

显示上传到会话的文件的元数据详细信息。

az containerapp session code-interpreter show-file-metadata -n MySessionPool -g MyResourceGroup --identifier MySession \ --filename example.txt

必需参数

--filename

要从会话中删除或显示的文件。

--identifier -i

会话标识符。

--resource-group -g

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

会话池名称。

--session-pool-location

会话池的位置。

--subscription

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

全局参数
--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 containerapp session code-interpreter upload-file

预览

命令组“containerapp 会话代码解释器”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

将文件上传到代码解释器会话。

az containerapp session code-interpreter upload-file --filepath
                                                     --identifier
                                                     --resource-group
                                                     [--ids]
                                                     [--name]
                                                     [--no-wait]
                                                     [--session-pool-location]
                                                     [--subscription]

示例

将文件上传到会话。

az containerapp session code-interpreter upload-file -n MySessionPool -g MyResourceGroup --identifier MySession \
    --filepath example.txt

必需参数

--filepath

要上传到会话的文件的本地路径。

--identifier -i

会话标识符。

--resource-group -g

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

会话池名称。

--no-wait

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

默认值: False
--session-pool-location

会话池的位置。

--subscription

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

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