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

Microsoft.AppPlatform Spring/apps/deployments 2023-01-01-preview

Bicep 资源定义

Spring/apps/deployments 资源类型可以使用面向以下操作进行部署:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.AppPlatform/Spring/apps/deployments 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.AppPlatform/Spring/apps/deployments@2023-01-01-preview' = {
  name: 'string'
  sku: {
    capacity: int
    name: 'string'
    tier: 'string'
  }
  parent: resourceSymbolicName
  properties: {
    active: bool
    deploymentSettings: {
      addonConfigs: {}
      containerProbeSettings: {
        disableProbe: bool
      }
      environmentVariables: {}
      livenessProbe: {
        disableProbe: bool
        failureThreshold: int
        initialDelaySeconds: int
        periodSeconds: int
        probeAction: {
          type: 'string'
          // For remaining properties, see ProbeAction objects
        }
        successThreshold: int
        timeoutSeconds: int
      }
      readinessProbe: {
        disableProbe: bool
        failureThreshold: int
        initialDelaySeconds: int
        periodSeconds: int
        probeAction: {
          type: 'string'
          // For remaining properties, see ProbeAction objects
        }
        successThreshold: int
        timeoutSeconds: int
      }
      resourceRequests: {
        cpu: 'string'
        memory: 'string'
      }
      scale: {
        maxReplicas: int
        minReplicas: int
        rules: [
          {
            azureQueue: {
              auth: [
                {
                  secretRef: 'string'
                  triggerParameter: 'string'
                }
              ]
              queueLength: int
              queueName: 'string'
            }
            custom: {
              auth: [
                {
                  secretRef: 'string'
                  triggerParameter: 'string'
                }
              ]
              metadata: {}
              type: 'string'
            }
            http: {
              auth: [
                {
                  secretRef: 'string'
                  triggerParameter: 'string'
                }
              ]
              metadata: {}
            }
            name: 'string'
            tcp: {
              auth: [
                {
                  secretRef: 'string'
                  triggerParameter: 'string'
                }
              ]
              metadata: {}
            }
          }
        ]
      }
      startupProbe: {
        disableProbe: bool
        failureThreshold: int
        initialDelaySeconds: int
        periodSeconds: int
        probeAction: {
          type: 'string'
          // For remaining properties, see ProbeAction objects
        }
        successThreshold: int
        timeoutSeconds: int
      }
      terminationGracePeriodSeconds: int
    }
    source: {
      version: 'string'
      type: 'string'
      // For remaining properties, see UserSourceInfo objects
    }
  }
}

ProbeAction 对象

设置 type 属性以指定对象的类型。

对于 ExecAction,请使用:

  type: 'ExecAction'
  command: [
    'string'
  ]

对于 HTTPGetAction,请使用:

  type: 'HTTPGetAction'
  path: 'string'
  scheme: 'string'

对于 TCPSocketAction,请使用:

  type: 'TCPSocketAction'

UserSourceInfo 对象

设置 type 属性以指定对象的类型。

对于 BuildResult,请使用:

  type: 'BuildResult'
  buildResultId: 'string'

对于 容器,请使用:

  type: 'Container'
  customContainer: {
    args: [
      'string'
    ]
    command: [
      'string'
    ]
    containerImage: 'string'
    imageRegistryCredential: {
      password: 'string'
      username: 'string'
    }
    languageFramework: 'string'
    server: 'string'
  }

对于 Jar,请使用:

  type: 'Jar'
  jvmOptions: 'string'
  relativePath: 'string'
  runtimeVersion: 'string'

对于 NetCoreZip,请使用:

  type: 'NetCoreZip'
  netCoreMainEntryPath: 'string'
  relativePath: 'string'
  runtimeVersion: 'string'

对于 “源”,请使用:

  type: 'Source'
  artifactSelector: 'string'
  relativePath: 'string'
  runtimeVersion: 'string'

属性值

Spring/apps/deployments

名称 说明
name 资源名称

了解如何在 Bicep 中设置子资源的名称和类型。
字符串 (必需)
sku 部署资源的 SKU Sku
父级 (parent) 在 Bicep 中,可以为子资源指定父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。

有关详细信息,请参阅 父资源之外的子资源
类型为 的资源的符号名称: 应用
properties 部署资源的属性 DeploymentResourceProperties

DeploymentResourceProperties

名称 说明
活动 指示部署是否处于活动状态 bool
deploymentSettings 部署的部署设置 DeploymentSettings
source 已上传部署的源信息。 UserSourceInfo

