---
title: "Updates a Service Fabric service using the specified update description."
method: POST
path: "/Services/{serviceId}/$/Update"
tags: ["Service"]
---

# Updates a Service Fabric service using the specified update description.

`POST /Services/{serviceId}/$/Update`

This API allows updating properties of a running Service Fabric service. The set of properties that can be updated are a subset of the properties that were specified at the time of creating the service. The current set of properties can be obtained using `GetServiceDescription` API. Note that updating the properties of a running service is different than upgrading your application using `StartApplicationUpgrade` API. The upgrade is a long running background operation that involves moving the application from one version to another, one upgrade domain at a time, whereas update applies the new properties immediately to the service.

## Path parameters

- `serviceId` string, required

## Query parameters

- `api-version` '6.0', required
- `timeout` integer

## Request body

- ServiceUpdateDescription — A ServiceUpdateDescription contains all of the information necessary to update a service.
  - `ServiceKind` 'Invalid' | 'Stateless' | 'Stateful', required — The kind of service (Stateless or Stateful).
  - `Flags` string — Flags indicating whether other properties are set. Each of the associated properties corresponds to a flag, specified below, which, if set, indicate that the property is specified. This property can be a combination of those flags obtained using bitwise 'OR' operator. For example, if the provided value is 6 then the flags for ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. - None - Does not indicate any other properties are set. The value is zero. - TargetReplicaSetSize/InstanceCount - Indicates whether the TargetReplicaSetSize property (for Stateful services) or the InstanceCount property (for Stateless services) is set. The value is 1. - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration property is set. The value is 2. - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is set. The value is 4. - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration property is set. The value is 8. - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The value is 16. - PlacementConstraints - Indicates the PlacementConstraints property is set. The value is 32. - PlacementPolicyList - Indicates the ServicePlacementPolicies property is set. The value is 64. - Correlation - Indicates the CorrelationScheme property is set. The value is 128. - Metrics - Indicates the ServiceLoadMetrics property is set. The value is 256. - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value is 512. - ScalingPolicy - Indicates the ScalingPolicies property is set. The value is 1024. - ServicePlacementTimeLimit - Indicates the ServicePlacementTimeLimit property is set. The value is 2048. - MinInstanceCount - Indicates the MinInstanceCount property is set. The value is 4096. - MinInstancePercentage - Indicates the MinInstancePercentage property is set. The value is 8192. - InstanceCloseDelayDuration - Indicates the InstanceCloseDelayDuration property is set. The value is 16384. - InstanceRestartWaitDuration - Indicates the InstanceCloseDelayDuration property is set. The value is 32768. - DropSourceReplicaOnMove - Indicates the DropSourceReplicaOnMove property is set. The value is 65536. - ServiceDnsName - Indicates the ServiceDnsName property is set. The value is 131072. - TagsForPlacement - Indicates the TagsForPlacement property is set. The value is 1048576. - TagsForRunning - Indicates the TagsForRunning property is set. The value is 2097152.
  - `PlacementConstraints` string — 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)".
  - `CorrelationScheme` ServiceCorrelationDescription[] — A list that describes the correlation of the service with other services.
    - `Scheme` 'Invalid' | 'Affinity' | 'AlignedAffinity' | 'NonAlignedAffinity', required — The service correlation scheme.
    - `ServiceName` string, required — The full name of the service with 'fabric:' URI scheme.
  - `LoadMetrics` ServiceLoadMetricDescription[] — The service load metrics is given as an array of ServiceLoadMetricDescription objects.
    - `Name` string, required — 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.
    - `Weight` 'Zero' | 'Low' | 'Medium' | 'High' — Determines the metric weight relative to the other metrics that are configured for this service. During runtime, if two metrics end up in conflict, the Cluster Resource Manager prefers the metric with the higher weight.
    - `PrimaryDefaultLoad` integer — 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.
    - `SecondaryDefaultLoad` integer — 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.
    - `AuxiliaryDefaultLoad` integer — Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is an Auxiliary replica.
    - `DefaultLoad` integer — Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric.
  - `ServicePlacementPolicies` ServicePlacementPolicyDescription[] — A list that describes the correlation of the service with other services.
    - `Type` 'Invalid' | 'InvalidDomain' | 'RequireDomain' | 'PreferPrimaryDomain' | 'RequireDomainDistribution' | 'NonPartiallyPlaceService' | 'AllowMultipleStatelessInstancesOnNode', required — The type of placement policy for a service fabric service. Following are the possible values.
  - `DefaultMoveCost` 'Zero' | 'Low' | 'Medium' | 'High' | 'VeryHigh' — Specifies the move cost for the service.
  - `ScalingPolicies` ScalingPolicyDescription[] — A list that describes the scaling policies.
    - `ScalingTrigger` ScalingTriggerDescription, required — Describes the trigger for performing a scaling operation.
      - `Kind` 'Invalid' | 'AveragePartitionLoad' | 'AverageServiceLoad', required — Enumerates the ways that a service can be scaled.
    - `ScalingMechanism` ScalingMechanismDescription, required — Describes the mechanism for performing a scaling operation.
      - `Kind` 'Invalid' | 'PartitionInstanceCount' | 'AddRemoveIncrementalNamedPartition', required — Enumerates the ways that a service can be scaled.
  - `ServiceDnsName` string — The DNS name of the service.
  - `TagsForPlacement` NodeTagsDescription — Describes the tags required for placement or running of the service.
    - `Count` integer, required — The number of tags.
    - `Tags` string[], required — Array of size specified by the ‘Count’ parameter, for the placement tags of the service.
  - `TagsForRunning` NodeTagsDescription — Describes the tags required for placement or running of the service.
    - `Count` integer, required — The number of tags.
    - `Tags` string[], required — Array of size specified by the ‘Count’ parameter, for the placement tags of the service.

## Response `200`

A successful operation will return 202 status code.

## Other responses

- `default` — The detailed error response.

---

[API](https://skmtc.net/azure/apis/servicefabric-servicefabric.md) · [All operations](https://skmtc.net/azure/apis/servicefabric-servicefabric/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/servicefabric-servicefabric/revisions/8fd479ce0f16/schema)
