Partager via


Software Update Configurations - Create

Create a new software update configuration with the name given in the URI.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}?api-version=2019-06-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\._]+$

softwareUpdateConfigurationName
path True

string

The name of the software update configuration to be created.

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.

api-version
query True

string

Client Api Version.

Request Header

Name Required Type Description
clientRequestId

string

Identifies this specific client request.

Request Body

Name Required Type Description
properties.scheduleInfo True

SUCScheduleProperties

Schedule information for the Software update configuration

properties.updateConfiguration True

updateConfiguration

update specific properties for the Software update configuration

properties.error

ErrorResponse

Details of provisioning error

properties.tasks

softwareUpdateConfigurationTasks

Tasks information for the Software update configuration.

Responses

Name Type Description
200 OK

softwareUpdateConfiguration

Software update configuration with the same name and properties already exists.

201 Created

softwareUpdateConfiguration

Software update configuration is created.

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

Create software update configuration

Sample request

PUT https://management.azure.com/subscriptions/51766542-3ed7-4a72-a187-0c8ab644ddab/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/myaccount/softwareUpdateConfigurations/testpatch?api-version=2019-06-01

{
  "properties": {
    "updateConfiguration": {
      "operatingSystem": "Windows",
      "duration": "PT2H0M",
      "windows": {
        "excludedKbNumbers": [
          "168934",
          "168973"
        ],
        "includedUpdateClassifications": "Critical",
        "rebootSetting": "IfRequired"
      },
      "azureVirtualMachines": [
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01",
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02",
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03"
      ],
      "nonAzureComputerNames": [
        "box1.contoso.com",
        "box2.contoso.com"
      ],
      "targets": {
        "azureQueries": [
          {
            "scope": [
              "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources",
              "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067"
            ],
            "tagSettings": {
              "tags": {
                "tag1": [
                  "tag1Value1",
                  "tag1Value2",
                  "tag1Value3"
                ],
                "tag2": [
                  "tag2Value1",
                  "tag2Value2",
                  "tag2Value3"
                ]
              },
              "filterOperator": "All"
            },
            "locations": [
              "Japan East",
              "UK South"
            ]
          }
        ],
        "nonAzureQueries": [
          {
            "functionAlias": "SavedSearch1",
            "workspaceId": "WorkspaceId1"
          },
          {
            "functionAlias": "SavedSearch2",
            "workspaceId": "WorkspaceId2"
          }
        ]
      }
    },
    "scheduleInfo": {
      "frequency": "Hour",
      "startTime": "2017-10-19T12:22:57+00:00",
      "timeZone": "America/Los_Angeles",
      "interval": 1,
      "expiryTime": "2018-11-09T11:22:57+00:00",
      "advancedSchedule": {
        "weekDays": [
          "Monday",
          "Thursday"
        ]
      }
    },
    "tasks": {
      "preTask": {
        "source": "HelloWorld",
        "parameters": {
          "COMPUTERNAME": "Computer1"
        }
      },
      "postTask": {
        "source": "GetCache",
        "parameters": null
      }
    }
  }
}

Sample response

