ssh_public_keys
Creates, updates, deletes, gets or lists a ssh_public_keys resource.
Overview
| Name | ssh_public_keys |
| Type | Resource |
| Id | azure.compute.ssh_public_keys |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
location | string | The geo-location where the resource lives. Required. |
publicKey | string | SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
location | string | The geo-location where the resource lives. Required. |
publicKey | string | SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
location | string | The geo-location where the resource lives. Required. |
publicKey | string | SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, ssh_public_key_name, subscription_id | Retrieves information about an SSH public key. | |
list_by_resource_group | select | resource_group_name, subscription_id | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. | |
list_by_subscription | select | subscription_id | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. | |
create | insert | resource_group_name, ssh_public_key_name, subscription_id, location | Creates a new SSH public key resource. | |
update | update | resource_group_name, ssh_public_key_name, subscription_id | Updates a new SSH public key resource. | |
delete | delete | resource_group_name, ssh_public_key_name, subscription_id | Delete an SSH public key. | |
generate_key_pair | exec | resource_group_name, ssh_public_key_name, subscription_id | Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. |
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 |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
ssh_public_key_name | string | The name of the SSH public key. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_resource_group
- list_by_subscription
Retrieves information about an SSH public key.
SELECT
id,
name,
location,
publicKey,
systemData,
tags,
type
FROM azure.compute.ssh_public_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND ssh_public_key_name = '{{ ssh_public_key_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys.
SELECT
id,
name,
location,
publicKey,
systemData,
tags,
type
FROM azure.compute.ssh_public_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys.
SELECT
id,
name,
location,
publicKey,
systemData,
tags,
type
FROM azure.compute.ssh_public_keys
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create
- Manifest
Creates a new SSH public key resource.
INSERT INTO azure.compute.ssh_public_keys (
tags,
location,
properties,
resource_group_name,
ssh_public_key_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ ssh_public_key_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: ssh_public_keys
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the ssh_public_keys resource.
- name: ssh_public_key_name
value: "{{ ssh_public_key_name }}"
description: Required parameter for the ssh_public_keys resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the ssh_public_keys resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Properties of the SSH public key.
value:
publicKey: "{{ publicKey }}"
UPDATE examples
- update
Updates a new SSH public key resource.
UPDATE azure.compute.ssh_public_keys
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND ssh_public_key_name = '{{ ssh_public_key_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Delete an SSH public key.
DELETE FROM azure.compute.ssh_public_keys
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND ssh_public_key_name = '{{ ssh_public_key_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- generate_key_pair
Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource.
EXEC azure.compute.ssh_public_keys.generate_key_pair
@resource_group_name='{{ resource_group_name }}' --required,
@ssh_public_key_name='{{ ssh_public_key_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"encryptionType": "{{ encryptionType }}"
}'
;