Iot Hub Resource - Get Keys For Key Name

Získejte zásady sdíleného přístupu podle názvu ze služby IoT Hub. Další informace najdete v tématu: 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

Parametry identifikátoru URI

Name V Vyžadováno Typ Description
keyName
path True

string

Název zásady sdíleného přístupu.

resourceGroupName
path True

string

Název skupiny prostředků, která obsahuje centrum IoT.

resourceName
path True

string

Název centra IoT.

subscriptionId
path True

string

Identifikátor předplatného.

api-version
query True

string

Verze rozhraní API

Odpovědi

Name Typ Description
200 OK

SharedAccessSignatureAuthorizationRule

Jedná se o synchronní operaci. Tělo obsahuje zásady sdíleného přístupu serializované json, včetně klíčů, které můžete použít pro přístup k jednomu nebo několika koncovým bodům IoT Hubu.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Zabezpečení

azure_auth

Tok Azure Active Directory OAuth2

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation zosobnění uživatelského účtu

Příklady

IotHubResource_GetKeysForKeyName

Sample Request

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

Sample Response

{
  "keyName": "iothubowner",
  "primaryKey": "<primaryKey>",
  "secondaryKey": "<secondaryKey>",
  "rights": "RegistryWrite, ServiceConnect, DeviceConnect"
}

Definice

Name Description
AccessRights

Oprávnění přiřazená k zásadám sdíleného přístupu.

ErrorDetails

Podrobnosti o chybě.

SharedAccessSignatureAuthorizationRule

Vlastnosti zásad sdíleného přístupu služby IoT Hub.

AccessRights

Oprávnění přiřazená k zásadám sdíleného přístupu.

Name Typ Description
DeviceConnect

string

RegistryRead

string

RegistryRead, DeviceConnect

string

RegistryRead, RegistryWrite

string

RegistryRead, RegistryWrite, DeviceConnect

string

RegistryRead, RegistryWrite, ServiceConnect

string

RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect

string

RegistryRead, ServiceConnect

string

RegistryRead, ServiceConnect, DeviceConnect

string

RegistryWrite

string

RegistryWrite, DeviceConnect

string

RegistryWrite, ServiceConnect

string

RegistryWrite, ServiceConnect, DeviceConnect

string

ServiceConnect

string

ServiceConnect, DeviceConnect

string

ErrorDetails

Podrobnosti o chybě.

Name Typ Description
code

string

Kód chyby

details

string

Podrobnosti o chybě

httpStatusCode

string

Stavový kód HTTP

message

string

Chybová zpráva

SharedAccessSignatureAuthorizationRule

Vlastnosti zásad sdíleného přístupu služby IoT Hub.

Name Typ Description
keyName

string

Název zásady sdíleného přístupu.

primaryKey

string

Primární klíč.

rights

AccessRights

Oprávnění přiřazená k zásadám sdíleného přístupu.

secondaryKey

string

Sekundární klíč.