{
  "name": "testpatch",
  "id": "/subscriptions/51766542-3ed7-4a72-a187-0c8ab644ddab/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/myaccount/softwareUpdateConfigurations/testpatch",
  "properties": {
    "updateConfiguration": {
      "operatingSystem": "Windows",
      "windows": {
        "includedUpdateClassifications": "Critical",
        "excludedKbNumbers": [
          "168934",
          "168973"
        ]
      },
      "linux": {},
      "targets": {
        "azureQueries": [
          {
            "scope": [
              "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/a-stasku-rg0",
              "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d"
            ],
            "tagSettings": {
              "tags": {
                "tag1": [
                  "tag1Value1",
                  "tag1Value2"
                ],
                "tag2": [
                  "tag2Value1",
                  "tag2Value2"
                ]
              },
              "filterOperator": "All"
            },
            "locations": [
              "Japan East",
              "UK South"
            ]
          }
        ]
      },
      "duration": "PT2H",
      "azureVirtualMachines": [
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01",
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02",
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03"
      ],
      "nonAzureComputerNames": [
        "box1.contoso.com",
        "box2.contoso.com"
      ]
    },
    "scheduleInfo": {
      "description": "",
      "startTime": "2017-10-19T12:22:00-07:00",
      "startTimeOffsetMinutes": -420,
      "expiryTime": "2018-11-09T11:22:00-08:00",
      "expiryTimeOffsetMinutes": -480,
      "isEnabled": true,
      "nextRun": "2017-10-19T12:22:00-07:00",
      "nextRunOffsetMinutes": -420,
      "interval": 1,
      "frequency": "Week",
      "creationTime": "2017-10-19T18:54:50.5233333+00:00",
      "lastModifiedTime": "2017-10-19T18:54:50.5233333+00:00",
      "timeZone": "America/Los_Angeles",
      "advancedSchedule": {}
    },
    "tasks": {
      "preTask": {
        "source": "HelloWorld",
        "parameters": {
          "COMPUTERNAME": "Computer1"
        }
      },
      "postTask": {
        "source": "GetCache",
        "parameters": null
      }
    },
    "provisioningState": "Provisioning",
    "error": {},
    "creationTime": "2017-10-19T18:54:50.5233333+00:00",
    "createdBy": "adam@contoso.com",
    "lastModifiedBy": "adam@contoso.com",
    "lastModifiedTime": "2017-10-19T18:54:50.68+00:00"
  }
}
{
  "name": "testpatch",
  "id": "/subscriptions/51766542-3ed7-4a72-a187-0c8ab644ddab/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/myaccount/softwareUpdateConfigurations/testpatch",
  "properties": {
    "updateConfiguration": {
      "operatingSystem": "Windows",
      "windows": {
        "includedUpdateClassifications": "Critical",
        "excludedKbNumbers": [
          "168934",
          "168973"
        ]
      },
      "linux": {},
      "targets": {
        "azureQueries": [
          {
            "scope": [
              "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/a-stasku-rg0",
              "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d"
            ],
            "tagSettings": {
              "tags": {
                "tag1": [
                  "tag1Value1",
                  "tag1Value2"
                ],
                "tag2": [
                  "tag2Value1",
                  "tag2Value2"
                ]
              },
              "filterOperator": "All"
            },
            "locations": [
              "Japan East",
              "UK South"
            ]
          }
        ]
      },
      "duration": "PT2H",
      "azureVirtualMachines": [
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01",
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02",
        "/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03"
      ],
      "nonAzureComputerNames": [
        "box1.contoso.com",
        "box2.contoso.com"
      ]
    },
    "scheduleInfo": {
      "description": "",
      "startTime": "2017-10-19T12:22:00-07:00",
      "startTimeOffsetMinutes": -420,
      "expiryTime": "2018-11-09T11:22:00-08:00",
      "expiryTimeOffsetMinutes": -480,
      "isEnabled": true,
      "nextRun": "2017-10-19T12:22:00-07:00",
      "nextRunOffsetMinutes": -420,
      "interval": 1,
      "frequency": "Week",
      "creationTime": "2017-10-19T18:54:50.5233333+00:00",
      "lastModifiedTime": "2017-10-19T18:54:50.5233333+00:00",
      "timeZone": "America/Los_Angeles"
    },
    "tasks": {
      "preTask": {
        "source": "HelloWorld",
        "parameters": {
          "COMPUTERNAME": "Computer1"
        }
      },
      "postTask": {
        "source": "GetCache",
        "parameters": null
      }
    },
    "provisioningState": "Provisioning",
    "error": {},
    "creationTime": "2017-10-19T18:54:50.5233333+00:00",
    "lastModifiedBy": "",
    "lastModifiedTime": "2017-10-19T18:54:50.68+00:00"
  }
}

Definitions

Name Description
AdvancedSchedule

The properties of the create Advanced Schedule.

AdvancedScheduleMonthlyOccurrence

The properties of the create advanced schedule monthly occurrence.

AzureQueryProperties

Azure query for the update configuration.

ErrorResponse

Error response of an operation failure

LinuxProperties

Linux specific update configuration.

LinuxUpdateClasses

Update classifications included in the software update configuration.

NonAzureQueryProperties

Non Azure query for the update configuration.

OperatingSystemType

operating system of target machines

ScheduleDay

Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday.

ScheduleFrequency

Gets or sets the frequency of the schedule.

softwareUpdateConfiguration

Software update configuration properties.

softwareUpdateConfigurationTasks

Task properties of the software update configuration.

SUCScheduleProperties

Definition of schedule parameters.

TagOperators

Filter VMs by Any or All specified tags.

TagSettingsProperties

Tag filter information for the VM.

TargetProperties

Group specific to the update configuration.

taskProperties

Task properties of the software update configuration.

updateConfiguration

Update specific properties of the software update configuration.

WindowsProperties

Windows specific update configuration.

WindowsUpdateClasses

Update classification included in the software update configuration. A comma separated string with required values

AdvancedSchedule

The properties of the create Advanced Schedule.

Name Type Description
monthDays

integer[]

Days of the month that the job should execute on. Must be between 1 and 31.

monthlyOccurrences

AdvancedScheduleMonthlyOccurrence[]

Occurrences of days within a month.

weekDays

string[]

Days of the week that the job should execute on.

AdvancedScheduleMonthlyOccurrence

The properties of the create advanced schedule monthly occurrence.

Name Type Description
day

ScheduleDay

Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday.

occurrence

integer

Occurrence of the week within the month. Must be between 1 and 5

AzureQueryProperties

Azure query for the update configuration.

Name Type Description
locations

string[]

List of locations to scope the query to.

scope

string[]

List of Subscription or Resource Group ARM Ids.

tagSettings

TagSettingsProperties

Tag settings for the VM.

ErrorResponse

Error response of an operation failure

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

LinuxProperties

Linux specific update configuration.

Name Type Description
excludedPackageNameMasks

string[]

packages excluded from the software update configuration.

