Update a variable
The Update a variable operation updates the properties of a specified variable.
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 <variable-name> with the name of the variable to update. Include required URI parameters.
Method | Request URI |
|---|---|
PATCH | https://management.core.windows.net/<subscriptionId>/cloudServices/<cloud-service-name>/resources/automation/~/automationAccounts/<automation-account-name>/variables/<variable-name>?api-version={api-version} |
URI Parameters
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
In this example, just the value is updated for a variable named Current Count.
{
"properties":{
"value": 42
}
}
Element | Required | Type | Description |
|---|---|---|---|
description | No | String | A description of the variable. |
isEncrypted | No | Boolean | Indicator for whether this variable should be stored in an encrypted form. The default is "false". |
value | Yes | String | The new value for the variable. |
Status Code
A successful operation returns 200 (OK). 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":"Current Count",
"properties":{
"creationTime":"2015-05-21T19:04:24.29+00:00",
"lastModifiedTime":"2015-05-21T19:09:19.747+00:00",
"isEncrypted":false,
"value":"42",
"description":"Variable that keeps a current tally"
}
}
Element | Description |
|---|---|
name | A name for the variable. |
creationTime | Date and time the variable was created. |
lastModificationTime | The date and time the variable was last changed. |
isEncrypted | Indicates whether the value is stored in an encrypted form. The default is "false". |
description | A description of the variable. |
value | The value the variable contains. Is not returned for encrypted variables. |