Iot Hub Resource - Get Keys For Key Name

Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys?api-version={api-version}

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The subscription identifier.

resourceGroupName
path True
  • string

The name of the resource group that contains the IoT hub.

resourceName
path True
  • string

The name of the IoT hub.

keyName
path True
  • string

The name of the shared access policy.

api-version
query True
  • string

The version of the API.

Responses

Name Type Description
200 OK

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 IoT hub endpoints.

Other Status Codes

DefaultErrorResponse

Definitions

ErrorDetails
SharedAccessSignatureAuthorizationRule
Name Type Description
Code
  • string

The error code.

Details
  • string

The error details.

HttpStatusCode
  • string

The HTTP status code.

Message
  • string

The error message.

Name Type Description
keyName
  • string

The name of the shared access policy.

primaryKey
  • string

The primary key.

rights
  • enum:
    • RegistryRead
    • RegistryWrite
    • ServiceConnect
    • DeviceConnect
    • RegistryRead, RegistryWrite
    • RegistryRead, ServiceConnect
    • RegistryRead, DeviceConnect
    • RegistryWrite, ServiceConnect
    • RegistryWrite, DeviceConnect
    • ServiceConnect, DeviceConnect
    • RegistryRead, RegistryWrite, ServiceConnect
    • RegistryRead, RegistryWrite, DeviceConnect
    • RegistryRead, ServiceConnect, DeviceConnect
    • RegistryWrite, ServiceConnect, DeviceConnect
    • RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect

The permissions assigned to the shared access policy.

secondaryKey
  • string

The secondary key.