Iot Hub Resource - List Keys

Hämta säkerhetsmetadata för 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}/listkeys?api-version=2023-06-30

URI-parametrar

Name I Obligatorisk Typ Description
resourceGroupName
path True

string

Namnet på resursgruppen som innehåller IoT-hubben.

resourceName
path True

string

Namnet på IoT-hubben.

subscriptionId
path True

string

Prenumerationsidentifieraren.

api-version
query True

string

Versionen av API:et.

Svar

Name Typ Description
200 OK

SharedAccessSignatureAuthorizationRuleListResult

Det här är en synkron åtgärd. Brödtexten innehåller en JSON-serialiserad matris med principer för delad åtkomst, inklusive nycklar, som du kan använda för att komma åt IoT Hub-slutpunkterna.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Säkerhet

azure_auth

Azure Active Directory OAuth2 Flow

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

Scopes

Name Description
user_impersonation personifiera ditt användarkonto

Exempel

IotHubResource_ListKeys

Sample Request

POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/listkeys?api-version=2023-06-30

Sample Response

{
  "value": [
    {
      "keyName": "iothubowner",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "RegistryWrite, ServiceConnect, DeviceConnect"
    },
    {
      "keyName": "service",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "ServiceConnect"
    },
    {
      "keyName": "device",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "DeviceConnect"
    },
    {
      "keyName": "registryRead",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "RegistryRead"
    },
    {
      "keyName": "registryReadWrite",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "RegistryWrite"
    }
  ]
}

Definitioner

Name Description
AccessRights

Behörigheterna som tilldelats till principen för delad åtkomst.

ErrorDetails

Felinformation.

SharedAccessSignatureAuthorizationRule

Egenskaperna för en princip för delad åtkomst i IoT Hub.

SharedAccessSignatureAuthorizationRuleListResult

Listan över principer för delad åtkomst med en nästa länk.

AccessRights

Behörigheterna som tilldelats till principen för delad åtkomst.

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

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

AccessRights

Behörigheterna som tilldelats till principen för delad åtkomst.

secondaryKey

string

Den sekundära nyckeln.

SharedAccessSignatureAuthorizationRuleListResult

Listan över principer för delad åtkomst med en nästa länk.

Name Typ Description
nextLink

string

Nästa länk.

value

SharedAccessSignatureAuthorizationRule[]

Listan över principer för delad åtkomst.