Microsoft.ServiceFabric clusters/applications/services 2017-07-01-preview

Bicep resource definition

The clusters/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/clusters/applications/services resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.ServiceFabric/clusters/applications/services@2017-07-01-preview' = {
  name: 'string'
  location: 'string'
  parent: resourceSymbolicName
  properties: {
    correlationScheme: [
      {
        Scheme: 'string'
        ServiceName: 'string'
      }
    ]
    defaultMoveCost: 'string'
    partitionDescription: {
      PartitionScheme: 'string'
      // For remaining properties, see PartitionSchemeDescription objects
    }
    placementConstraints: 'string'
    serviceLoadMetrics: [
      {
        DefaultLoad: int
        Name: 'string'
        PrimaryDefaultLoad: int
        SecondaryDefaultLoad: int
        Weight: 'string'
      }
    ]
    servicePlacementPolicies: [
      {
      }
    ]
    serviceTypeName: 'string'
    serviceKind: 'string'
    // For remaining properties, see ServiceResourceProperties objects
  }
}

ServiceResourceProperties objects

Set the serviceKind property to specify the type of object.

For Stateful, use:

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

For Stateless, use:

  serviceKind: 'Stateless'
  instanceCount: int

PartitionSchemeDescription objects

Set the PartitionScheme property to specify the type of object.

For Named, use:

  PartitionScheme: 'Named'
  Count: int
  Names: [
    'string'
  ]

For Singleton, use:

  PartitionScheme: 'Singleton'

For UniformInt64Range, use:

  PartitionScheme: 'UniformInt64Range'
  Count: int
  HighKey: 'string'
  LowKey: 'string'

Property values

clusters/applications/services

Name Description Value
name The resource name

See how to set names and types for child resources in Bicep.
string (required)
location Azure resource location. string
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: applications
properties The service resource properties. ServiceResourceProperties

ServiceResourceProperties

Name Description Value
correlationScheme A list that describes the correlation of the service with other services. ServiceCorrelationDescription[]
defaultMoveCost Specifies the move cost for the service. 'High'
'Low'
'Medium'
'Zero'
partitionDescription Describes how the service is partitioned. PartitionSchemeDescription
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
serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetricDescription objects. ServiceLoadMetricDescription[]
servicePlacementPolicies A list that describes the correlation of the service with other services. object
serviceTypeName The name of the service type string
serviceKind Set the object type Stateful
Stateless (required)

ServiceCorrelationDescription

Name Description Value
Scheme The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. 'Affinity'
'AlignedAffinity'
'Invalid'
'NonAlignedAffinity' (required)
ServiceName The name of the service that the correlation relationship is established with. string (required)

PartitionSchemeDescription

Name Description Value
PartitionScheme Set the object type Named
Singleton
UniformInt64Range (required)

NamedPartitionSchemeDescription

Name Description Value
PartitionScheme Specifies how the service is partitioned. 'Named' (required)
Count The number of partitions. int (required)
Names Array of size specified by the ‘Count’ parameter, for the names of the partitions. string[] (required)

SingletonPartitionSchemeDescription

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

UniformInt64RangePartitionSchemeDescription

Name Description Value
PartitionScheme Specifies how the service is partitioned. 'UniformInt64Range' (required)
Count The number of partitions. int (required)
HighKey String indicating the upper bound of the partition key range that
should be split between the partition ‘Count’
string (required)
LowKey String indicating the lower bound of the partition key range that
should be split between the partition ‘Count’
string (required)

ServiceLoadMetricDescription

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'

StatefulServiceProperties

Name Description Value
serviceKind The kind of service (Stateless or Stateful). 'Stateful' (required)
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.s). 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.s). string
standByReplicaKeepDuration The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). string
targetReplicaSetSize The target replica set size as a number. int

Constraints:
Min value = 1

StatelessServiceProperties

Name Description Value
serviceKind The kind of service (Stateless or Stateful). 'Stateless' (required)
instanceCount The instance count. int

ARM template resource definition

The clusters/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/clusters/applications/services resource, add the following JSON to your template.

