---
title: "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"
method: PUT
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"
tags: ["FirewallRules"]
---

# PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules

`PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules`

Replaces all firewall rules on the server.

## Path parameters

- `resourceGroupName` string, required
- `serverName` string, required
- `subscriptionId` string, required

## Query parameters

- `api-version` string, required

## Request body

- FirewallRuleList — A list of server firewall rules.
  - `values` FirewallRule[]
    - `id` string — Resource ID.
    - `name` string — Resource name.
    - `type` string — Resource type.

## Response `200`

Successfully updated the firewall rules.

- FirewallRule — ARM resource.
  - `id` string — Resource ID.
  - `name` string — Resource name.
  - `type` string — Resource type.

## Other responses

- `202` — Creating or updating the Server Firewall Rules is in progress.
- `default` — *** Error Responses: *** * 400 InvalidResourceId - Invalid resource identifier. * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url. * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url. * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url. * 400 InvalidServerFirewallRuleResourceRequest - The server firewall rule resource request is invalid. * 400 InvalidServerFirewallRuleResourceParameters - The server firewall rule resource parameter is invalid. * 400 FirewallRuleNotIPv4Address - The provided firewall rule address is not IPv4 * 400 FirewallRuleInvalidRange - The specified firewall rule range is invalid. * 400 FirewallRuleNameTooLong - The provided firewall rule name is too long * 400 FirewallRuleNameEmpty - The provided firewall rule name is empty * 404 SubscriptionDoesNotHaveServer - The requested server was not found * 404 OperationIdNotFound - The operation with Id does not exist. * 409 OperationCancelled - The operation has been cancelled by user. * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource. * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

---

[API](https://skmtc.dev/azure/apis/sqlmanagementclient-36.md) · [All operations](https://skmtc.dev/azure/apis/sqlmanagementclient-36/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/sqlmanagementclient-36/revisions/e0d6981f3fa4/schema)