DeploymentSettings

名称 说明
addonConfigs 加载项集合 对象 (object)
containerProbeSettings 容器运行情况和就绪情况探测设置 ContainerProbeSettings
environmentVariables 环境变量的集合 对象 (object)
livenessProbe 应用实例运行情况的定期探测。 如果探测失败,将重启应用实例。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
readinessProbe 应用实例服务就绪情况的定期探测。 如果探测失败,将从服务终结点中删除应用实例。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
resourceRequests 所需 CPU 和内存的请求资源数量。 建议使用此字段来表示所需的 CPU 和内存,旧字段 cpu 和 memoryInGB 稍后将弃用。 ResourceRequests
scale Azure Spring Apps 应用实例的缩放属性。 缩放
startupProbe StartupProbe 指示应用实例已成功初始化。 如果指定,则在成功完成之前不会执行其他探测。 如果此探测失败,Pod 将重启,就像 livenessProbe 失败一样。 这可用于在应用实例生命周期开始时提供不同的探测参数,这可能需要很长时间才能加载数据或预热缓存,而不是在稳定状态操作期间。 这无法更新。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
terminationGracePeriodSeconds 应用实例需要正常终止的可选持续时间(以秒为单位)。 删除请求中可能会减少。 值必须是非负整数。 值零表示通过终止信号立即停止, (没有机会关闭) 。 如果此值为 nil,则将改用默认宽限期。 宽限期是向应用实例中运行的进程发送终止信号之后的持续时间(以秒为单位)以及进程被强行停止并发出终止信号的时间。 请将此值设置为大于你的进程的预期清理时间。 默认为 90 秒。 int

ContainerProbeSettings

名称 说明
disableProbe 指示是否禁用运行和就绪情况探测 bool

探测

名称 说明
disableProbe 指示探测是否已禁用。 bool (必需)
failureThreshold 在成功后,要视为探测失败的最小连续失败次数。 最小值为 1。 int
initialDelaySeconds 在启动探测之前,应用实例启动后的秒数。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes int
periodSeconds 执行探测的频率(以秒为单位)。 最小值为 1。 int
probeAction 探测的操作。 ProbeAction
successThreshold 探测在失败后被视为成功的最小连续成功。 对于活跃度和启动,必须为 1。 最小值为 1。 int
timeoutSeconds 探测超时的秒数。最小值为 1。 int

ProbeAction

名称 说明 Value
type 设置对象类型 ExecAction
HTTPGetAction
需要 TCPSocketAction ()

ExecAction

名称 说明 Value
type 执行运行状况检查要执行的操作的类型。 “ExecAction” (必需)
命令 命令是在容器内执行的命令行,命令的工作目录是容器文件系统中的根 ('/') 。 命令不在 shell 中运行,因此传统的 shell 指令 (“、”等) 不起作用。 若要使用 shell,需要显式调用该 shell。 退出状态 0 被视为实时/正常,非零为不正常。 string[]

HttpGetAction

名称 说明 Value
type 执行运行状况检查要执行的操作的类型。 “HTTPGetAction” (必需的)
path 在 HTTP 服务器上访问的路径。 字符串
scheme 用于连接到主机的方案。 默认为 HTTP。

可能的枚举值:
- "HTTP" 表示使用的方案为 http://
- "HTTPS" 表示使用的方案为 https://
“HTTP”
“HTTPS”

TCPSocketAction

名称 说明 Value
type 执行运行状况检查要执行的操作的类型。 “TCPSocketAction” (必需)

ResourceRequests

名称 说明
cpu 所需的 CPU。 1 个核心可以由 1 或 1000 米表示。 对于基本层,此值应为 500 米或 1,标准层应为 {500m,1,2,3,4}。 字符串
内存 所需的内存。 1 GB 可由 1Gi 或 1024Mi 表示。 对于基本层,这应为 {512Mi, 1Gi, 2Gi},对于标准层应为 {512Mi, 1Gi, 2Gi, ..., 8Gi}。 字符串

缩放

名称 说明
maxReplicas 可选。 容器副本的最大数目。 如果未设置,则默认为 10。 int
minReplicas 可选。 最小容器副本数。 int
规则 缩放规则。 ScaleRule[]

ScaleRule

名称 说明
azureQueue 基于 Azure 队列的缩放。 QueueScaleRule
自定义 自定义缩放规则。 CustomScaleRule
http 基于 HTTP 请求的缩放。 HttpScaleRule
name 缩放规则名称 字符串
tcp 基于 Tcp 请求的缩放。 TcpScaleRule