{
  "type": "Microsoft.ServiceFabric/clusters/applications/services",
  "apiVersion": "2017-07-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "correlationScheme": [
      {
        "Scheme": "string",
        "ServiceName": "string"
      }
    ],
    "defaultMoveCost": "string",
    "partitionDescription": {
      "PartitionScheme": "string"
      // For remaining properties, see PartitionSchemeDescription objects
    },
    "placementConstraints": "string",
    "serviceLoadMetrics": [
      {
        "DefaultLoad": "int",
        "Name": "string",
        "PrimaryDefaultLoad": "int",
        "SecondaryDefaultLoad": "int",
        "Weight": "string"
      }
    ],
    "servicePlacementPolicies": [
      {
      }
    ],
    "serviceTypeName": "string",
    "serviceKind": "string"
    // For remaining properties, see ServiceResourceProperties objects
  }
}

ServiceResourceProperties objects

Set the serviceKind property to specify the type of object.

For Stateful, use:

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

For Stateless, use:

  "serviceKind": "Stateless",
  "instanceCount": "int"

PartitionSchemeDescription objects

Set the PartitionScheme property to specify the type of object.

For Named, use:

  "PartitionScheme": "Named",
  "Count": "int",
  "Names": [ "string" ]

For Singleton, use:

  "PartitionScheme": "Singleton"

For UniformInt64Range, use:

  "PartitionScheme": "UniformInt64Range",
  "Count": "int",
  "HighKey": "string",
  "LowKey": "string"

Property values

clusters/applications/services

Name Description Value
type The resource type 'Microsoft.ServiceFabric/clusters/applications/services'
apiVersion The resource api version '2017-07-01-preview'
name The resource name

See how to set names and types for child resources in JSON ARM templates.
string (required)
location Azure resource location. string
properties The service resource properties. ServiceResourceProperties

ServiceResourceProperties

Name Description Value
correlationScheme A list that describes the correlation of the service with other services. ServiceCorrelationDescription[]
defaultMoveCost Specifies the move cost for the service. 'High'
'Low'
'Medium'
'Zero'
partitionDescription Describes how the service is partitioned. PartitionSchemeDescription
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
serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetricDescription objects. ServiceLoadMetricDescription[]
servicePlacementPolicies A list that describes the correlation of the service with other services. object
serviceTypeName The name of the service type string
serviceKind Set the object type Stateful
Stateless (required)

ServiceCorrelationDescription

Name Description Value
Scheme The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. 'Affinity'
'AlignedAffinity'
'Invalid'
'NonAlignedAffinity' (required)
ServiceName The name of the service that the correlation relationship is established with. string (required)

PartitionSchemeDescription

Name Description Value
PartitionScheme Set the object type Named
Singleton
UniformInt64Range (required)

NamedPartitionSchemeDescription

Name Description Value
PartitionScheme Specifies how the service is partitioned. 'Named' (required)
Count The number of partitions. int (required)
Names Array of size specified by the ‘Count’ parameter, for the names of the partitions. string[] (required)

SingletonPartitionSchemeDescription

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

UniformInt64RangePartitionSchemeDescription

Name Description Value
PartitionScheme Specifies how the service is partitioned. 'UniformInt64Range' (required)
Count The number of partitions. int (required)
HighKey String indicating the upper bound of the partition key range that
should be split between the partition ‘Count’
string (required)
LowKey String indicating the lower bound of the partition key range that
should be split between the partition ‘Count’
string (required)

ServiceLoadMetricDescription

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'

StatefulServiceProperties

Name Description Value
serviceKind The kind of service (Stateless or Stateful). 'Stateful' (required)
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.s). 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.s). string
standByReplicaKeepDuration The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). string
targetReplicaSetSize The target replica set size as a number. int

Constraints:
Min value = 1

StatelessServiceProperties

Name Description Value
serviceKind The kind of service (Stateless or Stateful). 'Stateless' (required)
instanceCount The instance count. int

Terraform (AzAPI provider) resource definition

