---
title: "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey"
method: POST
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey"
tags: ["WebPubSubResources"]
---

# POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey

`POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey`

## Request

- Base URL: `https://management.azure.com`
- URL: `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey`
- Auth: OAuth 2
  - Implicit: `https://login.microsoftonline.com/common/oauth2/authorize`
  - Scopes: `user_impersonation`

Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time.

## Path parameters

- `subscriptionId` string, uuid, required
- `resourceGroupName` string, required
- `resourceName` string, required

## Query parameters

- `api-version` string, required

## Request body

- RegenerateKeyParameters: Parameters describes the request to regenerate access keys
  - `keyType` 'Primary' | 'Secondary' | 'Salt': The type of access key.

## Response `200`

Azure operation completed successfully.

- WebPubSubKeys: A class represents the access keys of the resource.
  - `primaryKey` string, password: The primary access key.
  - `secondaryKey` string, password: The secondary access key.
  - `primaryConnectionString` string, password: Connection string constructed via the primaryKey
  - `secondaryConnectionString` string, password: Connection string constructed via the secondaryKey

## Other responses

- `202`: Azure operation completed successfully.
- `default`: An unexpected error response.

## Changes

- **2026-07-13** (2021-04-01-preview) `1af7b550cd0b`: 3 breaking, 2 info
  - added the new path request parameter `resourceGroupName`
  - added the new path request parameter `subscriptionId`
  - added the new required `query` request parameter `api-version`
  - api tag `WebPubSubResources` added
  - …1 more
- **2026-07-13** (2021-04-01-preview) `41ecf87c9dda`: 2 info
  - api tag `WebPubSubResources` added
  - api tag `WebPubSub` removed
- **2026-07-13** (2021-04-01-preview) `aa4834c0c016`: 3 warning, 1 info
  - deleted the `path` request parameter `resourceGroupName`
  - deleted the `path` request parameter `subscriptionId`
  - deleted the `query` request parameter `api-version`
  - added the success response with the status `200`

[Operation history](https://skmtc.dev/azure/apis/webpubsub-microsoft-signalrservice-signalrservice/changes/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.SignalRService/webPubSub/:resourceName/regenerateKey/post.md)

---

[API](https://skmtc.dev/azure/apis/webpubsub-microsoft-signalrservice-signalrservice.md) - [All operations](https://skmtc.dev/azure/apis/webpubsub-microsoft-signalrservice-signalrservice/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/webpubsub-microsoft-signalrservice-signalrservice/revisions/1af7b550cd0b?raw)
