---
title: "Moves the primary replica of a partition of a stateful service."
method: POST
path: "/Partitions/{partitionId}/$/MovePrimaryReplica"
tags: ["Partition"]
---

# Moves the primary replica of a partition of a stateful service.

`POST /Partitions/{partitionId}/$/MovePrimaryReplica`

This command moves the primary replica of a partition of a stateful service, respecting all constraints.
If NodeName parameter is specified, primary will be moved to the specified node (if constraints allow it).
If NodeName parameter is not specified, primary replica will be moved to a random node in the cluster.
If IgnoreConstraints parameter is specified and set to true, then primary will be moved regardless of the constraints.

## Path parameters

- `partitionId` string, uuid, required

## Query parameters

- `api-version` '6.5', required
- `NodeName` string
- `IgnoreConstraints` boolean
- `timeout` integer

## Response `200`

A successful operation request will return 200 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)
