title: Azure Automation Runbooks using Get-Credential without parameters
body: <p>There are several Runbooks examples in the Azure Runbook Gallery, such as:</p>
  
  <ul>
  <li><em>Deploy a Windows Azure Web Site Pointing to a SQL Database and Storage Account</em></li>
  </ul>
  
  <p>that use the following syntax with <code>Get-Credential</code>:</p>
  
  <pre><code>$credential = Get-Credential
  </code></pre>
  
  <p>which implies that the command should prompt for the credentials -- but this fails in a Runbook with the following message:</p>
  
  <blockquote>
    <p>Get-Credential : Cannot process command because of one or more missing mandatory parameters: Credential.</p>
  </blockquote>
  
  <p>The credentials that are desired here are for this purpose:</p>
  
  <pre><code># Get credentials from user to setup administrator access to new SQL Azure Server
  </code></pre>
  
  <p>which then should get used in downstream cmdlet calls in the Runbook such as </p>
  
  <pre><code>$databaseServer = New-AzureSqlDatabaseServer -AdministratorLogin $credential.UserName `
      -AdministratorLoginPassword $credential.GetNetworkCredential().Password -Location $Location
  </code></pre>
  
  <p>But because <code>Get-Credential</code> fails the downstream calls fail.  </p>
  
  <p>What I am doing wrong?  </p>
  
  <p>Why does a Runbook in the Gallery have statements that seem to be incompatible (prompt for Credentials) with allowable Runbook behaviors?</p>