3

I am trying to use this azure commandlets form C# application that is console job hosted in my azure Virtual machine. this job runs more then once in a day automatically but my azure commandlets are fails to execute. yesterday that works fine but after a day it is not working please help me. ☺

Note : here i am doing some administration task and i am using organizational account. but it fails to add account other commandlets goes fail to work.

Jenish Zinzuvadiya
  • 999
  • 2
  • 15
  • 29
  • Can you please let us know how exactly you are trying to connect to azure? Through c# you can use publishsettingfile to connect to azure. Else you can opt Azure runbooks if you are performing some scheduling kind of stuff. – Aatif Akhter Sep 16 '15 at 16:53
  • I am using organizational account to login. [you can see here, how i login.](https://social.msdn.microsoft.com/Forums/exchange/en-US/b2bece71-72d7-4305-ad81-02139959e643/powershell-retrieving-pipeline-errors-in-c?forum=exchangesvrdevelopment) – Jenish Zinzuvadiya Sep 18 '15 at 12:04

3 Answers3

6

Install the Azure PowerShell tools. The download link is here: https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/#how-to-install-azure-powershell

Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
4

It's renamed to Add-AzureAccount.

josullivan
  • 141
  • 1
  • 5
3

I'm assuming that the original question was "The term 'Login-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file. I'm seeing the same thing, despite "Install-Module AzureRM" having been done (from an elevated powershell prompt) and "Get-Module AzureRM" returning a version of 4.3.1 (i.e. powershell tools being installed).

The first part of the solution for me was to also do "Install-Module Azure" (from an elevated powershell prompt) as well after which "Add-AzureAccount" worked. However a command such as "New-AzureRmResourceGroup" still failed with "Run Login-AzureRmAccount to login".

The second part of the solution was simply to reboot, after which:

Add-AzureRmAccount
New-AzureRmResourceGroup -Name wibble -Location UKSouth

worked.

SomeoneElse
  • 360
  • 2
  • 12