Freigeben über


HOW TO ESTABLISH A CONNECTION WITH YOUR WINDOWS AZURE SUBSCRIPTION VIA POWER SHELL? (STEP BY STEP GUIDE)

Before you start make sure that you’ve uploaded a self-signed certificate to your Windows Azure subscription, check How in this post

1. You download the Windows Azure Power Shell tool from here 

2. Double click on the downloaded file and it will open the web platform installer 4.5 and the following window will appear.

Image

3. Click install and the following window will appear, make sure that Windows Azure PowerShell is selected and click I accept

Image

4. After this the installation will be completed and the PowerShell will be installed.

5. Open Windows Azure PowerShell Command prompt as an administrator from this location if you are using x64 Processor

C:\windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

or here if you are using x86 processor

C:\windows\Sys32\WindowsPowerShell\v1.0\powershell.exe

6.  Type in the PowerShell screen the following command:

set-executionpolicy remotesigned

ps3

7. Then type the following command:

get-azurepublishsettingsfile

This command will open the browser for you to sign in your azure subscription and after you do that , you will have to download the publishsettings file

8. After you save the azure publish settings file on your computer, type the following command in the PowerShell Prompt:

Import-azurepublishsettingsfile “<the file path>”

so if you saved the file on this path “c:\azurepublishfile\yourfilename.publishsettings” then the command will be as the following:

Import-azurepublishsettingsfile “c:\azurepublishfile\yourfilename.publishsettings”

9. To confirm that you can communicate with Azure via PowerShell , type in the following command:

get-azuresubscription

it should return your subscription information.

In the next post, I’ll share some other commands that you can use in PowerShell with Azure.