certificates
Creates, updates, deletes, gets or lists a certificates
resource.
Overview
Name | certificates |
Type | Resource |
Id | azure.iot_hub.certificates |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_iot_hub
The body contains the certificate.
Name | Datatype | Description |
---|---|---|
id | string | The resource identifier. |
name | string | The name of the certificate. |
etag | string | The entity tag. |
properties | object | The description of an X509 CA Certificate. |
type | string | The resource type. |
The body contains all the certificate list.
Name | Datatype | Description |
---|---|---|
id | string | The resource identifier. |
name | string | The name of the certificate. |
etag | string | The entity tag. |
properties | object | The description of an X509 CA Certificate. |
type | string | The resource type. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | subscriptionId , resourceGroupName , resourceName , certificateName | api-version | Returns the certificate. |
list_by_iot_hub | select | subscriptionId , resourceGroupName , resourceName | api-version | Returns the list of certificates. |
create_or_update | insert | subscriptionId , resourceGroupName , resourceName , certificateName | api-version , If-Match | Adds new or replaces existing certificate. |
delete | delete | subscriptionId , resourceGroupName , resourceName , certificateName , If-Match | api-version | Deletes an existing X509 certificate or does nothing if it does not exist. |
generate_verification_code | exec | subscriptionId , resourceGroupName , resourceName , certificateName , If-Match | api-version | Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate. |
verify | exec | subscriptionId , resourceGroupName , resourceName , certificateName , If-Match | api-version | Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
If-Match | string | ETag of the Certificate. |
certificateName | string | The name of the certificate |
resourceGroupName | string | The name of the resource group that contains the IoT hub. |
resourceName | string | The name of the IoT hub. |
subscriptionId | string | The subscription identifier. |
If-Match | string | ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. |
api-version | string | The version of the API. |
SELECT
examples
- get
- list_by_iot_hub
Returns the certificate.
SELECT
id,
name,
etag,
properties,
type
FROM azure.iot_hub.certificates
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND resourceName = '{{ resourceName }}' -- required
AND certificateName = '{{ certificateName }}' -- required
AND api-version = '{{ api-version }}'
;
Returns the list of certificates.
SELECT
id,
name,
etag,
properties,
type
FROM azure.iot_hub.certificates
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND resourceName = '{{ resourceName }}' -- required
AND api-version = '{{ api-version }}'
;
INSERT
examples
- create_or_update
- Manifest
Adds new or replaces existing certificate.
INSERT INTO azure.iot_hub.certificates (
data__properties,
subscriptionId,
resourceGroupName,
resourceName,
certificateName,
api-version,
If-Match
)
SELECT
'{{ properties }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ resourceName }}',
'{{ certificateName }}',
'{{ api-version }}',
'{{ If-Match }}'
RETURNING
id,
name,
etag,
properties,
type
;
# Description fields are for documentation purposes
- name: certificates
props:
- name: subscriptionId
value: string
description: Required parameter for the certificates resource.
- name: resourceGroupName
value: string
description: Required parameter for the certificates resource.
- name: resourceName
value: string
description: Required parameter for the certificates resource.
- name: certificateName
value: string
description: Required parameter for the certificates resource.
- name: properties
value: object
description: |
The description of an X509 CA Certificate.
- name: api-version
value: string
description: The version of the API.
- name: If-Match
value: string
description: ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate.
DELETE
examples
- delete
Deletes an existing X509 certificate or does nothing if it does not exist.
DELETE FROM azure.iot_hub.certificates
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND resourceName = '{{ resourceName }}' --required
AND certificateName = '{{ certificateName }}' --required
AND If-Match = '{{ If-Match }}' --required
AND api-version = '{{ api-version }}'
;
Lifecycle Methods
- generate_verification_code
- verify
Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate.
EXEC azure.iot_hub.certificates.generate_verification_code
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@resourceName='{{ resourceName }}' --required,
@certificateName='{{ certificateName }}' --required,
@If-Match='{{ If-Match }}' --required,
@api-version='{{ api-version }}'
;
Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate.
EXEC azure.iot_hub.certificates.verify
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@resourceName='{{ resourceName }}' --required,
@certificateName='{{ certificateName }}' --required,
@If-Match='{{ If-Match }}' --required,
@api-version='{{ api-version }}'
@@json=
'{
"certificate": "{{ certificate }}"
}'
;