Skip to main content

server_keys

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

Overview

Nameserver_keys
TypeResource
Idazure.sql.server_keys

Fields

NameDatatypeDescription
auto_rotation_enabledtextfield from the properties object
creation_datetextfield from the properties object
keyNametextfield from the properties object
kindtextKind of encryption protector. This is metadata used for the Azure portal experience.
locationtextResource location.
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
server_key_typetextfield from the properties object
subregiontextfield from the properties object
subscriptionIdtextfield from the properties object
thumbprinttextfield from the properties object
uritextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTkeyName, resourceGroupName, serverName, subscriptionIdGets a server key.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdGets a list of server keys.
create_or_updateINSERTkeyName, resourceGroupName, serverName, subscriptionIdCreates or updates a server key.
deleteDELETEkeyName, resourceGroupName, serverName, subscriptionIdDeletes the server key with the given name.

SELECT examples

Gets a list of server keys.

SELECT
auto_rotation_enabled,
creation_date,
keyName,
kind,
location,
resourceGroupName,
serverName,
server_key_type,
subregion,
subscriptionId,
thumbprint,
uri
FROM azure.sql.vw_server_keys
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.sql.server_keys (
keyName,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ keyName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

DELETE example

Deletes the specified server_keys resource.

/*+ delete */
DELETE FROM azure.sql.server_keys
WHERE keyName = '{{ keyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';