Module - Create Or Update

Create or Update the module identified by module name.

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

URI Parameters

Name In Required Type Description
automationAccountName
path True

string

The name of the automation account.

moduleName
path True

string

The name of module.

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[-\w\._]+$

Name of an Azure Resource group.

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 Body

Name Required Type Description
properties.contentLink True

ContentLink

Sets the hash.

location

string

Sets the location of the resource.

name

string

Sets name of the resource.

tags

object

Sets the tags attached to the resource.

Responses

Name Type Description
200 OK

Module

OK

201 Created

Module

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 or update a module

Sample request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/modules/OmsCompositeResources?api-version=2023-11-01

{
  "properties": {
    "contentLink": {
      "uri": "https://teststorage.blob.core.windows.net/dsccomposite/OmsCompositeResources.zip",
      "contentHash": {
        "algorithm": "sha265",
        "value": "07E108A962B81DD9C9BAA89BB47C0F6EE52B29E83758B07795E408D258B2B87A"
      },
      "version": "1.0.0.0"
    }
  }
}

Sample response

{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/modules/OmsCompositeResources",
  "name": "OmsCompositeResources",
  "type": "Microsoft.Automation/AutomationAccounts/Modules",
  "location": "East US 2",
  "tags": {},
  "etag": null,
  "properties": {
    "isGlobal": false,
    "version": null,
    "sizeInBytes": 0,
    "activityCount": 0,
    "creationTime": "2017-03-29T15:41:47.003+00:00",
    "lastModifiedTime": "2017-03-29T15:42:10.567+00:00",
    "error": {
      "code": null,
      "message": null
    },
    "provisioningState": "Creating",
    "isComposite": false
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/modules/OmsCompositeResources",
  "name": "OmsCompositeResources",
  "type": "Microsoft.Automation/AutomationAccounts/Modules",
  "location": "East US 2",
  "tags": {},
  "etag": null,
  "properties": {
    "isGlobal": false,
    "version": null,
    "sizeInBytes": 0,
    "activityCount": 0,
    "creationTime": "2017-03-29T15:41:47.003+00:00",
    "lastModifiedTime": "2017-03-29T15:42:10.567+00:00",
    "error": {
      "code": null,
      "message": null
    },
    "provisioningState": "Creating",
    "isComposite": false
  }
}

Definitions

Name Description
ContentHash

Definition of the runbook property type.

ContentLink

Definition of the content link.

ErrorResponse

Error response of an operation failure

Module

Definition of the module type.

ModuleCreateOrUpdateParameters

The parameters supplied to the create or update module operation.

ModuleErrorInfo

Definition of the module error info type.

ModuleProvisioningState

Gets the provisioning state of the module.

ContentHash

Definition of the runbook property type.

Name Type Description
algorithm

string

Gets or sets the content hash algorithm used to hash the content.

value

string

Gets or sets expected hash value of the content.

Definition of the content link.

Name Type Description
contentHash

ContentHash

Sets the hash.

uri

string

Sets the uri of the content.

version

string

Sets the version of the content.

ErrorResponse

Error response of an operation failure

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

Module

Definition of the module type.

Name Type Description
etag

string

Gets the etag of the resource.

id

string

Fully qualified resource Id for the resource

location

string

The Azure Region where the resource lives

name

string

The name of the resource

properties.activityCount

integer (int32)

Gets the activity count of the module.

properties.contentLink

ContentLink

Gets or sets the contentLink of the module.

properties.creationTime

string (date-time)

Gets the creation time.

properties.description

string

Gets or sets the description.

properties.error

ModuleErrorInfo

Gets the error info of the module.

properties.isComposite

boolean

Gets type of module, if its composite or not.

properties.isGlobal

boolean

Gets the isGlobal flag of the module.

properties.lastModifiedTime

string (date-time)

Gets the last modified time.

properties.provisioningState

ModuleProvisioningState

Gets the provisioning state of the module.

properties.sizeInBytes

integer (int64)

Gets the size in bytes of the module.

properties.version

string

Gets the version of the module.

tags

object

Resource tags.

type

string

The type of the resource.

ModuleCreateOrUpdateParameters

The parameters supplied to the create or update module operation.

Name Type Description
location

string

Sets the location of the resource.

name

string

Sets name of the resource.

properties.contentLink

ContentLink

Sets the hash.

tags

object

Sets the tags attached to the resource.

ModuleErrorInfo

Definition of the module error info type.

Name Type Description
code

string

Gets the error code.

message

string

Gets the error message.

ModuleProvisioningState

Gets the provisioning state of the module.

Value Description
ActivitiesStored
Canceled
ConnectionTypeImported
ContentDownloaded
ContentRetrieved
ContentStored
ContentValidated
Created
Creating
Failed
ModuleDataStored
ModuleImportRunbookComplete
RunningImportModuleRunbook
StartingImportModuleRunbook
Succeeded
Updating