Skip to main content

ssh_public_keys

Creates, updates, deletes, gets or lists a ssh_public_keys resource.

Overview

Namessh_public_keys
TypeResource
Idazure.compute.ssh_public_keys

Fields

NameDatatypeDescription
idtextResource Id
nametextResource name
locationtextResource location
public_keytextfield from the properties object
resourceGroupNametextfield from the properties object
sshPublicKeyNametextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags
typetextResource type

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, sshPublicKeyName, subscriptionIdRetrieves information about an SSH public key.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdLists 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_subscriptionSELECTsubscriptionIdLists 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.
createINSERTresourceGroupName, sshPublicKeyName, subscriptionIdCreates a new SSH public key resource.
deleteDELETEresourceGroupName, sshPublicKeyName, subscriptionIdDelete an SSH public key.
updateUPDATEresourceGroupName, sshPublicKeyName, subscriptionIdUpdates a new SSH public key resource.
generate_key_pairEXECresourceGroupName, sshPublicKeyName, subscriptionIdGenerates 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.

SELECT examples

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,
public_key,
resourceGroupName,
sshPublicKeyName,
subscriptionId,
tags,
type
FROM azure.compute.vw_ssh_public_keys
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new ssh_public_keys resource.

/*+ create */
INSERT INTO azure.compute.ssh_public_keys (
resourceGroupName,
sshPublicKeyName,
subscriptionId,
properties,
location,
tags
)
SELECT
'{{ resourceGroupName }}',
'{{ sshPublicKeyName }}',
'{{ subscriptionId }}',
'{{ properties }}',
'{{ location }}',
'{{ tags }}'
;

UPDATE example

Updates a ssh_public_keys resource.

/*+ update */
UPDATE azure.compute.ssh_public_keys
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND sshPublicKeyName = '{{ sshPublicKeyName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified ssh_public_keys resource.

/*+ delete */
DELETE FROM azure.compute.ssh_public_keys
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sshPublicKeyName = '{{ sshPublicKeyName }}'
AND subscriptionId = '{{ subscriptionId }}';