Microsoft.ServiceFabric managedclusters/applications/services

Bicep resource definition

The managedclusters/applications/services resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.ServiceFabric/managedclusters/applications/services resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.ServiceFabric/managedclusters/applications/services@2024-09-01-preview' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    correlationScheme: [
      {
        scheme: 'string'
        serviceName: 'string'
      }
    ]
    defaultMoveCost: 'string'
    partitionDescription: {
      partitionScheme: 'string'
      // For remaining properties, see Partition objects
    }
    placementConstraints: 'string'
    scalingPolicies: [
      {
        scalingMechanism: {
          kind: 'string'
          // For remaining properties, see ScalingMechanism objects
        }
        scalingTrigger: {
          kind: 'string'
          // For remaining properties, see ScalingTrigger objects
        }
      }
    ]
    serviceDnsName: 'string'
    serviceLoadMetrics: [
      {
        defaultLoad: int
        name: 'string'
        primaryDefaultLoad: int
        secondaryDefaultLoad: int
        weight: 'string'
      }
    ]
    servicePackageActivationMode: 'string'
    servicePlacementPolicies: [
      {
        type: 'string'
        // For remaining properties, see ServicePlacementPolicy objects
      }
    ]
    serviceTypeName: 'string'
    serviceKind: 'string'
    // For remaining properties, see ServiceResourceProperties objects
  }
  tags: {
    {customized property}: 'string'
  }
}

ScalingMechanism objects

Set the kind property to specify the type of object.

For AddRemoveIncrementalNamedPartition, use:

{
  kind: 'AddRemoveIncrementalNamedPartition'
  maxPartitionCount: int
  minPartitionCount: int
  scaleIncrement: int
}

For ScalePartitionInstanceCount, use:

{
  kind: 'ScalePartitionInstanceCount'
  maxInstanceCount: int
  minInstanceCount: int
  scaleIncrement: int
}

ServicePlacementPolicy objects

Set the type property to specify the type of object.

For InvalidDomain, use:

{
  domainName: 'string'
  type: 'InvalidDomain'
}

For NonPartiallyPlaceService, use:

{
  type: 'NonPartiallyPlaceService'
}

For PreferredPrimaryDomain, use:

{
  domainName: 'string'
  type: 'PreferredPrimaryDomain'
}

For RequiredDomain, use:

{
  domainName: 'string'
  type: 'RequiredDomain'
}

For RequiredDomainDistribution, use:

{
  domainName: 'string'
  type: 'RequiredDomainDistribution'
}

ServiceResourceProperties objects

Set the serviceKind property to specify the type of object.

For Stateful, use:

{
  hasPersistedState: bool
  minReplicaSetSize: int
  quorumLossWaitDuration: 'string'
  replicaRestartWaitDuration: 'string'
  serviceKind: 'Stateful'
  servicePlacementTimeLimit: 'string'
  standByReplicaKeepDuration: 'string'
  targetReplicaSetSize: int
}

For Stateless, use:

{
  instanceCount: int
  minInstanceCount: int
  minInstancePercentage: int
  serviceKind: 'Stateless'
}

ScalingTrigger objects

Set the kind property to specify the type of object.

For AveragePartitionLoadTrigger, use:

{
  kind: 'AveragePartitionLoadTrigger'
  lowerLoadThreshold: int
  metricName: 'string'
  scaleInterval: 'string'
  upperLoadThreshold: int
}

For AverageServiceLoadTrigger, use:

{
  kind: 'AverageServiceLoadTrigger'
  lowerLoadThreshold: int
  metricName: 'string'
  scaleInterval: 'string'
  upperLoadThreshold: int
  useOnlyPrimaryLoad: bool
}

Partition objects

Set the partitionScheme property to specify the type of object.

For Named, use:

{
  names: [
    'string'
  ]
  partitionScheme: 'Named'
}

For Singleton, use:

{
  partitionScheme: 'Singleton'
}

For UniformInt64Range, use:

{
  count: int
  highKey: int
  lowKey: int
  partitionScheme: 'UniformInt64Range'
}

Property values

AddRemoveIncrementalNamedPartitionScalingMechanism

Name Description Value
kind Specifies the mechanism associated with this scaling policy. 'AddRemoveIncrementalNamedPartition' (required)
maxPartitionCount Maximum number of named partitions of the service. int (required)
minPartitionCount Minimum number of named partitions of the service. int (required)
scaleIncrement The number of instances to add or remove during a scaling operation. int (required)

