Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure PowerShell will not connect

I have downloaded and installed the Azure Powershell by following the MS instructions: https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/

Using the Windows Powershell ISE I run the command:

Login-AzureRmAccount

which returns the the error:

Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.Profile', but the  module could not be loaded. For more information, run 'Import-Module AzureRM.Profile'. At line:1 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

Import-Module AzureRM.Profile

Returns this error:

Import-Module : File C:\Program Files (x86)\Microsoft 
SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile\CheckVersions.ps1 cannot be loaded 
because running scripts is disabled on this system. For more information, see about_Execution_Policies at 
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module AzureRM.Profile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand

Why is it so difficult to connect to Azure, what could be wrong?

like image 661
George Filippakos Avatar asked Feb 04 '16 02:02

George Filippakos


1 Answers

From the command prompt run:

powershell Set-ExecutionPolicy RemoteSigned
like image 129
George Filippakos Avatar answered Sep 28 '22 07:09

George Filippakos