Skip to main content

credential

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

Overview

Namecredential
TypeResource
Idazure.automation.credential

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
creationTimestring (date-time)Gets the creation time.
descriptionstringGets or sets the description.
lastModifiedTimestring (date-time)Gets the last modified time.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
userNamestringGets the user name of the credential.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, automation_account_name, credential_name, subscription_idRetrieve the credential identified by credential name.
list_by_automation_accountselectresource_group_name, automation_account_name, subscription_idRetrieve a list of credentials.
create_or_updateinsertresource_group_name, automation_account_name, credential_name, subscription_id, name, propertiesCreate a credential.
updateupdateresource_group_name, automation_account_name, credential_name, subscription_idUpdate a credential.
create_or_updatereplaceresource_group_name, automation_account_name, credential_name, subscription_id, name, propertiesCreate a credential.
deletedeleteresource_group_name, automation_account_name, credential_name, subscription_idDelete the credential.

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.

NameDatatypeDescription
automation_account_namestringThe name of the automation account. Required.
credential_namestringThe name of credential. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Retrieve the credential identified by credential name.

SELECT
id,
name,
creationTime,
description,
lastModifiedTime,
systemData,
type,
userName
FROM azure.automation.credential
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND automation_account_name = '{{ automation_account_name }}' -- required
AND credential_name = '{{ credential_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a credential.

INSERT INTO azure.automation.credential (
name,
properties,
resource_group_name,
automation_account_name,
credential_name,
subscription_id
)
SELECT
'{{ name }}' /* required */,
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ automation_account_name }}',
'{{ credential_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

UPDATE examples

Update a credential.

UPDATE azure.automation.credential
SET
name = '{{ name }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND credential_name = '{{ credential_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

REPLACE examples

Create a credential.

REPLACE azure.automation.credential
SET
name = '{{ name }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND credential_name = '{{ credential_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND name = '{{ name }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete the credential.

DELETE FROM azure.automation.credential
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND credential_name = '{{ credential_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;