az iot hub certificate

Manage IoT Hub certificates.

Commands

az iot hub certificate create Create/upload an Azure IoT Hub certificate.
az iot hub certificate delete Deletes an Azure IoT Hub certificate.
az iot hub certificate generate-verification-code Generates a verification code for an Azure IoT Hub certificate.
az iot hub certificate list Lists all certificates contained within an Azure IoT Hub.
az iot hub certificate show Shows information about a particular Azure IoT Hub certificate.
az iot hub certificate update Update an Azure IoT Hub certificate.
az iot hub certificate verify Verifies an Azure IoT Hub certificate.

az iot hub certificate create

Create/upload an Azure IoT Hub certificate.

For a detailed explanation of CA certificates in Azure IoT Hub, see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-x509ca-overview.

az iot hub certificate create --hub-name
--name
--path
[--resource-group]

Examples

Uploads a CA certificate PEM file to an IoT hub.

az iot hub certificate create --hub-name MyIotHub --name MyCertificate --path /certificates/Certificate.pem

Uploads a CA certificate CER file to an IoT hub.

az iot hub certificate create --hub-name MyIotHub --name MyCertificate --path /certificates/Certificate.cer

Required Parameters

--hub-name

IoT Hub name.

--name -n

A friendly name for the certificate.

--path -p

The path to the file containing the certificate.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot hub certificate delete

Deletes an Azure IoT Hub certificate.

For a detailed explanation of CA certificates in Azure IoT Hub, see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-x509ca-overview.

az iot hub certificate delete --etag
--hub-name
--name
[--resource-group]

Examples

Deletes MyCertificate

az iot hub certificate delete --hub-name MyIotHub --name MyCertificate --etag AAAAAAAAAAA=

Required Parameters

--etag -e

Entity Tag (etag) of the object.

--hub-name

IoT Hub name.

--name -n

A friendly name for the certificate.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot hub certificate generate-verification-code

Generates a verification code for an Azure IoT Hub certificate.

This verification code is used to complete the proof of possession step for a certificate. Use this verification code as the CN of a new certificate signed with the root certificates private key. For a detailed explanation of CA certificates in Azure IoT Hub, see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-x509ca-overview.

az iot hub certificate generate-verification-code --etag
--hub-name
--name
[--resource-group]

Examples

Generates a verification code for MyCertificate

az iot hub certificate generate-verification-code --hub-name MyIotHub --name MyCertificate --etag AAAAAAAAAAA=

Required Parameters

--etag -e

Entity Tag (etag) of the object.

--hub-name

IoT Hub name.

--name -n

A friendly name for the certificate.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot hub certificate list

Lists all certificates contained within an Azure IoT Hub.

For a detailed explanation of CA certificates in Azure IoT Hub, see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-x509ca-overview.

az iot hub certificate list --hub-name
[--resource-group]

Examples

List all certificates in MyIotHub

az iot hub certificate list --hub-name MyIotHub

Required Parameters

--hub-name

IoT Hub name.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot hub certificate show

Shows information about a particular Azure IoT Hub certificate.

For a detailed explanation of CA certificates in Azure IoT Hub, see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-x509ca-overview.

az iot hub certificate show --hub-name
--name
[--resource-group]

Examples

Show details about MyCertificate

az iot hub certificate show --hub-name MyIotHub --name MyCertificate

Required Parameters

--hub-name

IoT Hub name.

--name -n

A friendly name for the certificate.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot hub certificate update

Update an Azure IoT Hub certificate.

Uploads a new certificate to replace the existing certificate with the same name. For a detailed explanation of CA certificates in Azure IoT Hub, see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-x509ca-overview.

az iot hub certificate update --etag
--hub-name
--name
--path
[--resource-group]

Examples

Updates a CA certificate in an IoT hub by uploading a new PEM file.

az iot hub certificate update --hub-name MyIotHub --name MyCertificate --path /certificates/NewCertificate.pem --etag AAAAAAAAAAA=

Updates a CA certificate in an IoT hub by uploading a new CER file.

az iot hub certificate update --hub-name MyIotHub --name MyCertificate --path /certificates/NewCertificate.cer --etag AAAAAAAAAAA=

Required Parameters

--etag -e

Entity Tag (etag) of the object.

--hub-name

IoT Hub name.

--name -n

A friendly name for the certificate.

--path -p

The path to the file containing the certificate.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot hub certificate verify

Verifies an Azure IoT Hub certificate.

Verifies a certificate by uploading a verification certificate containing the verification code obtained by calling generate-verification-code. This is the last step in the proof of possession process. For a detailed explanation of CA certificates in Azure IoT Hub, see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-x509ca-overview.

az iot hub certificate verify --etag
--hub-name
--name
--path
[--resource-group]

Examples

Verifies ownership of the MyCertificate private key.

az iot hub certificate verify --hub-name MyIotHub --name MyCertificate --path /certificates/Verification.pem --etag AAAAAAAAAAA=

Required Parameters

--etag -e

Entity Tag (etag) of the object.

--hub-name

IoT Hub name.

--name -n

A friendly name for the certificate.

--path -p

The path to the file containing the certificate.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.