Iot Dps Resource - List Keys For Key Name

Get a shared access policy by name from a provisioning service.
List primary and secondary keys for a specific key name

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys?api-version=2022-12-12

URI Parameters

Name In Required Type Description
keyName
path True

string

Logical key name to get key-values for.

provisioningServiceName
path True

string

Name of the provisioning service.

resourceGroupName
path True

string

The name of the resource group that contains the provisioning service.

subscriptionId
path True

string

The subscription identifier.

api-version
query True

string

The version of the API.

Responses

Name Type Description
200 OK

SharedAccessSignatureAuthorizationRule[AccessRightsDescription]

This is a synchronous operation. The body contains a JSON-serialized shared access policy, including keys, that you can use to access one or more provisioning service endpoints.

Other Status Codes

ErrorDetails

Default 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

DPSGetKey

Sample request

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

Sample response

{
  "keyName": "testKey",
  "primaryKey": "##################################",
  "secondaryKey": "################################",
  "rights": "RegistrationStatusWrite"
}

Definitions

Name Description
AccessRightsDescription

Rights that this key has.

ErrorDetails

Error details.

SharedAccessSignatureAuthorizationRule[AccessRightsDescription]

Description of the shared access key.

AccessRightsDescription

Rights that this key has.

Name Type Description
DeviceConnect

string

EnrollmentRead

string

EnrollmentWrite

string

RegistrationStatusRead

string

RegistrationStatusWrite

string

ServiceConfig

string

ErrorDetails

Error details.

Name Type Description
code

integer

The error code.

details

string

The error details.

httpStatusCode

string

The HTTP status code.

message

string

The error message.

SharedAccessSignatureAuthorizationRule[AccessRightsDescription]

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.