QueueScaleRule

名称 说明
auth 队列缩放规则的身份验证机密。 ScaleRuleAuth[]
queueLength 队列长度。 int
queueName 队列名称。 字符串

ScaleRuleAuth

名称 说明
secretRef 要从中提取身份验证参数的 Azure Spring Apps 应用实例机密的名称。 字符串
triggerParameter 使用机密的触发器参数 字符串

CustomScaleRule

名称 说明
auth 自定义缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 描述自定义缩放规则的元数据属性。 对象 (object)
类型 自定义缩放规则的类型
例如:azure-servicebus、redis 等。
字符串

HttpScaleRule

名称 说明
auth 自定义缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 用于描述 http 缩放规则的元数据属性。 对象 (object)

TcpScaleRule

名称 说明
auth tcp 缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 描述 tcp 缩放规则的元数据属性。 对象 (object)

UserSourceInfo

名称 说明
版本 源的版本 字符串
type 设置对象类型 BuildResult
容器
Jar
NetCoreZip
需要 ()

BuildResultUserSourceInfo

名称 说明 Value
type 上传的源的类型 “BuildResult” (必需)
buildResultId 同一 Spring 实例下现有成功生成结果的资源 ID。 字符串

CustomContainerUserSourceInfo

名称 说明 Value
type 上传的源的类型 需要“容器” ()
customContainer 自定义容器有效负载 CustomContainer

CustomContainer

名称 说明
args 入口点的参数。 如果未提供此 CMD,则使用 docker 映像的 CMD。 string[]
命令 入口点数组。 不在 shell 中执行。 如果未提供,将使用 docker 映像的 ENTRYPOINT。 string[]
containerImage 自定义容器的容器映像。 这应采用 {repository}:{tag} 的形式,不带注册表的服务器名称 字符串
imageRegistryCredential 映像注册表的凭据 ImageRegistryCredential
languageFramework 已上传的容器映像的语言框架 字符串
server 包含容器映像的注册表的名称 字符串

ImageRegistryCredential

名称 说明
password 映像注册表凭据的密码 字符串
username 映像注册表凭据的用户名 字符串

JarUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 需要“Jar” ()
jvmOptions JVM 参数 字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion Jar 文件的运行时版本 字符串

NetCoreZipUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 “NetCoreZip” (必需)
netCoreMainEntryPath 相对于 zip 根目录的 .NET 可执行文件的路径 字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion .Net 文件的运行时版本 字符串

SourceUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 “Source” (必需)
artifactSelector 用于多模块项目部署的项目选择器。 这应该是
目标模块/项目的相对路径。
字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion 源文件的运行时版本 字符串

SKU

名称 说明
容量 目标资源的当前容量 int
name SKU 的名称 字符串
SKU 的层 字符串

ARM 模板资源定义

Spring/apps/deployments 资源类型可以使用面向以下操作进行部署:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.AppPlatform/Spring/apps/deployments 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.AppPlatform/Spring/apps/deployments",
  "apiVersion": "2023-01-01-preview",
  "name": "string",
  "sku": {
    "capacity": "int",
    "name": "string",
    "tier": "string"
  },
  "properties": {
    "active": "bool",
    "deploymentSettings": {
      "addonConfigs": {},
      "containerProbeSettings": {
        "disableProbe": "bool"
      },
      "environmentVariables": {},
      "livenessProbe": {
        "disableProbe": "bool",
        "failureThreshold": "int",
        "initialDelaySeconds": "int",
        "periodSeconds": "int",
        "probeAction": {
          "type": "string"
          // For remaining properties, see ProbeAction objects
        },
        "successThreshold": "int",
        "timeoutSeconds": "int"
      },
      "readinessProbe": {
        "disableProbe": "bool",
        "failureThreshold": "int",
        "initialDelaySeconds": "int",
        "periodSeconds": "int",
        "probeAction": {
          "type": "string"
          // For remaining properties, see ProbeAction objects
        },
        "successThreshold": "int",
        "timeoutSeconds": "int"
      },
      "resourceRequests": {
        "cpu": "string",
        "memory": "string"
      },
      "scale": {
        "maxReplicas": "int",
        "minReplicas": "int",
        "rules": [
          {
            "azureQueue": {
              "auth": [
                {
                  "secretRef": "string",
                  "triggerParameter": "string"
                }
              ],
              "queueLength": "int",
              "queueName": "string"
            },
            "custom": {
              "auth": [
                {
                  "secretRef": "string",
                  "triggerParameter": "string"
                }
              ],
              "metadata": {},
              "type": "string"
            },
            "http": {
              "auth": [
                {
                  "secretRef": "string",
                  "triggerParameter": "string"
                }
              ],
              "metadata": {}
            },
            "name": "string",
            "tcp": {
              "auth": [
                {
                  "secretRef": "string",
                  "triggerParameter": "string"
                }
              ],
              "metadata": {}
            }
          }
        ]
      },
      "startupProbe": {
        "disableProbe": "bool",
        "failureThreshold": "int",
        "initialDelaySeconds": "int",
        "periodSeconds": "int",
        "probeAction": {
          "type": "string"
          // For remaining properties, see ProbeAction objects
        },
        "successThreshold": "int",
        "timeoutSeconds": "int"
      },
      "terminationGracePeriodSeconds": "int"
    },
    "source": {
      "version": "string",
      "type": "string"
      // For remaining properties, see UserSourceInfo objects
    }
  }
}

