Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Automation update to 5.0.3 Cause me not to be able to pulls cosmos Resource #4

Open
Frankwayne opened this issue Jun 20, 2018 · 0 comments

Comments

@Frankwayne
Copy link

Frankwayne commented Jun 20, 2018

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

Updating the Modules used for the Get-AzureRmResource appear to cause some issues where I can no longer retrieve the CosmosDB object.

From a plain automation account with the powershell modules of v1.0.3 the Process of update my runbook module is I look for the AzureRM.WebSite module. Currently Version 5.0.3; I click import, then I check the box for importing dependency modules that need update as well.

my runbook code is as follows.

$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

This code works just fine on the plain deployment of automation accounts with the module. AzureRM.Resources at 1.0.3.

I think that there may be a conflict with the powershell modules with the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant