AzureRM Powershell command weirdness?

Status
Not open for further replies.

caustic meatloaf

Ars Legatus Legionis
13,859
Subscriptor
Well, this one is confusing me. Anyone aware of any recent changes to AzureRM powershell cmdlets? This script worked perfectly fine 2 weeks ago, and now, it's not.

What happens:

code:
$cred2 = Get-Credential
Login-AzureRmAccount -Credential $cred2

Select-AzureRMSubscription -SubscriptionName "$Subscription_name"
Now, when I run these commands individually, everything returns OK.

After the login command (which works successfully), it shows my name and my default sub info. The next command is suppose to change teh working sub to another one, so that I can then run commands against the correct subscription.

However, in the script, I get a partial return on the Select command, instead of :
Environment : AzureCloud
Account : caustic.meatloaf@domain.com
TenantId : tenantId
SubscriptionId : SubScriptionId
SubscriptionName : Test
CurrentStorageAccount :

which is what appears manually (and what DID appear when running this script before)

I get this:

Account : caustic.meatloaf@domain.com
Environment : AzureCloud
Subscription : SubScriptionId
Tenant : TenandId

It's not complete, and the order of stuff is different. I did try putting in some pauses between commands in the script, but that didn't fix it.

what I'm seeing after this is that all the commands fail to run correctly because it doesn't appear that the correct subscription is being selected successfully. Or, my login session isn't sustaining or somethihng like that, so when they go to search for azure components, they commands break because they cannot find them.
 

caustic meatloaf

Ars Legatus Legionis
13,859
Subscriptor
Well, as an update, I was able to get it to select the appropriate subscription by adding the -SubscriptionId tag to the login command, but my commands still break, saying that I need to run Login-AzureRMAccount, but that's literally run right before they break.

OK, solved. Azure Cmdlets have been updated, and whatever they changed broke the dependancies. I had to run "update-module Azure*" to get everything updated, and then restarted my computer.
 
Status
Not open for further replies.