Posts tagged ‘SDK’

First of all you need to have Microsoft Azure PowerShell SDK installed, after this step is done you may type
           Add-AzureAccount
and this will authenticate you via web browser in Azure account ( you need to have working Azure account obviously ). Alternatively you may use PublishSettings :

    1. Open that link to Donwload Azure Publish Settings Profile: https://manage.windowsazure.com/publishsettings , then save you credentials.
    2. Open Microsoft Azure Powershell and run Import-AzurePublishSettingsFile :


PS C:\> Import-AzurePublishSettingsFile C:\tools\azure\my_settings.publishsettings
Id : c09f1074-6e2e-45be-aeee-935d6642424d
Name : Windows Azure MSDN - Visual Studio Ultimate
Environment : AzureCloud
Account : 24636FAB2C68B96D43777561A3CD728092912C03
Properties : {[SupportedModes, AzureServiceManagement]}

Then you need to keep in mind that Azure PowerShell (from 0.8.0 ) contains many modules, here we will talk about three main modules ( complete list of eveything which is inside SDK is here – see Azure SDK CmdLets reference ):

  • AzureProfile : operates with profiles commands like Add-AzureAccount, Get-AzureSubscription, and Switch-AzureMode. Complete list of commands in AzureProfile module is availalbe here – see Azure Profile Cmdlets. Commands from AzureProfile are always available – not like two next modules which are not designed to be used in the same PowerShell session.

 

  • Azure ( or AzureServiceManamagement ): contains commands which operated by core ( or basic :-)) cloud functionality like virtual machines, web sites, storage accounts and  so on. Complete list of commands inside this module is here – see Azure Service CmdLets. You can switch to that module using Switch-AzureMode -Name AzureServiceManagement

 

 Note: sometimes ( it happened with me as well ) default installation of Azure SDK cmdlets do not include some modules ( in my case it happened with DNS and Azure SQL Database ), then you have choice how to install them – first of all you always may use Azure powershell sources on github to get full and latest one version of cmdlets or you also may check files inside “C:\Program Files (x86)\Microsoft SDKs\Azure” folder and try to import modules from there like this ( it worked for me ):

 
 import-module "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureResourceManager.psd1"