Azure Automation Configuration DSC, how to use composite resources

I have been working with Azure Automation State Configuration DSC recently and I wanted to verify what I am finding and see if I am missing something. I was able to figure out how to use a custom resource and bundle up the resources in a zip, upload to blob storage and deploy it using extensions.

$PublishParam = @{

ResourceGroupName = $SAResourceGroup

StorageAccountName = $StorageAccountName

ContainerName = $Container

ConfigurationPath = $ConfigurationPath

ConfigurationDataPath = $ConfigurationDataPath

}

Publish-AzVMDscConfiguration @PublishParam

 

$SetDscExtParam = @{

ResourceGroupName = $ResourceGroupName

VMName = $VMName

ArchiveStorageAccountName = $StorageAccountName

ArchiveResourceGroupName = $SAResourceGroup

ArchiveContainerName = $Container

ConfigurationArchive = $configurationArchive

ConfigurationName = $configurationName

ConfigurationArgument = $ConfigurationArgurments

Location = $Location

Version = $Version

}

$vm = Set-AzVMDscExtension @SetDscExtParam

The problem I have having is how do I do this and upload it to the pull server in Azure Automation Configuration DSC. I don’t see how to create composite resources with resources that are not already one of the built-in server DSC resources. Can you send me a working example, or a link that clearly shows how to pull it all together?

$confParam = @{

AutomationAccountName = $AAAName

ResourceGroupName = $ResourceGroupName

SourcePath = $ConPath

Description = 'Application Deployment'

Published = $true

Force = $true

Verbose = $true

}

$importObj = Import-AzAutomationDscConfiguration @confParam

 

$stCfComParams = @{

ConfigurationName = $Configuration

#Parameters = $Parmeters

ConfigurationData = $cfgData

ResourceGroupName = $ResourceGroupName

AutomationAccountName = $AAAName

}

$CompilationJob = Start-AzAutomationDscCompilationJob @stCfComParams

while($null -eq $CompilationJob.EndTime -and $null -eq $CompilationJob.Exception)

{

$CompilationJob = $CompilationJob | Get-AzAutomationDscCompilationJob

$CompilationJob

Start-Sleep -Seconds 3

}

$DscRegParam = @{

AzureVMName = $VmName

NodeConfigurationName = $ConfigurationName

AzureVMResourceGroup = $VmRGName

AzureVMLocation = $VmLocation

ConfigurationMode = 'ApplyOnly'

#'ApplyAndAutocorrect'

RebootNodeIfNeeded = $true

ActionAfterReboot = 'ContinueConfiguration'

AutomationAccountName = $AAAName

ResourceGroupName = $ResourceGroupName

Verbose = $true

}

Register-AzAutomationDscNode @DscRegParam

 

 

 

 

 

 

 

I guess the DSC forum is not a very active forum? Is there someplace that DSC in azure is better represented by the community of users?

did you check https://dsccommunity.org/ ? There are lot more cool information there :slight_smile:

Thanks Kvprasoon, I just found it and it has this site on it’s list of potential resources. That is how I got back to your post. I am going to read through everything on that site and see if I can contribute there. Thanks!!!