az spring job
Note
This reference is part of the spring extension for the Azure CLI (version 2.56.0 or higher). 该扩展将在首次运行 az spring job 命令时自动安装。 Learn more about extensions.
此命令组处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
(仅限企业层)用于管理 Azure Spring Apps 服务的作业的命令。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az spring job create |
在 Azure Spring Apps 服务中创建新作业。 |
Extension | Preview |
az spring job delete |
删除 Azure Spring Apps 中的作业。 |
Extension | Preview |
az spring job deploy |
将项目部署到作业并更新相关配置。 |
Extension | Preview |
az spring job execution |
(仅限企业层)用于管理 Azure Spring Apps 服务的作业执行的命令。 |
Extension | Preview |
az spring job execution cancel |
取消作业执行。 |
Extension | Preview |
az spring job execution instance |
(仅限企业层)用于管理 Azure Spring Apps 服务的作业执行实例的命令。 |
Extension | Preview |
az spring job execution instance list |
列出作业执行的所有实例。 |
Extension | Preview |
az spring job execution list |
列出作业的所有执行。 |
Extension | Preview |
az spring job execution show |
显示作业执行的状态和结果。 |
Extension | Preview |
az spring job list |
列出 Azure Spring Apps 中的所有作业。 |
Extension | Preview |
az spring job logs |
显示作业执行实例的日志。 设置“-f/--follow”时,将流式传输日志。 |
Extension | Preview |
az spring job show |
在 Azure Spring Apps 中显示作业的详细信息。 |
Extension | Preview |
az spring job start |
启动作业的执行。 |
Extension | Preview |
az spring job update |
更新作业的配置。 |
Extension | Preview |
az spring job create
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
在 Azure Spring Apps 服务中创建新作业。
az spring job create --name
--resource-group
--service
[--args]
[--bind-config-server --bind-cs]
[--bind-service-registry --bind-sr]
[--cpu]
[--envs]
[--memory]
[--parallelism]
[--retry-limit]
[--secret-envs]
[--timeout]
示例
使用默认配置创建作业。
az spring job create -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup
必需参数
在指定的 Azure Spring Apps 实例中运行的作业的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
作业执行的参数。
自动将作业绑定到默认配置服务器。
自动将作业绑定到默认服务注册表。
CPU 资源数量。 应为 500m 或 CPU 核心数。
属性 | 值 |
---|---|
默认值: | 1 |
环境变量的非敏感属性。 设置“key[=value]”格式,并用空格分隔。
内存资源数量。 应为 512Mi 或 #Gi,例如 1Gi、3Gi。
属性 | 值 |
---|---|
默认值: | 2Gi |
要按执行运行的最大副本数。
失败作业之前的最大重试次数。
环境变量的敏感属性。 一旦放置,它将被加密,不会返回。设置“key[=value]”格式,并用空格分隔。
允许执行的最大秒数运行。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az spring job delete
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
删除 Azure Spring Apps 中的作业。
az spring job delete --name
--resource-group
--service
示例
删除作业
az spring job delete -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup
必需参数
在指定的 Azure Spring Apps 实例中运行的作业的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az spring job deploy
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
将项目部署到作业并更新相关配置。
az spring job deploy --name
--resource-group
--service
[--args]
[--artifact-path]
[--build-cpu]
[--build-env]
[--build-memory]
[--builder]
[--cpu]
[--disable-validation {false, true}]
[--envs]
[--memory]
[--no-wait]
[--parallelism]
[--retry-limit]
[--secret-envs]
[--source-path]
[--timeout]
[--version]
示例
使用环境变量将预生成的 jar 部署到作业。
az spring job deploy -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup --artifact-path app.jar --env foo=bar
将预生成的 jar 部署到具有生成 env 的作业。
az spring job deploy -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup --artifact-path app.jar --build-env BP_JVM_VERSION=11.*
必需参数
在指定的 Azure Spring Apps 实例中运行的作业的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
作业执行的参数。
部署指定的预生成项目(jar 或 netcore zip)。
CPU 资源数量。 应为 500m 或 CPU 核心数。
属性 | 值 |
---|---|
默认值: | 1 |
以“key[=value]”格式分隔的空间分隔环境变量。
内存资源数量。 应为 512Mi 或 #Gi,例如 1Gi、3Gi。
属性 | 值 |
---|---|
默认值: | 2Gi |
(仅限企业层)用于生成可执行文件的生成服务生成器。
属性 | 值 |
---|---|
默认值: | default |
CPU 资源数量。 应为 500m 或 CPU 核心数。
如果为 true,请禁用 jar 验证。
属性 | 值 |
---|---|
接受的值: | false, true |
环境变量的非敏感属性。 设置“key[=value]”格式,并用空格分隔。
内存资源数量。 应为 512Mi 或 #Gi,例如 1Gi、3Gi。
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
要按执行运行的最大副本数。
失败作业之前的最大重试次数。
环境变量的敏感属性。 一旦放置,它将被加密,不会返回。设置“key[=value]”格式,并用空格分隔。
部署指定的源文件夹。 该文件夹将打包到 tar 中,上传并使用 kpack 生成。 如果未提供任何值,则默认为当前文件夹。
属性 | 值 |
---|---|
Parameter group: | Source Code deploy Arguments |
允许执行的最大秒数运行。 可以使用 -1 重置超时。
部署版本,如果未设置,则保持不变。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az spring job list
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
列出 Azure Spring Apps 中的所有作业。
az spring job list --resource-group
--service
示例
List jobs
az spring job list -s MyAzureSpringAppsInstance -g MyResourceGroup
必需参数
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az spring job logs
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
显示作业执行实例的日志。 设置“-f/--follow”时,将流式传输日志。
az spring job logs --execution
--name
--resource-group
--service
[--all-instances]
[--follow]
[--instance]
[--limit]
[--lines]
[--max-log-requests]
[--since]
示例
显示作业执行的所有实例的日志。
az spring job logs --name job-name --execution job-execution-nam --all-instances -s MyService -g MyResourceGroup
显示作业执行的特定实例的日志。
az spring job logs --name job-name --execution job-execution-nam --instance job-execution-instance -s MyService -g MyResourceGroup
流式传输和监视作业执行的所有实例的日志。
az spring job logs --name job-name --execution job-execution-nam --all-instances --follow -s MyService -g MyResourceGroup
流式传输和监视作业执行的特定实例的日志。
az spring job logs --name job-name --execution job-execution-nam --instance MyJobExecutionInstance --follow -s MyService -g MyResourceGroup
必需参数
作业执行的名称。
在指定的 Azure Spring Apps 实例中运行的作业的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示获取作业执行的所有实例的日志的标志。
指示应流式传输日志的标志。
作业执行的现有实例的名称。 从命令 az spring job execution instance list
查找实例名称。
要返回的日志的最大基字节数。 上限编号为 2048。
属性 | 值 |
---|---|
默认值: | 2048 |
要显示的行数。 最大值为 10000。
属性 | 值 |
---|---|
默认值: | 100 |
指定所有实例获取日志时要遵循的最大并发日志数。
属性 | 值 |
---|---|
默认值: | 5 |
仅返回比相对持续时间(如 5s、2m 或 1h)的日志。 最大值为 1 小时。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az spring job show
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
在 Azure Spring Apps 中显示作业的详细信息。
az spring job show --name
--resource-group
--service
必需参数
在指定的 Azure Spring Apps 实例中运行的作业的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az spring job start
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
启动作业的执行。
az spring job start --name
--resource-group
--service
[--args]
[--cpu]
[--envs]
[--memory]
[--secret-envs]
[--wait-until-finished {false, true}]
示例
启动作业的执行
az spring job start -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup
必需参数
在指定的 Azure Spring Apps 实例中运行的作业的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
作业执行的参数。
CPU 资源数量。 应为 500m 或 CPU 核心数。
环境变量的非敏感属性。 设置“key[=value]”格式,并用空格分隔。
内存资源数量。 应为 512Mi 或 #Gi,例如 1Gi、3Gi。
环境变量的敏感属性。 一旦放置,它将被加密,不会返回。设置“key[=value]”格式,并用空格分隔。
如果为 true,请等待作业执行完成。
属性 | 值 |
---|---|
默认值: | False |
接受的值: | false, true |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az spring job update
命令组“spring job”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
更新作业的配置。
az spring job update --name
--resource-group
--service
[--args]
[--cpu]
[--envs]
[--memory]
[--parallelism]
[--retry-limit]
[--secret-envs]
[--timeout]
示例
为作业添加纯文本环境变量。
az spring job update -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup --envs foo=bar
删除所有纯文本环境变量,并保留作业的所有存在机密。
az spring job update -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup --envs
删除所有机密并保留作业的所有纯文本环境变量。
az spring job update -n job-name -s MyAzureSpringAppsInstance -g MyResourceGroup --secret-envs
必需参数
在指定的 Azure Spring Apps 实例中运行的作业的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure Spring Apps 实例的名称,可以使用 az configure --defaults spring=<name>
配置默认服务。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
作业执行的参数。
CPU 资源数量。 应为 500m 或 CPU 核心数。
环境变量的非敏感属性。 设置“key[=value]”格式,并用空格分隔。
内存资源数量。 应为 512Mi 或 #Gi,例如 1Gi、3Gi。
要按执行运行的最大副本数。
失败作业之前的最大重试次数。
环境变量的敏感属性。 一旦放置,它将被加密,不会返回。设置“key[=value]”格式,并用空格分隔。
允许执行的最大秒数运行。 可以使用 -1 重置超时。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |