Migrating from Automation Account to Automation State Configuration

Kevin Blackwell 0 Reputation points
2025-04-24T22:13:11.1866667+00:00

I had an configuration working with an automation account, but I cannot seem to get it to operate on the automation stage configuration side.

I was in the process of developing this using an Azure AA account, but with it becoming EOL, I wanted to see about migrating.

The part that is giving me trouble is below

Configuration MyDscConfiguration {
    Import-DscResource -ModuleName PSDscResources
    
    Node localhost {
        Script copyMedia {		
			GetScript = { @{} }
			SetScript = {
				...
				New-PSDrive -Name Y -PSProvider FileSystem -Root "\\azurestorage.file.core.windows.net\azurestorage" -Persist
				New-Item -ItemType directory ...
				Copy-Item -Path ...
				...
			}
			TestScript = {$true}
}

I might have had some compliancy issues that I was working on, but it at least mounted the drive and copied over files when I complied the configuration in an Automation account and applied to a node.

But when I 1) compile the mof, 2) run New-GuestConfigurationPackage, then 3) Start-GuestConfigurationPackageRemediation on the zip file, the above is not happening.

I'm not seeing any details on how to log more info to see why it's failing.

I'm just not seeing any mounted drives or files copied over from storage.

My end goal is to use DSC to automate installing applications on vm's after they are provisioned.

I don't see any other references in PSDscResources that would accomplish this except for script.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,351 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.