ProbeAction 对象

设置 type 属性以指定对象的类型。

对于 ExecAction,请使用:

  "type": "ExecAction",
  "command": [ "string" ]

对于 HTTPGetAction,请使用:

  "type": "HTTPGetAction",
  "path": "string",
  "scheme": "string"

对于 TCPSocketAction,请使用:

  "type": "TCPSocketAction"

UserSourceInfo 对象

设置 type 属性以指定对象的类型。

对于 BuildResult,请使用:

  "type": "BuildResult",
  "buildResultId": "string"

对于 容器,请使用:

  "type": "Container",
  "customContainer": {
    "args": [ "string" ],
    "command": [ "string" ],
    "containerImage": "string",
    "imageRegistryCredential": {
      "password": "string",
      "username": "string"
    },
    "languageFramework": "string",
    "server": "string"
  }

对于 Jar,请使用:

  "type": "Jar",
  "jvmOptions": "string",
  "relativePath": "string",
  "runtimeVersion": "string"

对于 NetCoreZip,请使用:

  "type": "NetCoreZip",
  "netCoreMainEntryPath": "string",
  "relativePath": "string",
  "runtimeVersion": "string"

对于 “源”,请使用:

  "type": "Source",
  "artifactSelector": "string",
  "relativePath": "string",
  "runtimeVersion": "string"

属性值

Spring/apps/deployments

名称 说明 Value
type 资源类型 'Microsoft.AppPlatform/Spring/apps/deployments'
apiVersion 资源 API 版本 '2023-01-01-preview'
name 资源名称

了解如何在 JSON ARM 模板中设置子资源的名称和类型。
字符串 (必需)
sku 部署资源的 SKU Sku
properties 部署资源的属性 DeploymentResourceProperties

DeploymentResourceProperties

名称 说明
活动 指示部署是否处于活动状态 bool
deploymentSettings 部署的部署设置 DeploymentSettings
source 已上传部署的源信息。 UserSourceInfo

DeploymentSettings

名称 说明
addonConfigs 加载项集合 对象 (object)
containerProbeSettings 容器运行情况和就绪情况探测设置 ContainerProbeSettings
environmentVariables 环境变量的集合 对象 (object)
livenessProbe 应用实例运行情况的定期探测。 如果探测失败,将重启应用实例。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
readinessProbe 应用实例服务就绪情况的定期探测。 如果探测失败,将从服务终结点中删除应用实例。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
resourceRequests 所需 CPU 和内存的请求资源数量。 建议使用此字段来表示所需的 CPU 和内存,旧字段 cpu 和 memoryInGB 稍后将弃用。 ResourceRequests
scale Azure Spring Apps 应用实例的缩放属性。 缩放
startupProbe StartupProbe 指示应用实例已成功初始化。 如果指定,则在成功完成之前,不会执行其他探测。 如果此探测失败,Pod 将重启,就像 livenessProbe 失败一样。 与在稳定状态操作期间相比,这可用于在应用实例生命周期开始时提供不同的探测参数,其中加载数据或预热缓存可能需要很长时间。 这无法更新。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
terminationGracePeriodSeconds 应用实例需要正常终止的可选持续时间(秒)。 删除请求中可能会减少。 值必须是非负整数。 值 0 指示通过终止信号立即停止, (没有机会关闭) 。 如果此值为 nil,则将改用默认宽限期。 宽限期是向应用实例中运行的进程发送终止信号后的持续时间(以秒为单位)以及以终止信号强行停止进程的时间。 请将此值设置为大于你的进程的预期清理时间。 默认为 90 秒。 int

