How to add an api key to the Credentials of Azure Automation Account?

270 views Asked by At

I want to add an api key for my sendgrid account to Azure Automation account. I did the search but no luck. enter image description here

How should I do this? Thank you in advance!

1

There are 1 answers

0
Joey Cai On BEST ANSWER

You could add your api key in password and set a related username(it does not verify the connection between username and password) like below:

enter image description here

Usually we use get a credential with Get-AutomationPSCredential and get its username and password

$myCred = Get-AutomationPSCredential -Name 'MyCredential'
$userName = $myCred.UserName
$securePassword = $myCred.Password
$password = $myCred.GetNetworkCredential().Password

For now, you need only to get the password which is sendgrid api key.