Iot Hub Resource - Get Keys For Key Name
Pobierz zasady dostępu współdzielonego według nazwy z centrum IoT. Aby uzyskać więcej informacji, zobacz: 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=2026-11-01
Parametry identyfikatora URI
| Nazwisko | W | Wymagane | Typ | Opis |
|---|---|---|---|---|
|
key
|
path | True |
string |
Nazwa zasad dostępu współdzielonego. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
Nazwa grupy zasobów. Nazwa jest niewrażliwa na wielkość liter. |
|
resource
|
path | True |
string |
Nazwa centrum IoT. |
|
subscription
|
path | True |
string (uuid) |
Identyfikator subskrypcji docelowej. Wartość musi być identyfikatorem UUID. |
|
api-version
|
query | True |
string minLength: 1 |
Wersja interfejsu API do użycia dla tej operacji. |
Odpowiedzi
| Nazwisko | Typ | Opis |
|---|---|---|
| 200 OK |
Operacja Azure zakończyła się pomyślnie. |
|
| Other Status Codes |
Nieoczekiwana odpowiedź na błąd. |
Zabezpieczenia
azure_auth
Przepływ OAuth2 w usłudze Azure Active Directory.
Typ:
oauth2
Flow:
implicit
Adres URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresy
| Nazwisko | Opis |
|---|---|
| user_impersonation | podszywaj się pod konto użytkownika |
Przykłady
IotHubResource_GetKeysForKeyName
Przykładowe żądanie
POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/IotHubKeys/iothubowner/listkeys?api-version=2026-11-01
Przykładowa odpowiedź
{
"keyName": "iothubowner",
"primaryKey": "<primaryKey>",
"rights": "RegistryWrite, ServiceConnect, DeviceConnect",
"secondaryKey": "<secondaryKey>"
}
Definicje
| Nazwisko | Opis |
|---|---|
|
Access |
Uprawnienia przypisane do zasad dostępu współdzielonego. |
|
Error |
Szczegóły błędu. |
|
Shared |
Właściwości zasad dostępu współdzielonego centrum IoT. |
AccessRights
Uprawnienia przypisane do zasad dostępu współdzielonego.
| Wartość | Opis |
|---|---|
| RegistryRead |
RegistryRead |
| RegistryWrite |
RegistryWrite |
| ServiceConnect |
ServiceConnect |
| DeviceConnect |
UrządzeniePołączenie urządzenia |
| RegistryRead, RegistryWrite |
RejestryRead, RegistryWrite |
| RegistryRead, ServiceConnect |
RegistryRead, ServiceConnect |
| RegistryRead, DeviceConnect |
RejestryRead, DeviceConnect |
| RegistryWrite, ServiceConnect |
RegistryWrite, ServiceConnect |
| RegistryWrite, DeviceConnect |
RegistryWrite, DeviceConnect |
| ServiceConnect, DeviceConnect |
ServiceConnect, DeviceConnect |
| RegistryRead, RegistryWrite, ServiceConnect |
RegistryRead, RegistryWrite, ServiceConnect |
| RegistryRead, RegistryWrite, DeviceConnect |
RegistryRead, RegistryWrite, DeviceConnect |
| RegistryRead, ServiceConnect, DeviceConnect |
RegistryRead, ServiceConnect, DeviceConnect |
| RegistryWrite, ServiceConnect, DeviceConnect |
RegistryWrite, ServiceConnect, DeviceConnect |
| RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect |
RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect |
ErrorDetails
Szczegóły błędu.
| Nazwisko | Typ | Opis |
|---|---|---|
| code |
string |
Kod błędu. |
| details |
string |
Szczegóły błędu. |
| httpStatusCode |
string |
Kod statusu HTTP. |
| message |
string |
Komunikat o błędzie. |
SharedAccessSignatureAuthorizationRule
Właściwości zasad dostępu współdzielonego centrum IoT.
| Nazwisko | Typ | Opis |
|---|---|---|
| keyName |
string |
Nazwa zasad dostępu współdzielonego. |
| primaryKey |
string |
Klucz podstawowy. |
| rights |
Uprawnienia przypisane do zasad dostępu współdzielonego. |
|
| secondaryKey |
string |
Klucz pomocniczy. |