title: Get-AzureRmAppServicePlan and Get-AzureRmWebApp return exceptions in Runbook
body: <p>I'd like to get all properties with <code>Get-AzureRm*</code> commands in Automation Runbook, but the followings return exception. How to code so as to work these commands properly?</p>
  
  <ul>
  <li>Returns exception
  
  <ul>
  <li>Get-AzureRmAppServicePlan</li>
  <li>Get-AzureRmWebApp</li>
  </ul></li>
  <li>Returns expected result
  
  <ul>
  <li>Get-AzureRmStorageAccount</li>
  </ul></li>
  </ul>
  
  <h3>input - Powershell Runbook (not Workflow)</h3>
  
  <pre><code>Write-Output $PSVersionTable
  $resourceGroupName = "(snipped)"
  $appServicePlans = Get-AzureRmAppServicePlan -ResourceGroupName $resourceGroupName
  
  $Cred = Get-AutomationPSCredential -Name "pscred" # works as expected
  Add-AzureRmAccount -Credential $Cred
  Add-AzureAccount -Credential $Cred
  
  $appServicePlans = `
      Get-AzureRmAppServicePlan -ResourceGroupName $resourceGroupName
  $appServices = `
      Get-AzureRmWebApp -ResourceGroupName $resourceGroupName
  $storageAccounts = `
      Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName
  </code></pre>
  
  <h3>output</h3>
  
  <p>By [Test] in Management Portal</p>
  
  <pre><code>Name                           Value
  ----                           -----
  PSVersion                      5.0.10514.2
  WSManStackVersion              3.0
  SerializationVersion           1.1.0.1
  CLRVersion                     4.0.30319.19455
  BuildVersion                   10.0.10514.2
  PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
  PSRemotingProtocolVersion      2.3
  
  Get-AzureRmAppServicePlan : The term 'Get-AzureRmAppServicePlan' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  
  At (position in the source)
  + $appServicePlans = Get-AzureRmAppServicePlan -ResourceGroupName $reso ...
  +                    ~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : ObjectNotFound: (Get-AzureRmAppServicePlan:String) [], CommandNotFoundException
  + FullyQualifiedErrorId : CommandNotFoundException
  
  Get-AzureRmWebApp : The term 'Get-AzureRmWebApp' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
  
  At (position in the source)
  + $appServices = Get-AzureRmWebApp -ResourceGroupName $resourceGroupNam ...
  +                ~~~~~~~~~~~~~~~~~
  + CategoryInfo          : ObjectNotFound: (Get-AzureRmWebApp:String) [], CommandNotFoundException
  + FullyQualifiedErrorId : CommandNotFoundException
  
  # $storageAccounts has got as expected
  </code></pre>
  
  <h3>[Asset] - [Module] list</h3>
  
  <pre><code>Azure
  Azure.Storage 
  AzureRM.Automation 
  AzureRM.Compute 
  AzureRM.Profile 
  AzureRM.Resources 
  AzureRM.Sql 
  AzureRM.Storage 
  Microsoft.PowerShell.Core 
  Microsoft.PowerShell.Diagnostics 
  Microsoft.PowerShell.Management 
  Microsoft.PowerShell.Security 
  Microsoft.PowerShell.Utility 
  Microsoft.WSMan.Management 
  Orchestrator.AssetManagement.Cmdlets 
  </code></pre>