Media Service - Regenerate Key

Regenerates a primary or secondary key for a Media Service.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{mediaServiceName}/regenerateKey?api-version={api-version}

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The unique identifier for a Microsoft Azure subscription.

resourceGroupName
path True
  • string

Name of the resource group within the Azure subscription.

mediaServiceName
path True
  • string

Name of the Media Service.

Regex pattern: ^[a-z0-9]{3,24}$

api-version
query True
  • string

Version of the API to be used with the client request. The current version is 2015-10-01.

Request Body

Name Required Type Description
keyType True
  • enum:
    • Primary
    • Secondary

The keyType indicating which key you want to regenerate, Primary or Secondary.

Responses

Name Type Description
200 OK

Success. The Media Services key specified in the input was regenerated.

Other Status Codes

Regenerate Media Service key failed.

Examples

MediaServiceRegenerateKey

Sample Request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contosoresources/providers/Microsoft.Media/mediaservices/contosmedia/regenerateKey?api-version=2015-10-01
{
  "keyType": "Primary"
}

Sample Response

{
  "key": ""
}

Definitions

ApiError
RegenerateKeyOutput
Name Type Description
code
  • string

Error code.

message
  • string

Error message.

Name Type Description
key
  • string

The new value of either the primary or secondary key.