PowerShell version: 5
I've uploaded a DSC ps1 file in a zip to Azure storage using the command:
publish-azurermvmdscconfiguration
With the appropriate parameters and arguments. Then I enter:
Set-AzureRmVmDSCExtension -ResourceGroupName Pollers -VmName <VmName> -ArchiveBlobName Run-DSCPython.zip -ArchiveStorageAccountName <storageAccountName> -Version 2.2 -Verbose
And I get the following (generally opaque) error message in PowerShell:
Set-AzureRmVmDSCExtension : The pipeline has been stopped.
At line:1 char:1
+ Set-AzureRmVmDSCExtension -ResourceGroupName Pollers -VmName Download ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmVMDscExtension], PipelineStoppedException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Extension.DSC.SetAzureVMDscExtensionCommand
Set-AzureRmVmDSCExtension : Long running operation failed with status 'Failed'.
At line:1 char:1
+ Set-AzureRmVmDSCExtension -ResourceGroupName Pollers -VmName Download ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Set-AzureRmVMDscExtension], CloudException
+ FullyQualifiedErrorId : InvalidResult,Microsoft.Azure.Commands.Compute.Extension.DSC.SetAzureVMDscExtensionCommand
In the Azure Portal though, I dig up a more detailed log, it's very long so I'll post here only the part I believe is connected to the error itself:
[ERROR] An error occurred while executing script or module 'Run-DSCPython':
The specified module 'Run-DSCPython' was not loaded because no valid module file
was found in any module directory.
Any idea what I need here? What module is it looking for?
While not exactly an answer to your question, I would propose you compile mofs in Azure Automation and register your VM's as nodes to Azure Automation, the process is a bit lengthy to write out here, I'll write a short guide:
Edit: forgot to tell you the reasoning, I've wasted 2-3 weeks trying to make DSC extension to work RELIABLY. I failed miserably, Azure Automation on the other hand was far more reliable, although really tricky at the beginning.