DSC on Azure

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of David O'Brien David O’Brien 2 years, 1 month ago.

  • Author
    Posts
  • #20059
    Profile photo of David O'Brien
    David O’Brien
    Participant

    Hi guys,

    I was trying to get the xChrome module to work via the Azure DSC extension and for whatever reason the extension doesn't like the module.

    I can create the MOF just fine on my workstation, but the log on Azure always says:

    [2014-10-26T13:57:00] Creating working directory: C:\Packages\Plugins\Microsoft
    .Powershell.DSC\1.4.0.0\DSCWork\DSC_Demo_ChromeConfig.ps1.0
    [2014-10-26T13:57:00] Downloading configuration package
    [2014-10-26T13:57:00] Downloading https://psdscstorage.blob.core.windows.net/wi
    ndows-powershell-dsc/DSC_Demo_ChromeConfig.ps1.zip to C:\Packages\Plugins\Micro
    soft.Powershell.DSC\1.4.0.0\DSCWork\DSC_Demo_ChromeConfig.ps1.0\DSC_Demo_Chrome
    Config.ps1.zip
    [2014-10-26T13:57:01] Extracting DSC_Demo_ChromeConfig.ps1.zip
    [2014-10-26T13:57:01] Installing custom DSC resource modules to C:\Program 
    Files\WindowsPowerShell\Modules
    [2014-10-26T13:57:01] Installing custom DSC resource module xChrome
    [2014-10-26T13:57:02] Installing custom DSC resource module 
    xPSDesiredStateConfiguration
    [2014-10-26T13:57:02] Applying DSC configuration under C:\Packages\Plugins\Micr
    osoft.Powershell.DSC\1.4.0.0\DSCWork\DSC_Demo_ChromeConfig.ps1.0
    [2014-10-26T13:57:02] Writing handler status to 
    C:\Packages\Plugins\Microsoft.Powershell.DSC\1.4.0.0\Status.status
    [2014-10-26T13:57:02] Executing configuration script: C:\Packages\Plugins\Micro
    soft.Powershell.DSC\1.4.0.0\DSCWork\DSC_Demo_ChromeConfig.ps1.0\DSC_Demo_Chrome
    Config.ps1
    [2014-10-26T13:57:12] Preparing configuration data
    [2014-10-26T13:57:12] Executing the configuration function to generate the MOF 
    files.
    PSDesiredStateConfiguration\Configuration : The module 'MSFT_xChrome' could 
    not be loaded. For more information, run 'Import-Module MSFT_xChrome'.
    At C:\Packages\Plugins\Microsoft.Powershell.DSC\1.4.0.0\DSCWork\DSC_Demo_Chrome
    Config.ps1.0\DSC_Demo_ChromeConfig.ps1:1 char:1
    + Configuration GoogleChrome {
    + ~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (MSFT_xChrome\MSFT_xChrome:Strin 
       g) [Configuration], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : CouldNotAutoLoadModule,Configuration
     
    C:\Packages\Plugins\Microsoft.Powershell.DSC\1.4.0.0\bin\DscExtensionHandler.ps
    1 : Error enabling the DSC Extension: Errors occurred while processing 
    configuration 'GoogleChrome'.
    At line:1 char:1
    + .\bin\DscExtensionHandler.ps1 -Verbose *> C:\WindowsAzure\Logs\Plugin ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
       tion
        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
       n,DscExtensionHandler.ps1
    
    

    It works just fine on Azure when I don't use a custom resource. Both custom modules are there, they are where the log file said it would copy them. WindowsFeature worked nicely through the extension.

    Cheers
    David

  • #20061
    Profile photo of Adnan Rashid
    Adnan Rashid
    Participant

    You may have to check the namings of things, when i was bootstrapping i found the naming had to match up everywhere otherwise the configs may not apply.

    Also you are saying, when you run the dsc config just directly on server it works okay, but its the bootstrapping thats the issue?

  • #20064
    Profile photo of David O'Brien
    David O’Brien
    Participant

    Okay, tested it again and it was a syntax thing.
    I used

    Import-DSCResource -Name instead of -ModuleName and thus it couldn't find the module.

    All working now.

    Cheers 😉

You must be logged in to reply to this topic.