Azure Automation Configuration DSC, how to use composite resources

Welcome Forums DSC (Desired State Configuration) Azure Automation Configuration DSC, how to use composite resources

  • This topic has 3 replies, 2 voices, and was last updated 2 months ago by
    Participant
    .
Viewing 3 reply threads
  • Author
    Posts
    • #226773
      Participant
      Topics: 30
      Replies: 69
      Points: 174
      Rank: Participant

      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
      
      

       

       

       

       

       

       

       

      • This topic was modified 3 months ago by i255d.
    • #232462
      Participant
      Topics: 30
      Replies: 69
      Points: 174
      Rank: Participant

      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?

    • #233557
      Senior Moderator
      Topics: 9
      Replies: 1264
      Points: 4,576
      Helping Hand
      Rank: Community Hero

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

    • #233731
      Participant
      Topics: 30
      Replies: 69
      Points: 174
      Rank: Participant

      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!!!

Viewing 3 reply threads
  • You must be logged in to reply to this topic.