Article 12/09/2024
2 contributors
Feedback
In this article
Bicep resource definition
The Spring/apps/deployments resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log .
To create a Microsoft.AppPlatform/Spring/apps/deployments resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.AppPlatform/Spring/apps/deployments@2023-07-01-preview' = {
parent: resourceSymbolicName
name: 'string'
properties: {
active: bool
deploymentSettings: {
addonConfigs: {
{customized property}: any(...)
}
apms: [
{
resourceId: 'string'
}
]
containerProbeSettings: {
disableProbe: bool
}
environmentVariables: {
{customized property}: 'string'
}
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: {
{customized property}: 'string'
}
type: 'string'
}
http: {
auth: [
{
secretRef: 'string'
triggerParameter: 'string'
}
]
metadata: {
{customized property}: 'string'
}
}
name: 'string'
tcp: {
auth: [
{
secretRef: 'string'
triggerParameter: 'string'
}
]
metadata: {
{customized property}: 'string'
}
}
}
]
}
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 objects
Set the type property to specify the type of object.
For ExecAction , use:
{
command: [
'string'
]
type: 'ExecAction'
}
For HTTPGetAction , use:
{
path: 'string'
scheme: 'string'
type: 'HTTPGetAction'
}
For TCPSocketAction , use:
{
type: 'TCPSocketAction'
}
UserSourceInfo objects
Set the type property to specify the type of object.
For BuildResult , use:
{
buildResultId: 'string'
type: 'BuildResult'
}
For Container , use:
{
customContainer: {
args: [
'string'
]
command: [
'string'
]
containerImage: 'string'
imageRegistryCredential: {
password: 'string'
username: 'string'
}
languageFramework: 'string'
server: 'string'
}
type: 'Container'
}
For Jar , use:
{
jvmOptions: 'string'
relativePath: 'string'
runtimeVersion: 'string'
type: 'Jar'
}
For NetCoreZip , use:
{
netCoreMainEntryPath: 'string'
relativePath: 'string'
runtimeVersion: 'string'
type: 'NetCoreZip'
}
For Source , use:
{
artifactSelector: 'string'
relativePath: 'string'
runtimeVersion: 'string'
type: 'Source'
}
Property Values
ApmReference
Name
Description
Value
resourceId
Resource Id of the APM
string (required)
BuildResultUserSourceInfo
Name
Description
Value
buildResultId
Resource id of an existing succeeded build result under the same Spring instance.
string
type
Type of the source uploaded
'BuildResult' (required)
ContainerProbeSettings
Name
Description
Value
disableProbe
Indicates whether disable the liveness and readiness probe
bool
CustomContainer
Name
Description
Value
args
Arguments to the entrypoint. The docker image's CMD is used if this is not provided.
string[]
command
Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.
string[]
containerImage
Container image of the custom container. This should be in the form of <repository>:<tag> without the server name of the registry
string
imageRegistryCredential
Credential of the image registry
ImageRegistryCredential
languageFramework
Language framework of the container image uploaded. Supported values: "springboot", "", null.
string
server
The name of the registry that contains the container image
string
CustomContainerUserSourceInfo
Name
Description
Value
customContainer
Custom container payload
CustomContainer
type
Type of the source uploaded
'Container' (required)
CustomScaleRule
Name
Description
Value
auth
Authentication secrets for the custom scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe custom scale rule.
CustomScaleRuleMetadata
type
Type of the custom scale rule eg: azure-servicebus, redis etc.
string
DeploymentResourceProperties
Name
Description
Value
active
Indicates whether the Deployment is active
bool
deploymentSettings
Deployment settings of the Deployment
DeploymentSettings
source
Uploaded source information of the deployment.
UserSourceInfo
DeploymentSettings
Name
Description
Value
addonConfigs
Collection of addons
DeploymentSettingsAddonConfigs
apms
Collection of ApmReferences
ApmReference []
containerProbeSettings
Container liveness and readiness probe settings
ContainerProbeSettings
environmentVariables
Collection of environment variables
DeploymentSettingsEnvironmentVariables
livenessProbe
Periodic probe of App Instance liveness. App Instance will be restarted if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
readinessProbe
Periodic probe of App Instance service readiness. App Instance will be removed from service endpoints if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
resourceRequests
The requested resource quantity for required CPU and Memory. It is recommended that using this field to represent the required CPU and Memory, the old field cpu and memoryInGB will be deprecated later.
ResourceRequests
scale
Scaling properties for the Azure Spring Apps App Instance.
Scale
startupProbe
StartupProbe indicates that the App Instance has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a App Instance's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
terminationGracePeriodSeconds
Optional duration in seconds the App Instance needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the App Instance are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 90 seconds.
int
DeploymentSettingsAddonConfigs
DeploymentSettingsEnvironmentVariables
ExecAction
Name
Description
Value
command
Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is not run inside a shell, so traditional shell instructions ('
', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
string[]
type
The type of the action to take to perform the health check.
'ExecAction' (required)
HttpGetAction
Name
Description
Value
path
Path to access on the HTTP server.
string
scheme
Scheme to use for connecting to the host. Defaults to HTTP. Possible enum values: - "HTTP"
means that the scheme used will be http:// - "HTTPS"
means that the scheme used will be https://
'HTTP' 'HTTPS'
type
The type of the action to take to perform the health check.
'HTTPGetAction' (required)
HttpScaleRule
Name
Description
Value
auth
Authentication secrets for the custom scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe http scale rule.
HttpScaleRuleMetadata
ImageRegistryCredential
Name
Description
Value
password
The password of the image registry credential
string
username
The username of the image registry credential
string
JarUploadedUserSourceInfo
Name
Description
Value
jvmOptions
JVM parameter
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the Jar file
string
type
Type of the source uploaded
'Jar' (required)
Name
Description
Value
name
The resource name
string (required)
parent
In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource. For more information, see Child resource outside parent resource .
Symbolic name for resource of type: Spring/apps
properties
Properties of the Deployment resource
DeploymentResourceProperties
sku
Sku of the Deployment resource
Sku
NetCoreZipUploadedUserSourceInfo
Name
Description
Value
netCoreMainEntryPath
The path to the .NET executable relative to zip root
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the .Net file
string
type
Type of the source uploaded
'NetCoreZip' (required)
Probe
Name
Description
Value
disableProbe
Indicate whether the probe is disabled.
bool (required)
failureThreshold
Minimum consecutive failures for the probe to be considered failed after having succeeded. Minimum value is 1.
int
initialDelaySeconds
Number of seconds after the App Instance has started before probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
int
periodSeconds
How often (in seconds) to perform the probe. Minimum value is 1.
int
probeAction
The action of the probe.
ProbeAction
successThreshold
Minimum consecutive successes for the probe to be considered successful after having failed. Must be 1 for liveness and startup. Minimum value is 1.
int
timeoutSeconds
Number of seconds after which the probe times out. Minimum value is 1.
int
ProbeAction
Name
Description
Value
type
Set to 'ExecAction' for type ExecAction . Set to 'HTTPGetAction' for type HttpGetAction . Set to 'TCPSocketAction' for type TCPSocketAction .
'ExecAction' 'HTTPGetAction' 'TCPSocketAction' (required)
QueueScaleRule
Name
Description
Value
auth
Authentication secrets for the queue scale rule.
ScaleRuleAuth []
queueLength
Queue length.
int
queueName
Queue name.
string
ResourceRequests
Name
Description
Value
cpu
Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic tier, and {500m, 1, 2, 3, 4} for Standard tier.
string
memory
Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier.
string
Scale
Name
Description
Value
maxReplicas
Optional. Maximum number of container replicas. Defaults to 10 if not set.
int
minReplicas
Optional. Minimum number of container replicas.
int
rules
Scaling rules.
ScaleRule []
ScaleRule
ScaleRuleAuth
Name
Description
Value
secretRef
Name of the Azure Spring Apps App Instance secret from which to pull the auth params.
string
triggerParameter
Trigger Parameter that uses the secret
string
Sku
Name
Description
Value
capacity
Current capacity of the target resource
int
name
Name of the Sku
string
tier
Tier of the Sku
string
SourceUploadedUserSourceInfo
Name
Description
Value
artifactSelector
Selector for the artifact to be used for the deployment for multi-module projects. This should be the relative path to the target module/project.
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the source file
string
type
Type of the source uploaded
'Source' (required)
TcpScaleRule
Name
Description
Value
auth
Authentication secrets for the tcp scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe tcp scale rule.
TcpScaleRuleMetadata
TCPSocketAction
Name
Description
Value
type
The type of the action to take to perform the health check.
'TCPSocketAction' (required)
UserSourceInfo
Usage Examples
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
ARM template resource definition
The Spring/apps/deployments resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log .
To create a Microsoft.AppPlatform/Spring/apps/deployments resource, add the following JSON to your template.
{
"type": "Microsoft.AppPlatform/Spring/apps/deployments",
"apiVersion": "2023-07-01-preview",
"name": "string",
"properties": {
"active": "bool",
"deploymentSettings": {
"addonConfigs": {
"{customized property}": {}
},
"apms": [
{
"resourceId": "string"
}
],
"containerProbeSettings": {
"disableProbe": "bool"
},
"environmentVariables": {
"{customized property}": "string"
},
"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": {
"{customized property}": "string"
},
"type": "string"
},
"http": {
"auth": [
{
"secretRef": "string",
"triggerParameter": "string"
}
],
"metadata": {
"{customized property}": "string"
}
},
"name": "string",
"tcp": {
"auth": [
{
"secretRef": "string",
"triggerParameter": "string"
}
],
"metadata": {
"{customized property}": "string"
}
}
}
]
},
"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 objects
Set the type property to specify the type of object.
For ExecAction , use:
{
"command": [ "string" ],
"type": "ExecAction"
}
For HTTPGetAction , use:
{
"path": "string",
"scheme": "string",
"type": "HTTPGetAction"
}
For TCPSocketAction , use:
{
"type": "TCPSocketAction"
}
UserSourceInfo objects
Set the type property to specify the type of object.
For BuildResult , use:
{
"buildResultId": "string",
"type": "BuildResult"
}
For Container , use:
{
"customContainer": {
"args": [ "string" ],
"command": [ "string" ],
"containerImage": "string",
"imageRegistryCredential": {
"password": "string",
"username": "string"
},
"languageFramework": "string",
"server": "string"
},
"type": "Container"
}
For Jar , use:
{
"jvmOptions": "string",
"relativePath": "string",
"runtimeVersion": "string",
"type": "Jar"
}
For NetCoreZip , use:
{
"netCoreMainEntryPath": "string",
"relativePath": "string",
"runtimeVersion": "string",
"type": "NetCoreZip"
}
For Source , use:
{
"artifactSelector": "string",
"relativePath": "string",
"runtimeVersion": "string",
"type": "Source"
}
Property Values
ApmReference
Name
Description
Value
resourceId
Resource Id of the APM
string (required)
BuildResultUserSourceInfo
Name
Description
Value
buildResultId
Resource id of an existing succeeded build result under the same Spring instance.
string
type
Type of the source uploaded
'BuildResult' (required)
ContainerProbeSettings
Name
Description
Value
disableProbe
Indicates whether disable the liveness and readiness probe
bool
CustomContainer
Name
Description
Value
args
Arguments to the entrypoint. The docker image's CMD is used if this is not provided.
string[]
command
Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.
string[]
containerImage
Container image of the custom container. This should be in the form of <repository>:<tag> without the server name of the registry
string
imageRegistryCredential
Credential of the image registry
ImageRegistryCredential
languageFramework
Language framework of the container image uploaded. Supported values: "springboot", "", null.
string
server
The name of the registry that contains the container image
string
CustomContainerUserSourceInfo
Name
Description
Value
customContainer
Custom container payload
CustomContainer
type
Type of the source uploaded
'Container' (required)
CustomScaleRule
Name
Description
Value
auth
Authentication secrets for the custom scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe custom scale rule.
CustomScaleRuleMetadata
type
Type of the custom scale rule eg: azure-servicebus, redis etc.
string
DeploymentResourceProperties
Name
Description
Value
active
Indicates whether the Deployment is active
bool
deploymentSettings
Deployment settings of the Deployment
DeploymentSettings
source
Uploaded source information of the deployment.
UserSourceInfo
DeploymentSettings
Name
Description
Value
addonConfigs
Collection of addons
DeploymentSettingsAddonConfigs
apms
Collection of ApmReferences
ApmReference []
containerProbeSettings
Container liveness and readiness probe settings
ContainerProbeSettings
environmentVariables
Collection of environment variables
DeploymentSettingsEnvironmentVariables
livenessProbe
Periodic probe of App Instance liveness. App Instance will be restarted if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
readinessProbe
Periodic probe of App Instance service readiness. App Instance will be removed from service endpoints if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
resourceRequests
The requested resource quantity for required CPU and Memory. It is recommended that using this field to represent the required CPU and Memory, the old field cpu and memoryInGB will be deprecated later.
ResourceRequests
scale
Scaling properties for the Azure Spring Apps App Instance.
Scale
startupProbe
StartupProbe indicates that the App Instance has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a App Instance's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
terminationGracePeriodSeconds
Optional duration in seconds the App Instance needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the App Instance are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 90 seconds.
int
DeploymentSettingsAddonConfigs
DeploymentSettingsEnvironmentVariables
ExecAction
Name
Description
Value
command
Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is not run inside a shell, so traditional shell instructions ('
', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
string[]
type
The type of the action to take to perform the health check.
'ExecAction' (required)
HttpGetAction
Name
Description
Value
path
Path to access on the HTTP server.
string
scheme
Scheme to use for connecting to the host. Defaults to HTTP. Possible enum values: - "HTTP"
means that the scheme used will be http:// - "HTTPS"
means that the scheme used will be https://
'HTTP' 'HTTPS'
type
The type of the action to take to perform the health check.
'HTTPGetAction' (required)
HttpScaleRule
Name
Description
Value
auth
Authentication secrets for the custom scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe http scale rule.
HttpScaleRuleMetadata
ImageRegistryCredential
Name
Description
Value
password
The password of the image registry credential
string
username
The username of the image registry credential
string
JarUploadedUserSourceInfo
Name
Description
Value
jvmOptions
JVM parameter
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the Jar file
string
type
Type of the source uploaded
'Jar' (required)
Name
Description
Value
apiVersion
The api version
'2023-07-01-preview'
name
The resource name
string (required)
properties
Properties of the Deployment resource
DeploymentResourceProperties
sku
Sku of the Deployment resource
Sku
type
The resource type
'Microsoft.AppPlatform/Spring/apps/deployments'
NetCoreZipUploadedUserSourceInfo
Name
Description
Value
netCoreMainEntryPath
The path to the .NET executable relative to zip root
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the .Net file
string
type
Type of the source uploaded
'NetCoreZip' (required)
Probe
Name
Description
Value
disableProbe
Indicate whether the probe is disabled.
bool (required)
failureThreshold
Minimum consecutive failures for the probe to be considered failed after having succeeded. Minimum value is 1.
int
initialDelaySeconds
Number of seconds after the App Instance has started before probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
int
periodSeconds
How often (in seconds) to perform the probe. Minimum value is 1.
int
probeAction
The action of the probe.
ProbeAction
successThreshold
Minimum consecutive successes for the probe to be considered successful after having failed. Must be 1 for liveness and startup. Minimum value is 1.
int
timeoutSeconds
Number of seconds after which the probe times out. Minimum value is 1.
int
ProbeAction
Name
Description
Value
type
Set to 'ExecAction' for type ExecAction . Set to 'HTTPGetAction' for type HttpGetAction . Set to 'TCPSocketAction' for type TCPSocketAction .
'ExecAction' 'HTTPGetAction' 'TCPSocketAction' (required)
QueueScaleRule
Name
Description
Value
auth
Authentication secrets for the queue scale rule.
ScaleRuleAuth []
queueLength
Queue length.
int
queueName
Queue name.
string
ResourceRequests
Name
Description
Value
cpu
Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic tier, and {500m, 1, 2, 3, 4} for Standard tier.
string
memory
Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier.
string
Scale
Name
Description
Value
maxReplicas
Optional. Maximum number of container replicas. Defaults to 10 if not set.
int
minReplicas
Optional. Minimum number of container replicas.
int
rules
Scaling rules.
ScaleRule []
ScaleRule
ScaleRuleAuth
Name
Description
Value
secretRef
Name of the Azure Spring Apps App Instance secret from which to pull the auth params.
string
triggerParameter
Trigger Parameter that uses the secret
string
Sku
Name
Description
Value
capacity
Current capacity of the target resource
int
name
Name of the Sku
string
tier
Tier of the Sku
string
SourceUploadedUserSourceInfo
Name
Description
Value
artifactSelector
Selector for the artifact to be used for the deployment for multi-module projects. This should be the relative path to the target module/project.
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the source file
string
type
Type of the source uploaded
'Source' (required)
TcpScaleRule
Name
Description
Value
auth
Authentication secrets for the tcp scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe tcp scale rule.
TcpScaleRuleMetadata
TCPSocketAction
Name
Description
Value
type
The type of the action to take to perform the health check.
'TCPSocketAction' (required)
UserSourceInfo
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
The Spring/apps/deployments resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log .
To create a Microsoft.AppPlatform/Spring/apps/deployments resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.AppPlatform/Spring/apps/deployments@2023-07-01-preview"
name = "string"
sku = {
capacity = int
name = "string"
tier = "string"
}
body = jsonencode({
properties = {
active = bool
deploymentSettings = {
addonConfigs = {
{customized property} = ?
}
apms = [
{
resourceId = "string"
}
]
containerProbeSettings = {
disableProbe = bool
}
environmentVariables = {
{customized property} = "string"
}
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 = {
{customized property} = "string"
}
type = "string"
}
http = {
auth = [
{
secretRef = "string"
triggerParameter = "string"
}
]
metadata = {
{customized property} = "string"
}
}
name = "string"
tcp = {
auth = [
{
secretRef = "string"
triggerParameter = "string"
}
]
metadata = {
{customized property} = "string"
}
}
}
]
}
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 objects
Set the type property to specify the type of object.
For ExecAction , use:
{
command = [
"string"
]
type = "ExecAction"
}
For HTTPGetAction , use:
{
path = "string"
scheme = "string"
type = "HTTPGetAction"
}
For TCPSocketAction , use:
{
type = "TCPSocketAction"
}
UserSourceInfo objects
Set the type property to specify the type of object.
For BuildResult , use:
{
buildResultId = "string"
type = "BuildResult"
}
For Container , use:
{
customContainer = {
args = [
"string"
]
command = [
"string"
]
containerImage = "string"
imageRegistryCredential = {
password = "string"
username = "string"
}
languageFramework = "string"
server = "string"
}
type = "Container"
}
For Jar , use:
{
jvmOptions = "string"
relativePath = "string"
runtimeVersion = "string"
type = "Jar"
}
For NetCoreZip , use:
{
netCoreMainEntryPath = "string"
relativePath = "string"
runtimeVersion = "string"
type = "NetCoreZip"
}
For Source , use:
{
artifactSelector = "string"
relativePath = "string"
runtimeVersion = "string"
type = "Source"
}
Property Values
ApmReference
Name
Description
Value
resourceId
Resource Id of the APM
string (required)
BuildResultUserSourceInfo
Name
Description
Value
buildResultId
Resource id of an existing succeeded build result under the same Spring instance.
string
type
Type of the source uploaded
'BuildResult' (required)
ContainerProbeSettings
Name
Description
Value
disableProbe
Indicates whether disable the liveness and readiness probe
bool
CustomContainer
Name
Description
Value
args
Arguments to the entrypoint. The docker image's CMD is used if this is not provided.
string[]
command
Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.
string[]
containerImage
Container image of the custom container. This should be in the form of <repository>:<tag> without the server name of the registry
string
imageRegistryCredential
Credential of the image registry
ImageRegistryCredential
languageFramework
Language framework of the container image uploaded. Supported values: "springboot", "", null.
string
server
The name of the registry that contains the container image
string
CustomContainerUserSourceInfo
Name
Description
Value
customContainer
Custom container payload
CustomContainer
type
Type of the source uploaded
'Container' (required)
CustomScaleRule
Name
Description
Value
auth
Authentication secrets for the custom scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe custom scale rule.
CustomScaleRuleMetadata
type
Type of the custom scale rule eg: azure-servicebus, redis etc.
string
DeploymentResourceProperties
Name
Description
Value
active
Indicates whether the Deployment is active
bool
deploymentSettings
Deployment settings of the Deployment
DeploymentSettings
source
Uploaded source information of the deployment.
UserSourceInfo
DeploymentSettings
Name
Description
Value
addonConfigs
Collection of addons
DeploymentSettingsAddonConfigs
apms
Collection of ApmReferences
ApmReference []
containerProbeSettings
Container liveness and readiness probe settings
ContainerProbeSettings
environmentVariables
Collection of environment variables
DeploymentSettingsEnvironmentVariables
livenessProbe
Periodic probe of App Instance liveness. App Instance will be restarted if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
readinessProbe
Periodic probe of App Instance service readiness. App Instance will be removed from service endpoints if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
resourceRequests
The requested resource quantity for required CPU and Memory. It is recommended that using this field to represent the required CPU and Memory, the old field cpu and memoryInGB will be deprecated later.
ResourceRequests
scale
Scaling properties for the Azure Spring Apps App Instance.
Scale
startupProbe
StartupProbe indicates that the App Instance has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a App Instance's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe
terminationGracePeriodSeconds
Optional duration in seconds the App Instance needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the App Instance are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 90 seconds.
int
DeploymentSettingsAddonConfigs
DeploymentSettingsEnvironmentVariables
ExecAction
Name
Description
Value
command
Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is not run inside a shell, so traditional shell instructions ('
', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
string[]
type
The type of the action to take to perform the health check.
'ExecAction' (required)
HttpGetAction
Name
Description
Value
path
Path to access on the HTTP server.
string
scheme
Scheme to use for connecting to the host. Defaults to HTTP. Possible enum values: - "HTTP"
means that the scheme used will be http:// - "HTTPS"
means that the scheme used will be https://
'HTTP' 'HTTPS'
type
The type of the action to take to perform the health check.
'HTTPGetAction' (required)
HttpScaleRule
Name
Description
Value
auth
Authentication secrets for the custom scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe http scale rule.
HttpScaleRuleMetadata
ImageRegistryCredential
Name
Description
Value
password
The password of the image registry credential
string
username
The username of the image registry credential
string
JarUploadedUserSourceInfo
Name
Description
Value
jvmOptions
JVM parameter
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the Jar file
string
type
Type of the source uploaded
'Jar' (required)
Name
Description
Value
name
The resource name
string (required)
parent_id
The ID of the resource that is the parent for this resource.
ID for resource of type: Spring/apps
properties
Properties of the Deployment resource
DeploymentResourceProperties
sku
Sku of the Deployment resource
Sku
type
The resource type
"Microsoft.AppPlatform/Spring/apps/deployments@2023-07-01-preview"
NetCoreZipUploadedUserSourceInfo
Name
Description
Value
netCoreMainEntryPath
The path to the .NET executable relative to zip root
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the .Net file
string
type
Type of the source uploaded
'NetCoreZip' (required)
Probe
Name
Description
Value
disableProbe
Indicate whether the probe is disabled.
bool (required)
failureThreshold
Minimum consecutive failures for the probe to be considered failed after having succeeded. Minimum value is 1.
int
initialDelaySeconds
Number of seconds after the App Instance has started before probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
int
periodSeconds
How often (in seconds) to perform the probe. Minimum value is 1.
int
probeAction
The action of the probe.
ProbeAction
successThreshold
Minimum consecutive successes for the probe to be considered successful after having failed. Must be 1 for liveness and startup. Minimum value is 1.
int
timeoutSeconds
Number of seconds after which the probe times out. Minimum value is 1.
int
ProbeAction
Name
Description
Value
type
Set to 'ExecAction' for type ExecAction . Set to 'HTTPGetAction' for type HttpGetAction . Set to 'TCPSocketAction' for type TCPSocketAction .
'ExecAction' 'HTTPGetAction' 'TCPSocketAction' (required)
QueueScaleRule
Name
Description
Value
auth
Authentication secrets for the queue scale rule.
ScaleRuleAuth []
queueLength
Queue length.
int
queueName
Queue name.
string
ResourceRequests
Name
Description
Value
cpu
Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic tier, and {500m, 1, 2, 3, 4} for Standard tier.
string
memory
Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier.
string
Scale
Name
Description
Value
maxReplicas
Optional. Maximum number of container replicas. Defaults to 10 if not set.
int
minReplicas
Optional. Minimum number of container replicas.
int
rules
Scaling rules.
ScaleRule []
ScaleRule
ScaleRuleAuth
Name
Description
Value
secretRef
Name of the Azure Spring Apps App Instance secret from which to pull the auth params.
string
triggerParameter
Trigger Parameter that uses the secret
string
Sku
Name
Description
Value
capacity
Current capacity of the target resource
int
name
Name of the Sku
string
tier
Tier of the Sku
string
SourceUploadedUserSourceInfo
Name
Description
Value
artifactSelector
Selector for the artifact to be used for the deployment for multi-module projects. This should be the relative path to the target module/project.
string
relativePath
Relative path of the storage which stores the source
string
runtimeVersion
Runtime version of the source file
string
type
Type of the source uploaded
'Source' (required)
TcpScaleRule
Name
Description
Value
auth
Authentication secrets for the tcp scale rule.
ScaleRuleAuth []
metadata
Metadata properties to describe tcp scale rule.
TcpScaleRuleMetadata
TCPSocketAction
Name
Description
Value
type
The type of the action to take to perform the health check.
'TCPSocketAction' (required)
UserSourceInfo