The clusters/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/clusters/applications/services resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.ServiceFabric/clusters/applications/services@2017-07-01-preview"
  name = "string"
  location = "string"
  parent_id = "string"
  body = jsonencode({
    properties = {
      correlationScheme = [
        {
          Scheme = "string"
          ServiceName = "string"
        }
      ]
      defaultMoveCost = "string"
      partitionDescription = {
        PartitionScheme = "string"
        // For remaining properties, see PartitionSchemeDescription objects
      }
      placementConstraints = "string"
      serviceLoadMetrics = [
        {
          DefaultLoad = int
          Name = "string"
          PrimaryDefaultLoad = int
          SecondaryDefaultLoad = int
          Weight = "string"
        }
      ]
      servicePlacementPolicies = [
        {
        }
      ]
      serviceTypeName = "string"
      serviceKind = "string"
      // For remaining properties, see ServiceResourceProperties objects
    }
  })
}

ServiceResourceProperties objects

Set the serviceKind property to specify the type of object.

For Stateful, use:

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

For Stateless, use:

  serviceKind = "Stateless"
  instanceCount = int

PartitionSchemeDescription objects

Set the PartitionScheme property to specify the type of object.

For Named, use:

  PartitionScheme = "Named"
  Count = int
  Names = [
    "string"
  ]

For Singleton, use:

  PartitionScheme = "Singleton"

For UniformInt64Range, use:

  PartitionScheme = "UniformInt64Range"
  Count = int
  HighKey = "string"
  LowKey = "string"

Property values

clusters/applications/services

Name Description Value
type The resource type "Microsoft.ServiceFabric/clusters/applications/services@2017-07-01-preview"
name The resource name string (required)
location Azure resource location. string
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: applications
properties The service resource properties. ServiceResourceProperties

ServiceResourceProperties

Name Description Value
correlationScheme A list that describes the correlation of the service with other services. ServiceCorrelationDescription[]
defaultMoveCost Specifies the move cost for the service. "High"
"Low"
"Medium"
"Zero"
partitionDescription Describes how the service is partitioned. PartitionSchemeDescription
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
serviceLoadMetrics The service load metrics is given as an array of ServiceLoadMetricDescription objects. ServiceLoadMetricDescription[]
servicePlacementPolicies A list that describes the correlation of the service with other services. object
serviceTypeName The name of the service type string
serviceKind Set the object type Stateful
Stateless (required)

ServiceCorrelationDescription

Name Description Value
Scheme The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. "Affinity"
"AlignedAffinity"
"Invalid"
"NonAlignedAffinity" (required)
ServiceName The name of the service that the correlation relationship is established with. string (required)

PartitionSchemeDescription

Name Description Value
PartitionScheme Set the object type Named
Singleton
UniformInt64Range (required)

NamedPartitionSchemeDescription

Name Description Value
PartitionScheme Specifies how the service is partitioned. "Named" (required)
Count The number of partitions. int (required)
Names Array of size specified by the ‘Count’ parameter, for the names of the partitions. string[] (required)

SingletonPartitionSchemeDescription

Name Description Value
PartitionScheme Specifies how the service is partitioned. "Singleton" (required)

UniformInt64RangePartitionSchemeDescription

Name Description Value
PartitionScheme Specifies how the service is partitioned. "UniformInt64Range" (required)
Count The number of partitions. int (required)
HighKey String indicating the upper bound of the partition key range that
should be split between the partition ‘Count’
string (required)
LowKey String indicating the lower bound of the partition key range that
should be split between the partition ‘Count’
string (required)

ServiceLoadMetricDescription

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"

StatefulServiceProperties

Name Description Value
serviceKind The kind of service (Stateless or Stateful). "Stateful" (required)
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.s). 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.s). string
standByReplicaKeepDuration The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). string
targetReplicaSetSize The target replica set size as a number. int

Constraints:
Min value = 1

StatelessServiceProperties

Name Description Value
serviceKind The kind of service (Stateless or Stateful). "Stateless" (required)
instanceCount The instance count. int