Iot Hub Resource - List Keys

Haal de beveiligingsmetagegevens voor een IoT-hub op. Zie https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security voor meer informatie.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys?api-version=2023-06-30

URI-parameters

Name In Vereist Type Description
resourceGroupName
path True

string

De naam van de resourcegroep die de IoT-hub bevat.

resourceName
path True

string

De naam van de IoT-hub.

subscriptionId
path True

string

De abonnements-id.

api-version
query True

string

De versie van de API.

Antwoorden

Name Type Description
200 OK

SharedAccessSignatureAuthorizationRuleListResult

Dit is een synchrone bewerking. De hoofdtekst bevat een JSON-geserialiseerde matrix van beleid voor gedeelde toegang, inclusief sleutels, die u kunt gebruiken voor toegang tot de IoT-hub-eindpunten.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Beveiliging

azure_auth

Azure Active Directory OAuth2-stroom

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

Scopes

Name Description
user_impersonation Uw gebruikersaccount imiteren

Voorbeelden

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"
    }
  ]
}

Definities

Name Description
AccessRights

De machtigingen die zijn toegewezen aan het beleid voor gedeelde toegang.

ErrorDetails

Foutdetails.

SharedAccessSignatureAuthorizationRule

De eigenschappen van een beleid voor gedeelde toegang van IoT Hub.

SharedAccessSignatureAuthorizationRuleListResult

De lijst met beleid voor gedeelde toegang met een volgende koppeling.

AccessRights

De machtigingen die zijn toegewezen aan het beleid voor gedeelde toegang.

Name Type 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

Foutdetails.

Name Type Description
code

string

De foutcode.

details

string

De foutdetails.

httpStatusCode

string

De HTTP-statuscode.

message

string

Het foutbericht.

SharedAccessSignatureAuthorizationRule

De eigenschappen van een beleid voor gedeelde toegang van IoT Hub.

Name Type Description
keyName

string

De naam van het beleid voor gedeelde toegang.

primaryKey

string

De primaire sleutel.

rights

AccessRights

De machtigingen die zijn toegewezen aan het beleid voor gedeelde toegang.

secondaryKey

string

De secundaire sleutel.

SharedAccessSignatureAuthorizationRuleListResult

De lijst met beleid voor gedeelde toegang met een volgende koppeling.

Name Type Description
nextLink

string

De volgende koppeling.

value

SharedAccessSignatureAuthorizationRule[]

De lijst met beleid voor gedeelde toegang.