AveragePartitionLoadScalingTrigger

Name Description Value
kind Specifies the trigger associated with this scaling policy. 'AveragePartitionLoadTrigger' (required)
lowerLoadThreshold The lower limit of the load below which a scale in operation should be performed. int (required)
metricName The name of the metric for which usage should be tracked. string (required)
scaleInterval The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". string (required)
upperLoadThreshold The upper limit of the load beyond which a scale out operation should be performed. int (required)

AverageServiceLoadScalingTrigger

Name Description Value
kind Specifies the trigger associated with this scaling policy. 'AverageServiceLoadTrigger' (required)
lowerLoadThreshold The lower limit of the load below which a scale in operation should be performed. int (required)
metricName The name of the metric for which usage should be tracked. string (required)
scaleInterval The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". string (required)
upperLoadThreshold The upper limit of the load beyond which a scale out operation should be performed. int (required)
useOnlyPrimaryLoad Flag determines whether only the load of primary replica should be considered for scaling. If set to true, then trigger will only consider the load of primary replicas of stateful service. If set to false, trigger will consider load of all replicas. This parameter cannot be set to true for stateless service. bool (required)

Microsoft.ServiceFabric/managedclusters/applications/services

Name Description Value
location Resource location depends on the parent resource. string
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: managedclusters/applications
properties The service resource properties. ServiceResourceProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates

NamedPartitionScheme

Name Description Value
names Array for the names of the partitions. string[] (required)
partitionScheme Specifies how the service is partitioned. 'Named' (required)

Partition

Name Description Value
partitionScheme Set to 'Named' for type NamedPartitionScheme. Set to 'Singleton' for type SingletonPartitionScheme. Set to 'UniformInt64Range' for type UniformInt64RangePartitionScheme. 'Named'
'Singleton'
'UniformInt64Range' (required)

PartitionInstanceCountScaleMechanism

Name Description Value
kind Specifies the mechanism associated with this scaling policy. 'ScalePartitionInstanceCount' (required)
maxInstanceCount Maximum number of instances of the partition. int (required)
minInstanceCount Minimum number of instances of the partition. int (required)
scaleIncrement The number of instances to add or remove during a scaling operation. int (required)

ProxyResourceTags

Name Description Value

ScalingMechanism

Name Description Value
kind Set to 'AddRemoveIncrementalNamedPartition' for type AddRemoveIncrementalNamedPartitionScalingMechanism. Set to 'ScalePartitionInstanceCount' for type PartitionInstanceCountScaleMechanism. 'AddRemoveIncrementalNamedPartition'
'ScalePartitionInstanceCount' (required)

ScalingPolicy

Name Description Value
scalingMechanism Specifies the mechanism associated with this scaling policy ScalingMechanism (required)
scalingTrigger Specifies the trigger associated with this scaling policy. ScalingTrigger (required)

ScalingTrigger

Name Description Value
kind Set to 'AveragePartitionLoadTrigger' for type AveragePartitionLoadScalingTrigger. Set to 'AverageServiceLoadTrigger' for type AverageServiceLoadScalingTrigger. 'AveragePartitionLoadTrigger'
'AverageServiceLoadTrigger' (required)

ServiceCorrelation

Name Description Value
scheme The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. 'AlignedAffinity'
'NonAlignedAffinity' (required)
serviceName The Arm Resource ID of the service that the correlation relationship is established with. string (required)

ServiceLoadMetric

Name Description Value
defaultLoad Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. int
name The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. string (required)
primaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. int
secondaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. int
weight The service load metric relative weight, compared to other metrics configured for this service, as a number. 'High'
'Low'
'Medium'
'Zero'

ServicePlacementInvalidDomainPolicy

Name Description Value
domainName The name of the domain that should not be used for placement. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'InvalidDomain' (required)

ServicePlacementNonPartiallyPlaceServicePolicy

Name Description Value
type The type of placement policy for a service fabric service. Following are the possible values. 'NonPartiallyPlaceService' (required)

ServicePlacementPolicy

Name Description Value
type Set to 'InvalidDomain' for type ServicePlacementInvalidDomainPolicy. Set to 'NonPartiallyPlaceService' for type ServicePlacementNonPartiallyPlaceServicePolicy. Set to 'PreferredPrimaryDomain' for type ServicePlacementPreferPrimaryDomainPolicy. Set to 'RequiredDomain' for type ServicePlacementRequiredDomainPolicy. Set to 'RequiredDomainDistribution' for type ServicePlacementRequireDomainDistributionPolicy. 'InvalidDomain'
'NonPartiallyPlaceService'
'PreferredPrimaryDomain'
'RequiredDomain'
'RequiredDomainDistribution' (required)

ServicePlacementPreferPrimaryDomainPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'PreferredPrimaryDomain' (required)

ServicePlacementRequiredDomainPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'RequiredDomain' (required)

ServicePlacementRequireDomainDistributionPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'RequiredDomainDistribution' (required)

ServiceResourceProperties

Name Description Value
correlationScheme A list that describes the correlation of the service with other services. ServiceCorrelation[]
defaultMoveCost Specifies the move cost for the service. 'High'
'Low'
'Medium'
'Zero'
partitionDescription Describes how the service is partitioned. Partition (required)
placementConstraints The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". string
scalingPolicies Scaling policies for this service. ScalingPolicy[]
serviceDnsName Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP).
When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name.
When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable.
string
serviceKind Set to 'Stateful' for type StatefulServiceProperties. Set to 'Stateless' for type StatelessServiceProperties. 'Stateful'
'Stateless' (required)
serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetric objects. ServiceLoadMetric[]
servicePackageActivationMode The activation Mode of the service package 'ExclusiveProcess'
'SharedProcess'
servicePlacementPolicies A list that describes the correlation of the service with other services. ServicePlacementPolicy[]
serviceTypeName The name of the service type string (required)

SingletonPartitionScheme

Name Description Value
partitionScheme Specifies how the service is partitioned. 'Singleton' (required)

StatefulServiceProperties

Name Description Value
hasPersistedState A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. bool
minReplicaSetSize The minimum replica set size as a number. int

Constraints:
Min value = 1
quorumLossWaitDuration The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". string
replicaRestartWaitDuration The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format "hh:mm:ss". string
serviceKind The kind of service (Stateless or Stateful). 'Stateful' (required)
servicePlacementTimeLimit The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". string
standByReplicaKeepDuration The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". string
targetReplicaSetSize The target replica set size as a number. int

Constraints:
Min value = 1

StatelessServiceProperties

Name Description Value
instanceCount The instance count. int

Constraints:
Min value = -1 (required)
minInstanceCount MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. int
minInstancePercentage MinInstancePercentage is the minimum percentage of InstanceCount that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. int
serviceKind The kind of service (Stateless or Stateful). 'Stateless' (required)

UniformInt64RangePartitionScheme

Name Description Value
count The number of partitions. int (required)
highKey The upper bound of the partition key range that
should be split between the partition ‘Count’
int (required)
lowKey The lower bound of the partition key range that
should be split between the partition ‘Count’
int (required)
partitionScheme Specifies how the service is partitioned. 'UniformInt64Range' (required)

ARM template resource definition

The managedclusters/applications/services resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.ServiceFabric/managedclusters/applications/services resource, add the following JSON to your template.

{
  "type": "Microsoft.ServiceFabric/managedclusters/applications/services",
  "apiVersion": "2024-09-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "correlationScheme": [
      {
        "scheme": "string",
        "serviceName": "string"
      }
    ],
    "defaultMoveCost": "string",
    "partitionDescription": {
      "partitionScheme": "string"
      // For remaining properties, see Partition objects
    },
    "placementConstraints": "string",
    "scalingPolicies": [
      {
        "scalingMechanism": {
          "kind": "string"
          // For remaining properties, see ScalingMechanism objects
        },
        "scalingTrigger": {
          "kind": "string"
          // For remaining properties, see ScalingTrigger objects
        }
      }
    ],
    "serviceDnsName": "string",
    "serviceLoadMetrics": [
      {
        "defaultLoad": "int",
        "name": "string",
        "primaryDefaultLoad": "int",
        "secondaryDefaultLoad": "int",
        "weight": "string"
      }
    ],
    "servicePackageActivationMode": "string",
    "servicePlacementPolicies": [ {
      "type": "string"
      // For remaining properties, see ServicePlacementPolicy objects
    } ],
    "serviceTypeName": "string",
    "serviceKind": "string"
    // For remaining properties, see ServiceResourceProperties objects
  },
  "tags": {
    "{customized property}": "string"
  }
}

ScalingMechanism objects

Set the kind property to specify the type of object.

For AddRemoveIncrementalNamedPartition, use:

{
  "kind": "AddRemoveIncrementalNamedPartition",
  "maxPartitionCount": "int",
  "minPartitionCount": "int",
  "scaleIncrement": "int"
}

For ScalePartitionInstanceCount, use:

{
  "kind": "ScalePartitionInstanceCount",
  "maxInstanceCount": "int",
  "minInstanceCount": "int",
  "scaleIncrement": "int"
}

ServicePlacementPolicy objects

Set the type property to specify the type of object.

For InvalidDomain, use:

{
  "domainName": "string",
  "type": "InvalidDomain"
}

For NonPartiallyPlaceService, use:

{
  "type": "NonPartiallyPlaceService"
}

For PreferredPrimaryDomain, use:

{
  "domainName": "string",
  "type": "PreferredPrimaryDomain"
}

For RequiredDomain, use:

{
  "domainName": "string",
  "type": "RequiredDomain"
}

For RequiredDomainDistribution, use:

{
  "domainName": "string",
  "type": "RequiredDomainDistribution"
}

ServiceResourceProperties objects

Set the serviceKind property to specify the type of object.

For Stateful, use:

{
  "hasPersistedState": "bool",
  "minReplicaSetSize": "int",
  "quorumLossWaitDuration": "string",
  "replicaRestartWaitDuration": "string",
  "serviceKind": "Stateful",
  "servicePlacementTimeLimit": "string",
  "standByReplicaKeepDuration": "string",
  "targetReplicaSetSize": "int"
}

For Stateless, use:

{
  "instanceCount": "int",
  "minInstanceCount": "int",
  "minInstancePercentage": "int",
  "serviceKind": "Stateless"
}

ScalingTrigger objects

Set the kind property to specify the type of object.

For AveragePartitionLoadTrigger, use:

{
  "kind": "AveragePartitionLoadTrigger",
  "lowerLoadThreshold": "int",
  "metricName": "string",
  "scaleInterval": "string",
  "upperLoadThreshold": "int"
}

For AverageServiceLoadTrigger, use:

{
  "kind": "AverageServiceLoadTrigger",
  "lowerLoadThreshold": "int",
  "metricName": "string",
  "scaleInterval": "string",
  "upperLoadThreshold": "int",
  "useOnlyPrimaryLoad": "bool"
}

Partition objects

Set the partitionScheme property to specify the type of object.

For Named, use:

{
  "names": [ "string" ],
  "partitionScheme": "Named"
}

For Singleton, use:

{
  "partitionScheme": "Singleton"
}

For UniformInt64Range, use:

{
  "count": "int",
  "highKey": "int",
  "lowKey": "int",
  "partitionScheme": "UniformInt64Range"
}

Property values

AddRemoveIncrementalNamedPartitionScalingMechanism

Name Description Value
kind Specifies the mechanism associated with this scaling policy. 'AddRemoveIncrementalNamedPartition' (required)
maxPartitionCount Maximum number of named partitions of the service. int (required)
minPartitionCount Minimum number of named partitions of the service. int (required)
scaleIncrement The number of instances to add or remove during a scaling operation. int (required)

AveragePartitionLoadScalingTrigger

Name Description Value
kind Specifies the trigger associated with this scaling policy. 'AveragePartitionLoadTrigger' (required)
lowerLoadThreshold The lower limit of the load below which a scale in operation should be performed. int (required)
metricName The name of the metric for which usage should be tracked. string (required)
scaleInterval The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". string (required)
upperLoadThreshold The upper limit of the load beyond which a scale out operation should be performed. int (required)

AverageServiceLoadScalingTrigger

Name Description Value
kind Specifies the trigger associated with this scaling policy. 'AverageServiceLoadTrigger' (required)
lowerLoadThreshold The lower limit of the load below which a scale in operation should be performed. int (required)
metricName The name of the metric for which usage should be tracked. string (required)
scaleInterval The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". string (required)
upperLoadThreshold The upper limit of the load beyond which a scale out operation should be performed. int (required)
useOnlyPrimaryLoad Flag determines whether only the load of primary replica should be considered for scaling. If set to true, then trigger will only consider the load of primary replicas of stateful service. If set to false, trigger will consider load of all replicas. This parameter cannot be set to true for stateless service. bool (required)

Microsoft.ServiceFabric/managedclusters/applications/services

Name Description Value
apiVersion The api version '2024-09-01-preview'
location Resource location depends on the parent resource. string
name The resource name string (required)
properties The service resource properties. ServiceResourceProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.ServiceFabric/managedclusters/applications/services'

