Connecting to Azure subscription from my laptop

Varma 1,495 Reputation points
2024-02-03T07:45:17.2266667+00:00

I am trying to connect to Azure PowerSHell, but I am getting following errors I tried following steps: User's image

and User's image

and it seems i need to load .psd1 based onn above error Please suggest what exactly needs to be done.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,044 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JimmySalian-2011 42,511 Reputation points
    2024-02-03T16:12:12.7333333+00:00

    Hi,

    Try running the commands via the Admin mode and always follow that process, check the steps here and it should be good - https://learn.microsoft.com/en-us/powershell/azure/install-azps-windows?view=azps-11.2.0&tabs=powershell&pivots=windows-psgallery

    Hope this helps. JS

    == Please Accept the answer if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

  2. kobulloc-MSFT 26,811 Reputation points Microsoft Employee Moderator
    2024-02-06T02:15:40.9266667+00:00

    Hello, @Varma !

    How do I install Azure PowerShell on Windows? What are alternatives to a local installation?

    I quickly want to mention an alternative to a local installation that I find to be very helpful, Azure Cloud Shell. It works from any browser, has up to date modules, and can be a quick and easy way to bypass any issues you may have with a local installation:

    https://learn.microsoft.com/en-us/azure/cloud-shell/get-started/classic?tabs=azurecli

    Screenshot of the new Cloud Shell user experience.

    If you are installing locally, I second the recommendation from @JimmySalian-2011 and would like to underscore that it is recommended to be used with PowerShell version 7 or higher:

    https://learn.microsoft.com/en-us/powershell/azure/install-azps-windows?view=azps-11.2.0&tabs=powershell&pivots=windows-psgallery

    If you want to use PowerShell version 5.1, you'll need to meet these prerequisites:

    • Confirm your version of PowerShell with $PSVersionTable.PSVersion (and I see you have 5.1)
    • Determine if you have the AzureRM PowerShell module installed with Get-Module -Name AzureRM -ListAvailable (if you have the AzureRM PowerShell module installed, you'll need to reference Az and AzureRM coexistence).

    Then you'll need to complete the remaining perquisites:

    Update to Windows PowerShell 5.1 Install .NET Framework 4.7.2 or later

    • Update PowerShellGet Launch Windows PowerShell 5.1 elevated as an administrator and run the following command to update PowerShellGet:
      Install-Module -Name PowerShellGet -Force
      
    
    • Set the PowerShell execution policy to remote signed or less restrictive
      • Check the PowerShell execution policy:
        Get-ExecutionPolicy -List
        
    
    • Set the PowerShell execution policy to remote signed:
        Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
        
    

    After the prerequisites have been completed, you can use the Install-Module cmdlet to install the Az PowerShell module:

    
    Install-Module -Name Az -Repository PSGallery -Force
    
    

    I hope this has been helpful! Your feedback is important so please take a moment to accept answers. If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.