ContainerProbeSettings

名称 说明
disableProbe 指示是否禁用运行情况和就绪情况探测 bool

探测

名称 说明
disableProbe 指示探测是否已禁用。 需要 bool ()
failureThreshold 在成功后,要被视为失败的探测的最小连续失败次数。 最小值为 1。 int
initialDelaySeconds 启动探测之前应用实例启动后的秒数。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes int
periodSeconds 执行探测的频率(以秒为单位)。 最小值为 1。 int
probeAction 探测的操作。 ProbeAction
successThreshold 失败后,要被视为成功的探测的最小连续成功。 对于运行和启动,必须为 1。 最小值为 1。 int
timeoutSeconds 探测超时的秒数。最小值为 1。 int

ProbeAction

名称 说明 Value
type 设置对象类型 ExecAction
HTTPGetAction
需要 TCPSocketAction ()

ExecAction

名称 说明 Value
type 执行运行状况检查所要执行的操作的类型。 需要“ExecAction” ()
命令 命令是在容器内执行的命令行,命令的工作目录是容器文件系统中的根 ('/') 。 命令不在 shell 中运行,因此传统的 shell 指令 ('、'等) 不起作用。 若要使用 shell,需要显式调用该 shell。 退出状态 0 被视为实时/正常,非零状态为不正常。 string[]

HttpGetAction

名称 说明 Value
type 执行运行状况检查所要执行的操作的类型。 “HTTPGetAction” (必需)
path HTTP 服务器上的访问路径。 字符串
scheme 用于连接到主机的方案。 默认为 HTTP。

可能的枚举值:
- "HTTP" 表示所使用的方案将为 http://
- "HTTPS" 表示所使用的方案将为 https://
'HTTP'
'HTTPS'

TCPSocketAction

名称 说明 Value
type 执行运行状况检查所要执行的操作的类型。 “TCPSocketAction” (必需)

ResourceRequests

名称 说明
cpu 所需的 CPU。 1 核可由 1 或 1000 米表示。 对于基本层,此值应为 500 米或 1,标准层应为 {500m, 1, 2, 3, 4}。 字符串
内存 所需内存。 1 GB 可由 1Gi 或 1024Mi 表示。 对于基本层,这应该是 {512Mi, 1Gi, 2Gi} ,对于标准层,应为 {512Mi, 1Gi, 2Gi, ..., 8Gi}。 字符串

缩放

名称 说明
maxReplicas 可选。 容器副本的最大数目。 如果未设置,则默认为 10。 int
minReplicas 可选。 最小容器副本数。 int
规则 缩放规则。 ScaleRule[]

ScaleRule

名称 说明
azureQueue 基于 Azure 队列的缩放。 QueueScaleRule
自定义 自定义缩放规则。 CustomScaleRule
http 基于 HTTP 请求的缩放。 HttpScaleRule
name 缩放规则名称 字符串
tcp 基于 Tcp 请求的缩放。 TcpScaleRule

QueueScaleRule

名称 说明
auth 队列缩放规则的身份验证机密。 ScaleRuleAuth[]
queueLength 队列长度。 int
queueName 队列名称。 字符串

ScaleRuleAuth

名称 说明
secretRef 要从中提取身份验证参数的 Azure Spring Apps 应用实例机密的名称。 字符串
triggerParameter 使用机密的触发器参数 字符串

CustomScaleRule

名称 说明
auth 自定义缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 用于描述自定义缩放规则的元数据属性。 对象 (object)
类型 自定义缩放规则的类型
例如:azure-servicebus、redis 等。
字符串

HttpScaleRule

名称 说明
auth 自定义缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 用于描述 http 缩放规则的元数据属性。 对象 (object)

TcpScaleRule

名称 说明
auth tcp 缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 描述 tcp 缩放规则的元数据属性。 对象 (object)

UserSourceInfo

名称 说明
版本 源的版本 字符串
type 设置对象类型 BuildResult
容器
Jar
NetCoreZip
需要 ()

BuildResultUserSourceInfo

名称 说明 Value
type 上传的源的类型 “BuildResult” (必需)
buildResultId 同一 Spring 实例下现有成功生成结果的资源 ID。 字符串

CustomContainerUserSourceInfo