includedPackageClassifications

LinuxUpdateClasses

Update classifications included in the software update configuration.

includedPackageNameMasks

string[]

packages included from the software update configuration.

rebootSetting

string

Reboot setting for the software update configuration.

LinuxUpdateClasses

Update classifications included in the software update configuration.

Name Type Description
Critical

string

Other

string

Security

string

Unclassified

string

NonAzureQueryProperties

Non Azure query for the update configuration.

Name Type Description
functionAlias

string

Log Analytics Saved Search name.

workspaceId

string

Workspace Id for Log Analytics in which the saved Search is resided.

OperatingSystemType

operating system of target machines

Name Type Description
Linux

string

Windows

string

ScheduleDay

Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday.

Name Type Description
Friday

string

Monday

string

Saturday

string

Sunday

string

Thursday

string

Tuesday

string

Wednesday

string

ScheduleFrequency

Gets or sets the frequency of the schedule.

Name Type Description
Day

string

Hour

string

Minute

string

The minimum allowed interval for Minute schedules is 15 minutes.

Month

string

OneTime

string

Week

string

softwareUpdateConfiguration

Software update configuration properties.

Name Type Description
id

string

Resource Id.

name

string

Resource name.

properties.createdBy

string

CreatedBy property, which only appears in the response.

properties.creationTime

string

Creation time of the resource, which only appears in the response.

properties.error

ErrorResponse

Details of provisioning error

properties.lastModifiedBy

string

LastModifiedBy property, which only appears in the response.

properties.lastModifiedTime

string

Last time resource was modified, which only appears in the response.

properties.provisioningState

string

Provisioning state for the software update configuration, which only appears in the response.

properties.scheduleInfo

SUCScheduleProperties

Schedule information for the Software update configuration

properties.tasks

softwareUpdateConfigurationTasks

Tasks information for the Software update configuration.

properties.updateConfiguration

updateConfiguration

update specific properties for the Software update configuration

type

string

Resource type

softwareUpdateConfigurationTasks

Task properties of the software update configuration.

Name Type Description
postTask

taskProperties

Post task properties.

preTask

taskProperties

Pre task properties.

SUCScheduleProperties

Definition of schedule parameters.

Name Type Default value Description
advancedSchedule

AdvancedSchedule

Gets or sets the advanced schedule.

creationTime

string

Gets or sets the creation time.

description

string

Gets or sets the description.

expiryTime

string

Gets or sets the end time of the schedule.

expiryTimeOffsetMinutes

number

Gets or sets the expiry time's offset in minutes.

frequency

ScheduleFrequency

Gets or sets the frequency of the schedule.

interval

integer

Gets or sets the interval of the schedule.

isEnabled

boolean

False

Gets or sets a value indicating whether this schedule is enabled.

lastModifiedTime

string

Gets or sets the last modified time.

nextRun

string

Gets or sets the next run time of the schedule.

nextRunOffsetMinutes

number

Gets or sets the next run time's offset in minutes.

startTime

string

Gets or sets the start time of the schedule.

startTimeOffsetMinutes

number

Gets the start time's offset in minutes.

timeZone

string

Gets or sets the time zone of the schedule.

TagOperators

Filter VMs by Any or All specified tags.

Name Type Description
All

string

Any

string

TagSettingsProperties

Tag filter information for the VM.

Name Type Description
filterOperator

TagOperators

Filter VMs by Any or All specified tags.

tags

object

Dictionary of tags with its list of values.

TargetProperties

Group specific to the update configuration.

Name Type Description
azureQueries

AzureQueryProperties[]

List of Azure queries in the software update configuration.

nonAzureQueries

NonAzureQueryProperties[]

List of non Azure queries in the software update configuration.

taskProperties

Task properties of the software update configuration.

Name Type Description
parameters

object

Gets or sets the parameters of the task.

source

string

Gets or sets the name of the runbook.

updateConfiguration

Update specific properties of the software update configuration.

Name Type Description
azureVirtualMachines

string[]

List of azure resource Ids for azure virtual machines targeted by the software update configuration.

duration

string

Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601

linux

LinuxProperties

Linux specific update configuration.

nonAzureComputerNames

string[]

List of names of non-azure machines targeted by the software update configuration.

operatingSystem

OperatingSystemType

operating system of target machines

targets

TargetProperties

Group targets for the software update configuration.

windows

WindowsProperties

Windows specific update configuration.

WindowsProperties

Windows specific update configuration.

Name Type Description
excludedKbNumbers

string[]

KB numbers excluded from the software update configuration.

includedKbNumbers

string[]

KB numbers included from the software update configuration.

includedUpdateClassifications

WindowsUpdateClasses

Update classification included in the software update configuration. A comma separated string with required values

rebootSetting

string

Reboot setting for the software update configuration.

WindowsUpdateClasses

Update classification included in the software update configuration. A comma separated string with required values

Name Type Description
Critical

string

Definition

string

FeaturePack

string

Security

string

ServicePack

string

Tools

string

Unclassified

string

UpdateRollup

string

Updates

string