Share via


Create a credential

 

The Create a credential operation creates a new credential from the supplied data. This operation can also update a certificate by the same name.

Request

To specify the request, replace <subscription-id> with your subscription ID, <cloud-service-name> with the name of the cloud service to use for making the request, <automation-account-name> with the name of the automation account to use for making the request, and <credential-name> with the name of the credential to create. Include required URI parameters.

Method

Request URI

PUT

https://management.core.windows.net/<subscription-id>/cloudServices/<cloud-service-name>/resources/automation/~/automationAccounts/<automation-account-name>/credentials/<credential-name>?api-version=2014-12-08

URI Parameters

Uri Parameter

Description

api-version

Required. Must be set to 2014-12-08.

Request Headers

The request headers in the following table are required.

Request Header

Description

Content-Type

Set to application/json. Do not include a specification for charset.

x-ms-version

Specifies the version of the operation. Set to 2013-06-01 or a later version.

Request Body

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

Element

Required

Type

Description

userName

Yes

String

The name of the user associated with the credential.

password

Yes

String

The password of the credential.

description

No

String

Description of the credential.

Response

Status Code

A successful operation returns 201 (Created). For information about common error codes, see HTTP/1.1 Status Code Definitions.

Response Headers

Request Header

Description

x-ms-request-id

A unique identifier for the current operation.

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"
   }
}

Element

Description

name

The name of the credential.

userName

The name of the user associated with the credential.

description

Description of the credential.

creationTime

The date and time the credential was created.

lastModifiedTime

The date and time the credential was last changed.

See Also

Automation Credentials
Operations on Automation