title: Azure automation with cosmosDB
body: <p>Trying to perform some updates to CosmosDB  with the Azure automation run books. I have made a RunAs service principal Account to authenticate with Azure</p>
  
  <p>Updating the Modules used for the Get-AzureRmResource  appear to cause some issues where I can no longer retrieve the CosmosDB   object.  </p>
  
  <pre><code>$Conn = Get-AutomationConnection -Name "AzureRunAsConnection"
  Add-AzureRmAccount -ServicePrincipal -Tenant $Conn.TenantID `
  -ApplicationID $Conn.ApplicationID -CertificateThumbprint 
  $Conn.CertificateThumbprint
  
  Select-AzureRmSubscription -SubscriptionName "Visual Studio Enterprise" -ErrorAction SilentlyContinue
  
     #resource and app variables declared here.
  
  $cosmosDbResource = (Get-AzureRmResource -ResourceType 
  "Microsoft.DocumentDb/DatabaseAccounts" -ResourceGroup $applicationGroup - 
  ApiVersion "2015-04-08" -Name $cosmosDBName)
  
  "Before CosmosDB Resource"
  $cosmosDbResource | FT
  "Cosmos DB Properties"
  $cosmosDbResource.Properties
  </code></pre>
  
  <p>This code works just fine on the plain deployment of automation accounts with the module. AzureRM.Resources  at 1.0.3.  </p>
  
  <p>If I try and update the AzureRM.Resource and its dependencies to 6.1.0   I can no longer retrieve my CosmosDB instance.   </p>
  
  <p>I think that there may be a conflict with the powershell modules with the update</p>