Iot Dps Resource - List Keys

List the primary and secondary keys for a provisioning service.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/listkeys?api-version=2026-08-31

URI Parameters

Name In Required Type Description
provisioningServiceName
path True

string

Name of the provisioning service to retrieve.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

SharedAccessSignatureAuthorizationRuleListResult

Azure operation completed successfully.

Other Status Codes

ErrorDetails

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

DPSListKeys

Sample request

POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myFirstProvisioningService/listkeys?api-version=2026-08-31

Sample response

{
  "value": [
    {
      "keyName": "key1",
      "primaryKey": "#####################################",
      "rights": "ServiceConfig",
      "secondaryKey": "###################################"
    },
    {
      "keyName": "key2",
      "primaryKey": "#######################################",
      "rights": "ServiceConfig",
      "secondaryKey": "####################################="
    }
  ]
}

Definitions

Name Description
AccessRightsDescription

Rights that this key has.

ErrorDetails

Error details.

SharedAccessSignatureAuthorizationRuleAccessRightsDescription

Description of the shared access key.

SharedAccessSignatureAuthorizationRuleListResult

List of shared access keys.

AccessRightsDescription

Rights that this key has.

Value Description
ServiceConfig
EnrollmentRead
EnrollmentWrite
DeviceConnect
RegistrationStatusRead
RegistrationStatusWrite

ErrorDetails

Error details.

Name Type Description
code

integer (int32)

The error code.

details

string

The error details.

httpStatusCode

string

The HTTP status code.

message

string

The error message.

SharedAccessSignatureAuthorizationRuleAccessRightsDescription

Description of the shared access key.

Name Type Description
keyName

string

Name of the key.

primaryKey

string

Primary SAS key value.

rights

AccessRightsDescription

Rights that this key has.

secondaryKey

string

Secondary SAS key value.

SharedAccessSignatureAuthorizationRuleListResult

List of shared access keys.

Name Type Description
nextLink

string (uri)

The link to the next page of items

value

SharedAccessSignatureAuthorizationRuleAccessRightsDescription[]

The SharedAccessSignatureAuthorizationRuleAccessRightsDescription items on this page