Dsc Configuration - Get Content

Retrieve the configuration script identified by configuration name.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content?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.

configurationName
path True
  • string

The configuration name.

api-version
query True
  • string

Client Api Version.

Responses

Name Type Description
200 OK
  • string

OK

Media Types: "application/json", "text/plain; charset=utf-8"

Other Status Codes

Automation error response describing why the operation failed.

Media Types: "application/json", "text/plain; charset=utf-8"

Examples

Get DSC Configuration content

Sample Request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/configurations/TemplateBasic/content?api-version=2015-10-31

Sample Response

"\tconfiguration TemplateWithConfigData{\r\n    <#\r\n .description\r\n="" dsc="" coniguration="" that="" uses="" configdata="" file\r\n\r\n="" .example\r\n="" templatewithconfigdata="" -outpath="" c:\\dsc\\\r\n\r\n="" .notes\r\n="" this="" configuration="" requires="" the="" corresponding="" configdata="" file\r\n="" #="">\r\n\r\n    Import-DscResource -ModuleName 'PSDesiredStateConfiguration', @{ModuleName='xPSDesiredStateConfiguration';ModuleVersion='5.0.0.0'\r\n                    }\r\n    \r\n    Node $AllNodes.NodeName{\r\n        # WindowsOptionalFeature is compatible with the Nano Server installation option\r\n        File testfile{\r\n            Ensure          = 'Present'\r\n            DestinationPath = $Data.Path\r\n            Contents        = $Data.Contents\r\n                        }\r\n        xArchive testarchive{\r\n            Ensure          = 'Present'\r\n            Destination     = $Data.Destination\r\n            Path            = (Get-ChildItem $Data.Path).ParentFolder\r\n                        }\r\n                    }\r\n                }\r\n\r\nconfiguration TemplateBasic{\r\n    <#\r\n .description\r\n="" basic="" configuration="" template\r\n\r\n="" .example\r\n="" templatebasic="" -outpath="" c:\\dsc\\\r\n\r\n="" .notes\r\n="" this="" is="" the="" most="" basic="" configuration="" and="" does="" not="" take="" parameters="" or="" configdata\r\n="" #="">\r\n\r\n    Import-DscResource -module 'PSDesiredStateConfiguration'\r\n    \r\n    Node localhost{\r\n        # WindowsOptionalFeature is compatible with the Nano Server installation option\r\n        File testfile{\r\n            Ensure          = 'Present'\r\n            DestinationPath = 'c:\\filetoo.txt'\r\n            Contents        = 'this is some text too'\r\n                        }\r\n                    }\r\n                }"

Definitions

ErrorResponse

Error response of an operation failure

Name Type Description
code
  • string

Error code

message
  • string

Error message indicating why the operation failed.