NamedPartitionScheme

Name Description Value
names Array for the names of the partitions. string[] (required)
partitionScheme Specifies how the service is partitioned. 'Named' (required)

Partition

Name Description Value
partitionScheme Set to 'Named' for type NamedPartitionScheme. Set to 'Singleton' for type SingletonPartitionScheme. Set to 'UniformInt64Range' for type UniformInt64RangePartitionScheme. 'Named'
'Singleton'
'UniformInt64Range' (required)

PartitionInstanceCountScaleMechanism

Name Description Value
kind Specifies the mechanism associated with this scaling policy. 'ScalePartitionInstanceCount' (required)
maxInstanceCount Maximum number of instances of the partition. int (required)
minInstanceCount Minimum number of instances of the partition. int (required)
scaleIncrement The number of instances to add or remove during a scaling operation. int (required)

ProxyResourceTags

Name Description Value

ScalingMechanism

Name Description Value
kind Set to 'AddRemoveIncrementalNamedPartition' for type AddRemoveIncrementalNamedPartitionScalingMechanism. Set to 'ScalePartitionInstanceCount' for type PartitionInstanceCountScaleMechanism. 'AddRemoveIncrementalNamedPartition'
'ScalePartitionInstanceCount' (required)

ScalingPolicy

Name Description Value
scalingMechanism Specifies the mechanism associated with this scaling policy ScalingMechanism (required)
scalingTrigger Specifies the trigger associated with this scaling policy. ScalingTrigger (required)

ScalingTrigger

Name Description Value
kind Set to 'AveragePartitionLoadTrigger' for type AveragePartitionLoadScalingTrigger. Set to 'AverageServiceLoadTrigger' for type AverageServiceLoadScalingTrigger. 'AveragePartitionLoadTrigger'
'AverageServiceLoadTrigger' (required)

ServiceCorrelation

Name Description Value
scheme The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. 'AlignedAffinity'
'NonAlignedAffinity' (required)
serviceName The Arm Resource ID of the service that the correlation relationship is established with. string (required)

ServiceLoadMetric

Name Description Value
defaultLoad Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. int
name The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. string (required)
primaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. int
secondaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. int
weight The service load metric relative weight, compared to other metrics configured for this service, as a number. 'High'
'Low'
'Medium'
'Zero'

ServicePlacementInvalidDomainPolicy

Name Description Value
domainName The name of the domain that should not be used for placement. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'InvalidDomain' (required)

ServicePlacementNonPartiallyPlaceServicePolicy

Name Description Value
type The type of placement policy for a service fabric service. Following are the possible values. 'NonPartiallyPlaceService' (required)

ServicePlacementPolicy

Name Description Value
type Set to 'InvalidDomain' for type ServicePlacementInvalidDomainPolicy. Set to 'NonPartiallyPlaceService' for type ServicePlacementNonPartiallyPlaceServicePolicy. Set to 'PreferredPrimaryDomain' for type ServicePlacementPreferPrimaryDomainPolicy. Set to 'RequiredDomain' for type ServicePlacementRequiredDomainPolicy. Set to 'RequiredDomainDistribution' for type ServicePlacementRequireDomainDistributionPolicy. 'InvalidDomain'
'NonPartiallyPlaceService'
'PreferredPrimaryDomain'
'RequiredDomain'
'RequiredDomainDistribution' (required)

ServicePlacementPreferPrimaryDomainPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'PreferredPrimaryDomain' (required)

ServicePlacementRequiredDomainPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'RequiredDomain' (required)

ServicePlacementRequireDomainDistributionPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'RequiredDomainDistribution' (required)

ServiceResourceProperties

Name Description Value
correlationScheme A list that describes the correlation of the service with other services. ServiceCorrelation[]
defaultMoveCost Specifies the move cost for the service. 'High'
'Low'
'Medium'
'Zero'
partitionDescription Describes how the service is partitioned. Partition (required)
placementConstraints The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". string
scalingPolicies Scaling policies for this service. ScalingPolicy[]
serviceDnsName Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP).
When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name.
When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable.
string
serviceKind Set to 'Stateful' for type StatefulServiceProperties. Set to 'Stateless' for type StatelessServiceProperties. 'Stateful'
'Stateless' (required)
serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetric objects. ServiceLoadMetric[]
servicePackageActivationMode The activation Mode of the service package 'ExclusiveProcess'
'SharedProcess'
servicePlacementPolicies A list that describes the correlation of the service with other services. ServicePlacementPolicy[]
serviceTypeName The name of the service type string (required)

SingletonPartitionScheme

Name Description Value
partitionScheme Specifies how the service is partitioned. 'Singleton' (required)

StatefulServiceProperties

Name Description Value
hasPersistedState A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. bool
minReplicaSetSize The minimum replica set size as a number. int

Constraints:
Min value = 1
quorumLossWaitDuration The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". string
replicaRestartWaitDuration The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format "hh:mm:ss". string
serviceKind The kind of service (Stateless or Stateful). 'Stateful' (required)
servicePlacementTimeLimit The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". string
standByReplicaKeepDuration The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". string
targetReplicaSetSize The target replica set size as a number. int

Constraints:
Min value = 1

StatelessServiceProperties

Name Description Value
instanceCount The instance count. int

Constraints:
Min value = -1 (required)
minInstanceCount MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. int
minInstancePercentage MinInstancePercentage is the minimum percentage of InstanceCount that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. int
serviceKind The kind of service (Stateless or Stateful). 'Stateless' (required)

UniformInt64RangePartitionScheme

Name Description Value
count The number of partitions. int (required)
highKey The upper bound of the partition key range that
should be split between the partition ‘Count’
int (required)
lowKey The lower bound of the partition key range that
should be split between the partition ‘Count’
int (required)
partitionScheme Specifies how the service is partitioned. 'UniformInt64Range' (required)

Terraform (AzAPI provider) resource definition

The managedclusters/applications/services resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.ServiceFabric/managedclusters/applications/services resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.ServiceFabric/managedclusters/applications/services@2024-09-01-preview"
  name = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      correlationScheme = [
        {
          scheme = "string"
          serviceName = "string"
        }
      ]
      defaultMoveCost = "string"
      partitionDescription = {
        partitionScheme = "string"
        // For remaining properties, see Partition objects
      }
      placementConstraints = "string"
      scalingPolicies = [
        {
          scalingMechanism = {
            kind = "string"
            // For remaining properties, see ScalingMechanism objects
          }
          scalingTrigger = {
            kind = "string"
            // For remaining properties, see ScalingTrigger objects
          }
        }
      ]
      serviceDnsName = "string"
      serviceLoadMetrics = [
        {
          defaultLoad = int
          name = "string"
          primaryDefaultLoad = int
          secondaryDefaultLoad = int
          weight = "string"
        }
      ]
      servicePackageActivationMode = "string"
      servicePlacementPolicies = [
        {
          type = "string"
          // For remaining properties, see ServicePlacementPolicy objects
        }
      ]
      serviceTypeName = "string"
      serviceKind = "string"
      // For remaining properties, see ServiceResourceProperties objects
    }
  })
}

ScalingMechanism objects

Set the kind property to specify the type of object.

For AddRemoveIncrementalNamedPartition, use:

{
  kind = "AddRemoveIncrementalNamedPartition"
  maxPartitionCount = int
  minPartitionCount = int
  scaleIncrement = int
}

For ScalePartitionInstanceCount, use:

{
  kind = "ScalePartitionInstanceCount"
  maxInstanceCount = int
  minInstanceCount = int
  scaleIncrement = int
}

ServicePlacementPolicy objects

Set the type property to specify the type of object.

For InvalidDomain, use:

{
  domainName = "string"
  type = "InvalidDomain"
}

For NonPartiallyPlaceService, use:

{
  type = "NonPartiallyPlaceService"
}

For PreferredPrimaryDomain, use:

{
  domainName = "string"
  type = "PreferredPrimaryDomain"
}

For RequiredDomain, use:

{
  domainName = "string"
  type = "RequiredDomain"
}

For RequiredDomainDistribution, use:

{
  domainName = "string"
  type = "RequiredDomainDistribution"
}

ServiceResourceProperties objects

Set the serviceKind property to specify the type of object.

For Stateful, use:

{
  hasPersistedState = bool
  minReplicaSetSize = int
  quorumLossWaitDuration = "string"
  replicaRestartWaitDuration = "string"
  serviceKind = "Stateful"
  servicePlacementTimeLimit = "string"
  standByReplicaKeepDuration = "string"
  targetReplicaSetSize = int
}

For Stateless, use:

{
  instanceCount = int
  minInstanceCount = int
  minInstancePercentage = int
  serviceKind = "Stateless"
}

