Iot Hub Resource - List Keys

Get the security metadata for 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}/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.

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 array of shared access policies, including keys, that you can use to access the IoT hub endpoints.

Other Status Codes

DefaultErrorResponse

Definitions

ErrorDetails
SharedAccessSignatureAuthorizationRule

The properties of an IoT hub shared access policy.

SharedAccessSignatureAuthorizationRuleListResult
Name Type Description
Code
  • string

The error code.

Details
  • string

The error details.

HttpStatusCode
  • string

The HTTP status code.

Message
  • string

The error message.

The properties of an IoT hub shared access policy.

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.

Name Type Description
nextLink
  • string

The next link.

value

The list of shared access policies.