title: Azure Automation DSC - Using PSCredential in DSC Configuration
body: <p>I'm trying to pass pscredentials to a dsc config intended for deployment through Azure Automation DSC, though I can't seem to get it working using the two documented methods.</p>
  
  <p>1)  The first method indicates that a PSCredential can be added to the credential store associated with the automation account being used for dsc.  All the documentation I can find refers to the azure classic portal, and instructs you to select the credential 'type.'  However, Azure Automation management is no longer available in the classic portal, and the new portal doesn't have a 'type' drop-down for new credentials, and the type is 'Microsoft.Azure.Commands.Automation.Model.CredentialInfo' -- which doesn't bare the getnetworkcredential() method that pscredential types have (need to get the plain-text password from within the dsc config to set new users [user dsc resource]).  Am I missing something here, or is Azure in a weird state given the cut-over from classic to new portal for Automation functionality.  I also tried using the Get-AutomationPSCredential to read in the credentials I had added to the new portal to see if it implicitly does the type conversions, but that didn't work either (didn't find any objects under that name).</p>
  
  <p>2)  Documentation also states that adding a param() block, and specifying the the pscredentials as parameters will dynamically populate those very same parameters during compilation, so there values can be filled out when compiling through the portal...though this doesn't happen, and the compilation job fails to recognize 'param,' throws a terminating exception and halts.</p>
  
  <p>code looks something like this:</p>
  
  <pre><code>$configdata = @{
      AllNodes = @(
          @{
              NodeName = "samplenode"
              PSDSCAllowPlainTextCredential = $true
  }
  )
  }
  
  configuration testconfig {
     Import-DSCResource -ModuleName PSDesiredStateConfiguration
  
      param (
          [pscredential]$cred
      )
  
      Node $AllNodes.NodeName {
          User testuser {
          "blah blah blah"
  }
  }
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated, thanks!</p>