Variable - Update

Update a variable.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}?api-version=2023-11-01

URI Parameters

Name In Required Type Description
automationAccountName
path True

string

The name of the automation account.

resourceGroupName
path True

string

Name of an Azure Resource group.

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

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.

variableName
path True

string

The variable name.

api-version
query True

string

Client Api Version.

Request Body

Name Type Description
name

string

Gets or sets the name of the variable.

properties.description

string

Gets or sets the description of the variable.

properties.value

string

Gets or sets the value of the variable.

Responses

Name Type Description
200 OK

Variable

OK

Other Status Codes

ErrorResponse

Automation error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Update a variable

Sample Request

PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/variables/sampleVariable?api-version=2023-11-01

{
  "name": "sampleVariable",
  "properties": {
    "value": "\"ComputerName3.domain.com\""
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/variables/sampleVariable",
  "name": "sampleVariable",
  "properties": {
    "creationTime": "2017-03-28T23:00:53.363+00:00",
    "lastModifiedTime": "2017-03-28T23:00:57.987+00:00",
    "isEncrypted": false,
    "value": "\"ComputerName3.domain.com\"",
    "description": "my description"
  }
}

Definitions

Name Description
ErrorResponse

Error response of an operation failure

Variable

Definition of the variable.

VariableUpdateParameters

The parameters supplied to the update variable operation.

ErrorResponse

Error response of an operation failure

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

Variable

Definition of the variable.

Name Type Description
id

string

Fully qualified resource Id for the resource

name

string

The name of the resource

properties.creationTime

string

Gets or sets the creation time.

properties.description

string

Gets or sets the description.

properties.isEncrypted

boolean

Gets or sets the encrypted flag of the variable.

properties.lastModifiedTime

string

Gets or sets the last modified time.

properties.value

string

Gets or sets the value of the variable.

type

string

The type of the resource.

VariableUpdateParameters

The parameters supplied to the update variable operation.

Name Type Description
name

string

Gets or sets the name of the variable.

properties.description

string

Gets or sets the description of the variable.

properties.value

string

Gets or sets the value of the variable.