How to check version of Azure PowerShell and Azure SDK

Usually Azure DevOps need check version of Azure PowerShell and Azure SDK,that is to ensure the required PowerShell commands and Azure API are packaged there, here below are quick ways to go:

  • Check version of Azure PowerShell

launch Azure PowerShell as admin, then run commands below:


if(Get-Module -ListAvailable |
Where-Object { $ -eq $name })
(Get-Module -ListAvailable | Where-Object{ $_.Name -eq $name }) |
Select Version, Name, Author, PowerShellVersion  | Format-List;
“The Azure PowerShell module is not installed.”

also the commands can be saved into a PowerShell file like Get-AzurePowerShellCmdletsVersion.ps1, then executing the PowerShell file will result the same as above.

here is output:


  • Check version of Azure SDK

Checking Azure SDK version can be done by any of :

Azure PowerShell: Get-AzureDeployment -ServiceName **** -Slot Production | Where-Object -Property SdkVersion | select SdkVersion

VM environment: RoleModel.xml, Role initialization log of the deployment or SDK installation output. See more:

Programming: put the codes in web role or worker role

public string GetWindowsAzureSDKVersion()
// Warning this is undocumented and could break in a future SDK release
string roleModelFile = Environment.GetEnvironmentVariable(“RoleRoot”) + “\\RoleModel.xml”;
XmlDocument xmlDocument = new XmlDocument();

return xmlDocument.GetElementsByTagName(“RoleModel”)[0].Attributes[“version”].Value;
catch (Exception e)
return “unknown”;


Leave a Reply

Your email address will not be published. Required fields are marked *