Iot Hub Resource - List Keys

Obtenga los metadatos de seguridad de un centro de IoT. Para obtener más información, consulte: 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=2018-04-01

Parámetros de identificador URI

Nombre En Requerido Tipo Description
resourceGroupName
path True

string

Nombre del grupo de recursos que contiene el centro de IoT.

resourceName
path True

string

Nombre del centro de IoT.

subscriptionId
path True

string

Identificador de la suscripción.

api-version
query True

string

La versión de la API.

Respuestas

Nombre Tipo Description
200 OK

SharedAccessSignatureAuthorizationRuleListResult

Se trata de una operación sincrónica. El cuerpo contiene una matriz serializada por JSON de directivas de acceso compartido, incluidas las claves, que puede usar para acceder a los puntos de conexión de IoT Hub.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Seguridad

azure_auth

Flujo OAuth2 de Azure Active Directory

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

Scopes

Nombre Description
user_impersonation suplantación de su cuenta de usuario

Ejemplos

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=2018-04-01

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

Definiciones

Nombre Description
AccessRights

Permisos asignados a la directiva de acceso compartido.

ErrorDetails

Detalles del error.

SharedAccessSignatureAuthorizationRule

Las propiedades de una directiva de acceso compartido de IoT Hub.

SharedAccessSignatureAuthorizationRuleListResult

Lista de directivas de acceso compartido con un vínculo siguiente.

AccessRights

Permisos asignados a la directiva de acceso compartido.

Nombre Tipo 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

Detalles del error.

Nombre Tipo Description
code

string

Código de error.

details

string

Los detalles del error.

httpStatusCode

string

El código de estado HTTP.

message

string

El mensaje de error.

SharedAccessSignatureAuthorizationRule

Las propiedades de una directiva de acceso compartido de IoT Hub.

Nombre Tipo Description
keyName

string

Nombre de la directiva de acceso compartido.

primaryKey

string

Clave principal.

rights

AccessRights

Permisos asignados a la directiva de acceso compartido.

secondaryKey

string

Clave secundaria.

SharedAccessSignatureAuthorizationRuleListResult

Lista de directivas de acceso compartido con un vínculo siguiente.

Nombre Tipo Description
nextLink

string

Vínculo siguiente.

value

SharedAccessSignatureAuthorizationRule[]

Lista de directivas de acceso compartido.