Credential - Create Or Update

Create a credential.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}?api-version=2015-10-31

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

resourceGroupName
path True
  • string

Name of an Azure Resource group.

Regex pattern: ^[-\w\._]+$

automationAccountName
path True
  • string

The name of the automation account.

credentialName
path True
  • string

The parameters supplied to the create or update credential operation.

api-version
query True
  • string

Client Api Version.

Request Body

Name Required Type Description
name True
  • string

Gets or sets the name of the credential.

properties.description
  • string

Gets or sets the description of the credential.

properties.password True
  • string

Gets or sets the password of the credential.

properties.userName True
  • string

Gets or sets the user name of the credential.

Responses

Name Type Description
200 OK

OK

201 Created

Created

Other Status Codes

Automation error response describing why the operation failed.

Examples

Create a credential

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount18/credentials/myCredential?api-version=2015-10-31
{
  "name": "myCredential",
  "properties": {
    "userName": "mylingaiah",
    "password": "myPassw0rd",
    "description": "my description goes here"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount18/credentials/myCredential",
  "name": "myCredential",
  "properties": {
    "userName": "mylingaiah",
    "description": "my description goes here",
    "creationTime": "2017-03-26T21:04:10.27+00:00",
    "lastModifiedTime": "2017-03-26T21:04:10.27+00:00"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount18/credentials/myCredential",
  "name": "myCredential",
  "properties": {
    "userName": "mylingaiah",
    "description": "my description goes here",
    "creationTime": "2017-03-26T21:04:10.27+00:00",
    "lastModifiedTime": "2017-03-26T21:04:13.567+00:00"
  }
}

Definitions

Credential

Definition of the credential.

CredentialCreateOrUpdateParameters

The parameters supplied to the create or update credential operation.

ErrorResponse

Error response of an operation failure

Credential

Definition of the credential.

Name Type Description
id
  • string

Fully qualified resource Id for the resource

name
  • string

The name of the resource

properties.creationTime
  • string

Gets the creation time.

properties.description
  • string

Gets or sets the description.

properties.lastModifiedTime
  • string

Gets the last modified time.

properties.userName
  • string

Gets the user name of the credential.

type
  • string

The type of the resource.

CredentialCreateOrUpdateParameters

The parameters supplied to the create or update credential operation.

Name Type Description
name
  • string

Gets or sets the name of the credential.

properties.description
  • string

Gets or sets the description of the credential.

properties.password
  • string

Gets or sets the password of the credential.

properties.userName
  • string

Gets or sets the user name of the credential.

ErrorResponse

Error response of an operation failure

Name Type Description
code
  • string

Error code

message
  • string

Error message indicating why the operation failed.