ScalingTrigger objects

Set the kind property to specify the type of object.

For AveragePartitionLoadTrigger, use:

{
  kind = "AveragePartitionLoadTrigger"
  lowerLoadThreshold = int
  metricName = "string"
  scaleInterval = "string"
  upperLoadThreshold = int
}

For AverageServiceLoadTrigger, use:

{
  kind = "AverageServiceLoadTrigger"
  lowerLoadThreshold = int
  metricName = "string"
  scaleInterval = "string"
  upperLoadThreshold = int
  useOnlyPrimaryLoad = bool
}

Partition objects

Set the partitionScheme property to specify the type of object.

For Named, use:

{
  names = [
    "string"
  ]
  partitionScheme = "Named"
}

For Singleton, use:

{
  partitionScheme = "Singleton"
}

For UniformInt64Range, use:

{
  count = int
  highKey = int
  lowKey = int
  partitionScheme = "UniformInt64Range"
}

Property values

AddRemoveIncrementalNamedPartitionScalingMechanism

Name Description Value
kind Specifies the mechanism associated with this scaling policy. 'AddRemoveIncrementalNamedPartition' (required)
maxPartitionCount Maximum number of named partitions of the service. int (required)
minPartitionCount Minimum number of named partitions of the service. int (required)
scaleIncrement The number of instances to add or remove during a scaling operation. int (required)

AveragePartitionLoadScalingTrigger

Name Description Value
kind Specifies the trigger associated with this scaling policy. 'AveragePartitionLoadTrigger' (required)
lowerLoadThreshold The lower limit of the load below which a scale in operation should be performed. int (required)
metricName The name of the metric for which usage should be tracked. string (required)
scaleInterval The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". string (required)
upperLoadThreshold The upper limit of the load beyond which a scale out operation should be performed. int (required)

AverageServiceLoadScalingTrigger

Name Description Value
kind Specifies the trigger associated with this scaling policy. 'AverageServiceLoadTrigger' (required)
lowerLoadThreshold The lower limit of the load below which a scale in operation should be performed. int (required)
metricName The name of the metric for which usage should be tracked. string (required)
scaleInterval The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". string (required)
upperLoadThreshold The upper limit of the load beyond which a scale out operation should be performed. int (required)
useOnlyPrimaryLoad Flag determines whether only the load of primary replica should be considered for scaling. If set to true, then trigger will only consider the load of primary replicas of stateful service. If set to false, trigger will consider load of all replicas. This parameter cannot be set to true for stateless service. bool (required)

Microsoft.ServiceFabric/managedclusters/applications/services

Name Description Value
location Resource location depends on the parent resource. string
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: managedclusters/applications
properties The service resource properties. ServiceResourceProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.ServiceFabric/managedclusters/applications/services@2024-09-01-preview"

NamedPartitionScheme

Name Description Value
names Array for the names of the partitions. string[] (required)
partitionScheme Specifies how the service is partitioned. 'Named' (required)

Partition

Name Description Value
partitionScheme Set to 'Named' for type NamedPartitionScheme. Set to 'Singleton' for type SingletonPartitionScheme. Set to 'UniformInt64Range' for type UniformInt64RangePartitionScheme. 'Named'
'Singleton'
'UniformInt64Range' (required)

PartitionInstanceCountScaleMechanism

Name Description Value
kind Specifies the mechanism associated with this scaling policy. 'ScalePartitionInstanceCount' (required)
maxInstanceCount Maximum number of instances of the partition. int (required)
minInstanceCount Minimum number of instances of the partition. int (required)
scaleIncrement The number of instances to add or remove during a scaling operation. int (required)

ProxyResourceTags

Name Description Value

ScalingMechanism

Name Description Value
kind Set to 'AddRemoveIncrementalNamedPartition' for type AddRemoveIncrementalNamedPartitionScalingMechanism. Set to 'ScalePartitionInstanceCount' for type PartitionInstanceCountScaleMechanism. 'AddRemoveIncrementalNamedPartition'
'ScalePartitionInstanceCount' (required)

ScalingPolicy

Name Description Value
scalingMechanism Specifies the mechanism associated with this scaling policy ScalingMechanism (required)
scalingTrigger Specifies the trigger associated with this scaling policy. ScalingTrigger (required)

ScalingTrigger