名称 说明 Value
type 上传的源的类型 需要“容器” ()
customContainer 自定义容器有效负载 CustomContainer

CustomContainer

名称 说明
args 入口点的参数。 如果未提供此 CMD,则使用 docker 映像的 CMD。 string[]
命令 入口点数组。 不在 shell 中执行。 如果未提供,将使用 docker 映像的 ENTRYPOINT。 string[]
containerImage 自定义容器的容器映像。 这应采用 {repository}:{tag} 的形式,不带注册表的服务器名称 字符串
imageRegistryCredential 映像注册表的凭据 ImageRegistryCredential
languageFramework 已上传的容器映像的语言框架 字符串
server 包含容器映像的注册表的名称 字符串

ImageRegistryCredential

名称 说明
password 映像注册表凭据的密码 字符串
username 映像注册表凭据的用户名 字符串

JarUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 需要“Jar” ()
jvmOptions JVM 参数 字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion Jar 文件的运行时版本 字符串

NetCoreZipUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 “NetCoreZip” (必需)
netCoreMainEntryPath 相对于 zip 根目录的 .NET 可执行文件的路径 字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion .Net 文件的运行时版本 字符串

SourceUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 “Source” (必需)
artifactSelector 用于多模块项目部署的项目选择器。 这应该是
目标模块/项目的相对路径。
字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion 源文件的运行时版本 字符串

SKU

名称 说明
容量 目标资源的当前容量 int
name SKU 的名称 字符串
SKU 的层 字符串

Terraform (AzAPI 提供程序) 资源定义

Spring/apps/deployments 资源类型可以使用面向以下操作进行部署:

  • 资源组

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.AppPlatform/Spring/apps/deployments 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.AppPlatform/Spring/apps/deployments@2023-01-01-preview"
  name = "string"
  parent_id = "string"
  body = jsonencode({
    properties = {
      active = bool
      deploymentSettings = {
        addonConfigs = {}
        containerProbeSettings = {
          disableProbe = bool
        }
        environmentVariables = {}
        livenessProbe = {
          disableProbe = bool
          failureThreshold = int
          initialDelaySeconds = int
          periodSeconds = int
          probeAction = {
            type = "string"
            // For remaining properties, see ProbeAction objects
          }
          successThreshold = int
          timeoutSeconds = int
        }
        readinessProbe = {
          disableProbe = bool
          failureThreshold = int
          initialDelaySeconds = int
          periodSeconds = int
          probeAction = {
            type = "string"
            // For remaining properties, see ProbeAction objects
          }
          successThreshold = int
          timeoutSeconds = int
        }
        resourceRequests = {
          cpu = "string"
          memory = "string"
        }
        scale = {
          maxReplicas = int
          minReplicas = int
          rules = [
            {
              azureQueue = {
                auth = [
                  {
                    secretRef = "string"
                    triggerParameter = "string"
                  }
                ]
                queueLength = int
                queueName = "string"
              }
              custom = {
                auth = [
                  {
                    secretRef = "string"
                    triggerParameter = "string"
                  }
                ]
                metadata = {}
                type = "string"
              }
              http = {
                auth = [
                  {
                    secretRef = "string"
                    triggerParameter = "string"
                  }
                ]
                metadata = {}
              }
              name = "string"
              tcp = {
                auth = [
                  {
                    secretRef = "string"
                    triggerParameter = "string"
                  }
                ]
                metadata = {}
              }
            }
          ]
        }
        startupProbe = {
          disableProbe = bool
          failureThreshold = int
          initialDelaySeconds = int
          periodSeconds = int
          probeAction = {
            type = "string"
            // For remaining properties, see ProbeAction objects
          }
          successThreshold = int
          timeoutSeconds = int
        }
        terminationGracePeriodSeconds = int
      }
      source = {
        version = "string"
        type = "string"
        // For remaining properties, see UserSourceInfo objects
      }
    }
    sku = {
      capacity = int
      name = "string"
      tier = "string"
    }
  })
}

ProbeAction 对象

设置 type 属性以指定对象的类型。

对于 ExecAction,请使用:

  type = "ExecAction"
  command = [
    "string"
  ]

对于 HTTPGetAction,请使用:

  type = "HTTPGetAction"
  path = "string"
  scheme = "string"

对于 TCPSocketAction,请使用:

  type = "TCPSocketAction"

UserSourceInfo 对象

设置 type 属性以指定对象的类型。

对于 BuildResult,请使用:

  type = "BuildResult"
  buildResultId = "string"

对于 容器,请使用:

  type = "Container"
  customContainer = {
    args = [
      "string"
    ]
    command = [
      "string"
    ]
    containerImage = "string"
    imageRegistryCredential = {
      password = "string"
      username = "string"
    }
    languageFramework = "string"
    server = "string"
  }

对于 Jar,请使用:

  type = "Jar"
  jvmOptions = "string"
  relativePath = "string"
  runtimeVersion = "string"

对于 NetCoreZip,请使用:

  type = "NetCoreZip"
  netCoreMainEntryPath = "string"
  relativePath = "string"
  runtimeVersion = "string"

对于 “源”,请使用:

  type = "Source"
  artifactSelector = "string"
  relativePath = "string"
  runtimeVersion = "string"

属性值

Spring/apps/deployments

名称 说明 Value
type 资源类型 “Microsoft.AppPlatform/Spring/apps/deployments@2023-01-01-preview”
name 资源名称 字符串 (必需)
parent_id 此资源的父资源的 ID。 类型为的资源的 ID: 应用
sku 部署资源的 SKU Sku
properties 部署资源的属性 DeploymentResourceProperties

DeploymentResourceProperties

名称 说明
活动 指示部署是否处于活动状态 bool
deploymentSettings 部署的部署设置 DeploymentSettings
source 已上传部署的源信息。 UserSourceInfo

DeploymentSettings

名称 说明
addonConfigs 加载项集合 对象 (object)
containerProbeSettings 容器运行和就绪情况探测设置 ContainerProbeSettings
environmentVariables 环境变量的集合 对象 (object)
livenessProbe 定期探测应用实例的运行情况。 如果探测失败,将重启应用实例。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
readinessProbe 应用实例服务就绪情况的定期探测。 如果探测失败,将从服务终结点中删除应用实例。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
resourceRequests 所需 CPU 和内存的请求资源数量。 建议使用此字段来表示所需的 CPU 和内存,旧字段 cpu 和 memoryInGB 稍后将弃用。 ResourceRequests
scale Azure Spring Apps 应用实例的缩放属性。 缩放
startupProbe StartupProbe 指示应用实例已成功初始化。 如果指定,则在成功完成之前不会执行其他探测。 如果此探测失败,Pod 将重启,就像 livenessProbe 失败一样。 这可用于在应用实例生命周期开始时提供不同的探测参数,这可能需要很长时间才能加载数据或预热缓存,而不是在稳定状态操作期间。 这无法更新。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 探测
terminationGracePeriodSeconds 应用实例需要正常终止的可选持续时间(以秒为单位)。 删除请求中可能会减少。 值必须是非负整数。 值零表示通过终止信号立即停止, (没有机会关闭) 。 如果此值为 nil,则将改用默认宽限期。 宽限期是向应用实例中运行的进程发送终止信号之后的持续时间(以秒为单位)以及进程被强行停止并发出终止信号的时间。 请将此值设置为大于你的进程的预期清理时间。 默认为 90 秒。 int

ContainerProbeSettings

名称 说明
disableProbe 指示是否禁用运行和就绪情况探测 bool

探测

名称 说明
disableProbe 指示探测是否已禁用。 bool (必需)
failureThreshold 在成功后,要视为探测失败的最小连续失败次数。 最小值为 1。 int
initialDelaySeconds 在启动探测之前,应用实例启动后的秒数。 详细信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes int
periodSeconds 执行探测的频率(以秒为单位)。 最小值为 1。 int
probeAction 探测的操作。 ProbeAction
successThreshold 探测在失败后被视为成功的最小连续成功。 对于活跃度和启动,必须为 1。 最小值为 1。 int
timeoutSeconds 探测超时的秒数。最小值为 1。 int

ProbeAction

名称 说明 Value
type 设置对象类型 ExecAction
HTTPGetAction
需要 TCPSocketAction ()

ExecAction

名称 说明 Value
type 执行运行状况检查所要执行的操作的类型。 “ExecAction” (必需)
命令 命令是在容器内执行的命令行,命令的工作目录是容器文件系统中的根 ('/') 。 命令不在 shell 中运行,因此传统的 shell 指令 ('、'等) 不起作用。 若要使用 shell,需要显式调用该 shell。 退出状态 0 被视为实时/正常,非零状态为不正常。 string[]

HttpGetAction

名称 说明 Value
type 执行运行状况检查所要执行的操作的类型。 需要“HTTPGetAction” ()
path HTTP 服务器上的访问路径。 字符串
scheme 用于连接到主机的方案。 默认为 HTTP。

