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 |
|
The subscription identifier. |
|
resourceGroupName
|
path | True |
|
The name of the resource group that contains the IoT hub. |
|
resourceName
|
path | True |
|
The name of the IoT hub. |
|
keyName
|
path | True |
|
The name of the shared access policy. |
|
api-version
|
query | True |
|
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 |
|
The error code. |
| Details |
|
The error details. |
| HttpStatusCode |
|
The HTTP status code. |
| Message |
|
The error message. |
| Name | Type | Description |
|---|---|---|
| keyName |
|
The name of the shared access policy. |
| primaryKey |
|
The primary key. |
| rights |
|
The permissions assigned to the shared access policy. |
| secondaryKey |
|
The secondary key. |