Name Description Value
kind Set to 'AveragePartitionLoadTrigger' for type AveragePartitionLoadScalingTrigger. Set to 'AverageServiceLoadTrigger' for type AverageServiceLoadScalingTrigger. 'AveragePartitionLoadTrigger'
'AverageServiceLoadTrigger' (required)

ServiceCorrelation

Name Description Value
scheme The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. 'AlignedAffinity'
'NonAlignedAffinity' (required)
serviceName The Arm Resource ID of the service that the correlation relationship is established with. string (required)

ServiceLoadMetric

Name Description Value
defaultLoad Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. int
name The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. string (required)
primaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. int
secondaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. int
weight The service load metric relative weight, compared to other metrics configured for this service, as a number. 'High'
'Low'
'Medium'
'Zero'

ServicePlacementInvalidDomainPolicy

Name Description Value
domainName The name of the domain that should not be used for placement. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'InvalidDomain' (required)

ServicePlacementNonPartiallyPlaceServicePolicy

Name Description Value
type The type of placement policy for a service fabric service. Following are the possible values. 'NonPartiallyPlaceService' (required)

ServicePlacementPolicy

Name Description Value
type Set to 'InvalidDomain' for type ServicePlacementInvalidDomainPolicy. Set to 'NonPartiallyPlaceService' for type ServicePlacementNonPartiallyPlaceServicePolicy. Set to 'PreferredPrimaryDomain' for type ServicePlacementPreferPrimaryDomainPolicy. Set to 'RequiredDomain' for type ServicePlacementRequiredDomainPolicy. Set to 'RequiredDomainDistribution' for type ServicePlacementRequireDomainDistributionPolicy. 'InvalidDomain'
'NonPartiallyPlaceService'
'PreferredPrimaryDomain'
'RequiredDomain'
'RequiredDomainDistribution' (required)

ServicePlacementPreferPrimaryDomainPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'PreferredPrimaryDomain' (required)

ServicePlacementRequiredDomainPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'RequiredDomain' (required)

ServicePlacementRequireDomainDistributionPolicy

Name Description Value
domainName The name of the domain that should used for placement as per this policy. string (required)
type The type of placement policy for a service fabric service. Following are the possible values. 'RequiredDomainDistribution' (required)

ServiceResourceProperties

Name Description Value
correlationScheme A list that describes the correlation of the service with other services. ServiceCorrelation[]
defaultMoveCost Specifies the move cost for the service. 'High'
'Low'
'Medium'
'Zero'
partitionDescription Describes how the service is partitioned. Partition (required)
placementConstraints The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". string
scalingPolicies Scaling policies for this service. ScalingPolicy[]
serviceDnsName Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP).
When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name.
When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable.
string
serviceKind Set to 'Stateful' for type StatefulServiceProperties. Set to 'Stateless' for type StatelessServiceProperties. 'Stateful'
'Stateless' (required)
serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetric objects. ServiceLoadMetric[]
servicePackageActivationMode The activation Mode of the service package 'ExclusiveProcess'
'SharedProcess'
servicePlacementPolicies A list that describes the correlation of the service with other services. ServicePlacementPolicy[]
serviceTypeName The name of the service type string (required)

SingletonPartitionScheme

Name Description Value
partitionScheme Specifies how the service is partitioned. 'Singleton' (required)

StatefulServiceProperties

Name Description Value
hasPersistedState A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. bool
minReplicaSetSize The minimum replica set size as a number. int

Constraints:
Min value = 1
quorumLossWaitDuration The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". string
replicaRestartWaitDuration The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format "hh:mm:ss". string
serviceKind The kind of service (Stateless or Stateful). 'Stateful' (required)
servicePlacementTimeLimit The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". string
standByReplicaKeepDuration The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". string
targetReplicaSetSize The target replica set size as a number. int

Constraints:
Min value = 1

StatelessServiceProperties

Name Description Value
instanceCount The instance count. int

Constraints:
Min value = -1 (required)
minInstanceCount MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. int
minInstancePercentage MinInstancePercentage is the minimum percentage of InstanceCount that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. int
serviceKind The kind of service (Stateless or Stateful). 'Stateless' (required)

UniformInt64RangePartitionScheme

Name Description Value
count The number of partitions. int (required)
highKey The upper bound of the partition key range that
should be split between the partition ‘Count’
int (required)
lowKey The lower bound of the partition key range that
should be split between the partition ‘Count’
int (required)
partitionScheme Specifies how the service is partitioned. 'UniformInt64Range' (required)