An Azure Automation Account Credential is a shared asset that holds security credentials like username and password. It is a shared resource in an Azure Automation Account and are used in Runbooks and DSC configurations as PSCredential object for authentication.
$credentials = Get-AutomationPSCredential -Name 'AzureAutomationCreds'
- Azure Subscription (sign up for a free Azure subscription or move an Azure subscription from another tenant)
- Azure Resource Group
- Azure Automation Account
- Log into your Azure Automation Account and click on “Credentials“
- Select “Add a Credential“
- Fill in the required details like Name, User Name, and Password > Create
- Note: The name length must be from 1 to 128 characters. The name cannot contain special characters < > * % & : \ ? + / and cannot end with a whitespace character.
Create and Azure Automation Credential using PowerShell:
Connect-AzAccount -Credential $credentials -Subscription 'Subscription Name' $User = "firstname.lastname@example.org" $Password = ConvertTo-SecureString "Pa$worD1" -AsPlainText -Force $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $Password New-AzAutomationCredential -Name "credential_name" -Value $Credential -ResourceGroupName "resource_group_name" -AutomationAccountName "automation_account_name"