可能的枚举值:
- "HTTP" 表示所使用的方案将为 http://
- "HTTPS" 表示所使用的方案将为 https://
"HTTP"
“HTTPS”

TCPSocketAction

名称 说明 Value
type 执行运行状况检查所要执行的操作的类型。 “TCPSocketAction” (必需)

ResourceRequests

名称 说明
cpu 所需的 CPU。 1 核可由 1 或 1000 米表示。 对于基本层,此值应为 500 米或 1,标准层应为 {500m, 1, 2, 3, 4}。 字符串
内存 所需内存。 1 GB 可由 1Gi 或 1024Mi 表示。 对于基本层,这应该是 {512Mi, 1Gi, 2Gi} ,对于标准层,应为 {512Mi, 1Gi, 2Gi, ..., 8Gi}。 字符串

缩放

名称 说明
maxReplicas 可选。 容器副本的最大数目。 如果未设置,则默认为 10。 int
minReplicas 可选。 最小容器副本数。 int
规则 缩放规则。 ScaleRule[]

ScaleRule

名称 说明
azureQueue 基于 Azure 队列的缩放。 QueueScaleRule
自定义 自定义缩放规则。 CustomScaleRule
http 基于 HTTP 请求的缩放。 HttpScaleRule
name 缩放规则名称 字符串
tcp 基于 Tcp 请求的缩放。 TcpScaleRule

QueueScaleRule

名称 说明
auth 队列缩放规则的身份验证机密。 ScaleRuleAuth[]
queueLength 队列长度。 int
queueName 队列名称。 字符串

ScaleRuleAuth

名称 说明
secretRef 要从中提取身份验证参数的 Azure Spring Apps 应用实例机密的名称。 字符串
triggerParameter 使用机密的触发器参数 字符串

CustomScaleRule

名称 说明
auth 自定义缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 用于描述自定义缩放规则的元数据属性。 对象 (object)
类型 自定义缩放规则的类型
例如:azure-servicebus、redis 等。
字符串

HttpScaleRule

名称 说明
auth 自定义缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 用于描述 http 缩放规则的元数据属性。 对象 (object)

TcpScaleRule

名称 说明
auth tcp 缩放规则的身份验证机密。 ScaleRuleAuth[]
metadata 描述 tcp 缩放规则的元数据属性。 对象 (object)

UserSourceInfo

名称 说明
版本 源的版本 字符串
type 设置对象类型 BuildResult
容器
Jar
NetCoreZip
需要 ()

BuildResultUserSourceInfo

名称 说明 Value
type 上传的源的类型 “BuildResult” (必需)
buildResultId 同一 Spring 实例下现有成功生成结果的资源 ID。 字符串

CustomContainerUserSourceInfo

名称 说明 Value
type 上传的源的类型 需要“容器” ()
customContainer 自定义容器有效负载 CustomContainer

CustomContainer

名称 说明
args 入口点的参数。 如果未提供此 CMD,则使用 docker 映像的 CMD。 string[]
命令 入口点数组。 不在 shell 中执行。 如果未提供,将使用 docker 映像的 ENTRYPOINT。 string[]
containerImage 自定义容器的容器映像。 这应采用 {repository}:{tag} 的形式,不带注册表的服务器名称 字符串
imageRegistryCredential 映像注册表的凭据 ImageRegistryCredential
languageFramework 已上传的容器映像的语言框架 字符串
server 包含容器映像的注册表的名称 字符串

ImageRegistryCredential

名称 说明
password 映像注册表凭据的密码 字符串
username 映像注册表凭据的用户名 字符串

JarUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 需要“Jar” ()
jvmOptions JVM 参数 字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion Jar 文件的运行时版本 字符串

NetCoreZipUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 “NetCoreZip” (必需)
netCoreMainEntryPath 相对于 zip 根目录的 .NET 可执行文件的路径 字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion .Net 文件的运行时版本 字符串

SourceUploadedUserSourceInfo

名称 说明 Value
type 上传的源的类型 需要“源” ()
artifactSelector 用于多模块项目部署的项目选择器。 这应该是
目标模块/项目的相对路径。
字符串
relativePath 存储源的存储的相对路径 字符串
runtimeVersion 源文件的运行时版本 字符串

SKU

名称 说明
容量 目标资源的当前容量 int
name SKU 的名称 字符串
SKU 的层 字符串