Create a credential

 

Updated: May 26, 2016

The Create a credential task creates a credential asset.

Credential names must be unique qithin an automation account.

The related Windows PowerShell cmdlet for this task is New-AzureRmAutomationCredential.

To specify the request, replace {subscription-id} with your subscription ID, {resource-group-name} with the name of your resource group, {automation-account-name} with the name of the automation account, and {credential-name} with the name of the credential.

Method

Request URI

PUT

https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Automation/automationAccounts/{automation-account-name}/credentials/{credential-name}?api-version=2015-10-31

URI parameter

Description

api-version

Required. Valid values include 2015-10-31

The following code shows an example of the request body.

{
   "properties":{
        "userName": "jclayton@litware.com",
        "password": "@&&222dogflower$",
        "description": "Jane Clayton's credential"
}

Element name

Required

Type

Description

Description

No

String

Specifies a description for the credential.

Name

Yes

String

Specifies a name for the credential.

Value

Yes

PSCredential

Specifies the credentials as a PSCredential object.

The following code shows an example of the response body.

{
   "name":"Jane Clayton Credential",
   "properties":{
      "userName":"jclayton@litware.com",
      "description":"Jane Clayton's credential",
      "creationTime":"2015-03-30T04:01:45.88+00:00",
      "lastModifiedTime":"2015-03-30T04:01:45.88+00:00"
   }
}


201

For information about common error codes, see Service Management Status and Error Codes

Show: