Iot Hub Resource - Get Keys For Key Name
Hämta en princip för delad åtkomst med namn från en IoT-hubb. Mer information finns i: 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=2023-06-30
URI-parametrar
| Name | I | Obligatorisk | Typ | Description |
|---|---|---|---|---|
|
key
|
path | True |
string |
Namnet på principen för delad åtkomst. |
|
resource
|
path | True |
string |
Namnet på resursgruppen som innehåller IoT-hubben. |
|
resource
|
path | True |
string |
Namnet på IoT-hubben. |
|
subscription
|
path | True |
string |
Prenumerationsidentifieraren. |
|
api-version
|
query | True |
string |
Versionen av API:et. |
Svar
| Name | Typ | Description |
|---|---|---|
| 200 OK |
Det här är en synkron åtgärd. Brödtexten innehåller en JSON-serialiserad princip för delad åtkomst, inklusive nycklar, som du kan använda för att komma åt en eller flera IoT Hub-slutpunkter. |
|
| Other Status Codes |
DefaultErrorResponse |
Säkerhet
azure_auth
Azure Active Directory OAuth2-flöde
Typ:
oauth2
Flow:
implicit
Auktoriseringswebbadress:
https://login.microsoftonline.com/common/oauth2/authorize
Omfattningar
| Name | Description |
|---|---|
| user_impersonation | personifiera ditt användarkonto |
Exempel
IotHubResource_GetKeysForKeyName
Exempelbegäran
POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/IotHubKeys/iothubowner/listkeys?api-version=2023-06-30
Exempelsvar
{
"keyName": "iothubowner",
"primaryKey": "<primaryKey>",
"secondaryKey": "<secondaryKey>",
"rights": "RegistryWrite, ServiceConnect, DeviceConnect"
}
Definitioner
| Name | Description |
|---|---|
|
Access |
De behörigheter som tilldelats principen för delad åtkomst. |
|
Error |
Felinformation. |
|
Shared |
Egenskaperna för en princip för delad åtkomst i IoT Hub. |
AccessRights
De behörigheter som tilldelats principen för delad åtkomst.
| Värde | Description |
|---|---|
| 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 |
ErrorDetails
Felinformation.
| Name | Typ | Description |
|---|---|---|
| code |
string |
Felkoden. |
| details |
string |
Felinformationen. |
| httpStatusCode |
string |
HTTP-statuskoden. |
| message |
string |
Felmeddelandet. |
SharedAccessSignatureAuthorizationRule
Egenskaperna för en princip för delad åtkomst i IoT Hub.
| Name | Typ | Description |
|---|---|---|
| keyName |
string |
Namnet på principen för delad åtkomst. |
| primaryKey |
string |
Primärnyckeln. |
| rights |
De behörigheter som tilldelats principen för delad åtkomst. |
|
| secondaryKey |
string |
Den sekundära nyckeln. |