Skip to main content

secrets

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

Overview

Namesecrets
TypeResource
Idazure.dev_test_labs.secrets

Fields

NameDatatypeDescription
idtextThe identifier of the resource.
nametextThe name of the resource.
labNametextfield from the properties object
locationtextThe location of the resource.
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextThe tags of the resource.
typetextThe type of the resource.
unique_identifiertextfield from the properties object
userNametextfield from the properties object
valuetextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTlabName, name, resourceGroupName, subscriptionId, userNameGet secret.
listSELECTlabName, resourceGroupName, subscriptionId, userNameList secrets in a given user profile.
create_or_updateINSERTlabName, name, resourceGroupName, subscriptionId, userName, data__propertiesCreate or replace an existing secret. This operation can take a while to complete.
deleteDELETElabName, name, resourceGroupName, subscriptionId, userNameDelete secret.
updateUPDATElabName, name, resourceGroupName, subscriptionId, userNameAllows modifying tags of secrets. All other properties will be ignored.

SELECT examples

List secrets in a given user profile.

SELECT
id,
name,
labName,
location,
provisioning_state,
resourceGroupName,
subscriptionId,
tags,
type,
unique_identifier,
userName,
value
FROM azure.dev_test_labs.vw_secrets
WHERE labName = '{{ labName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND userName = '{{ userName }}';

INSERT example

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

/*+ create */
INSERT INTO azure.dev_test_labs.secrets (
labName,
name,
resourceGroupName,
subscriptionId,
userName,
data__properties,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ userName }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a secrets resource.

/*+ update */
UPDATE azure.dev_test_labs.secrets
SET
tags = '{{ tags }}'
WHERE
labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND userName = '{{ userName }}';

DELETE example

Deletes the specified secrets resource.

/*+ delete */
DELETE FROM azure.dev_test_labs.secrets
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND userName = '{{ userName }}';