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=2015-10-31

URI Parameters

Name In Required Type Description
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.

resourceGroupName
path True
  • string

Name of an Azure Resource group.

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

automationAccountName
path True
  • string

The name of the automation account.

moduleName
path True
  • string

The name of module.

api-version
query True
  • string

Client Api Version.

Request Body

Name Required Type Description
location
  • string

Gets or sets the location of the resource.

name
  • string

Gets or sets name of the resource.

properties.contentLink True

Gets or sets the module content link.

tags
  • object

Gets or sets the tags attached to the resource.

Responses

Name Type Description
200 OK

OK

201 Created

Created

Other Status Codes

Automation error response describing why the operation failed.

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=2015-10-31
{
  "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

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 or sets 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

Gets or sets the hash.

uri
  • string

Gets or sets the uri of the runbook content.

version
  • string

Gets or 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 or sets 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

Gets or sets the activity count of the module.

properties.contentLink

Gets or sets the contentLink of the module.

properties.creationTime
  • string

Gets or sets the creation time.

properties.description
  • string

Gets or sets the description.

properties.error

Gets or sets the error info of the module.

properties.isComposite
  • boolean

Gets or sets type of module, if its composite or not.

properties.isGlobal
  • boolean

Gets or sets the isGlobal flag of the module.

properties.lastModifiedTime
  • string

Gets or sets the last modified time.

properties.provisioningState

Gets or sets the provisioning state of the module.

properties.sizeInBytes
  • integer

Gets or sets the size in bytes of the module.

properties.version
  • string

Gets or sets 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

Gets or sets the location of the resource.

name
  • string

Gets or sets name of the resource.

properties.contentLink

Gets or sets the module content link.

tags
  • object

Gets or sets the tags attached to the resource.

ModuleErrorInfo

Definition of the module error info type.

Name Type Description
code
  • string

Gets or sets the error code.

message
  • string

Gets or sets the error message.

ModuleProvisioningState

Gets or sets the provisioning state of the module.

Name Type Description
ActivitiesStored
  • string
Cancelled
  • string
ConnectionTypeImported
  • string
ContentDownloaded
  • string
ContentRetrieved
  • string
ContentStored
  • string
ContentValidated
  • string
Created
  • string
Creating
  • string
Failed
  • string
ModuleDataStored
  • string
ModuleImportRunbookComplete
  • string
RunningImportModuleRunbook
  • string
StartingImportModuleRunbook
  • string
Succeeded
  • string
Updating
  • string