Skip to content

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

Description

@Frankwayne

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions