How to determine Current Guest OS family – Only for Pass Instance (Web Role and Worker Role) Windows Azure PowerShell


  1. Set Up Windows Azure Powershell .  http://blogs.msdn.com/b/wats/archive/2013/02/18/windows-azure-powershell-getting-started.aspx .

Short Version  :  (For Multiple Subscription associated to your Account)

—————– 

  • Download Attached Powershell Script 
  • Run It .
Long Version  : 

PS C:\> Get-AzureService | Select Label

Label

—–

Guestos1

Guestos11

  

PS C:\> Get-AzureDeployment -ServiceName Guestos11 | select *     # Look for  osFamily=”1″ osVersion=”*” present in Configuration  option  

 

 

SdkVersion                : 2.3.6491.3

RollbackAllowed           : False

Slot                      : Production

Name                      : 86f4b412d3e148b59e01c0dc3c1bf61b

DeploymentName            : 86f4b412d3e148b59e01c0dc3c1bf61b

Url                       : http://guestos11.cloudapp.net/

Status                    : Running

CurrentUpgradeDomain      : 0

CurrentUpgradeDomainState :

UpgradeType               :

RoleInstanceList          : {, }

Configuration             : <?xml version=”1.0″ encoding=”utf-8″?>

                            <!–

                              **********************************************************************************************

 

                              This file was generated by a tool from the project file: ServiceConfiguration.Cloud.cscfg

 

                              Changes to this file may cause incorrect behavior and will be lost if the file is regenerated.

 

                              **********************************************************************************************

                            –>

                            <ServiceConfiguration serviceName=”WindowsAzure4″

                            xmlns=”http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration osFamily=”1″ osVersion=”*”

                            schemaVersion=”2014-01.2.3″>

                              <Role name=”WebRole1″>

                                <Instances count=”1″ />

                                <ConfigurationSettings>

                                  <Setting name=”Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString” value=”DefaultEndpointsProtocol=https;A

                            ccountName=guestos1;AccountKey=wmCvlmuNf3m/9z5WjwIXqMybmmw5KnbWJgO3WCFFmd2Kli1vPvgPXPYV/6T/huBthL8Gyc3qA1OGuIqMb+HPwA==”

                            />

                                </ConfigurationSettings>

                              </Role>

                              <Role name=”WorkerRole1″>

                                <Instances count=”1″ />

                                <ConfigurationSettings>

                                  <Setting name=”Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString” value=”DefaultEndpointsProtocol=https;A

                            ccountName=guestos1;AccountKey=wmCvlmuNf3m/9z5WjwIXqMybmmw5KnbWJgO3WCFFmd2Kli1vPvgPXPYV/6T/huBthL8Gyc3qA1OGuIqMb+HPwA==”

                            />

                                </ConfigurationSettings>

                              </Role>

                            </ServiceConfiguration>

DeploymentId              : 564d74180f77405587c8f5be4d553bd3

Label                     : WindowsAzure4 – 5/19/2014 12:24:06 PM

VNetName                  :

DnsSettings               :

OSVersion                 : *

RolesConfiguration        : {[WebRole1, Microsoft.WindowsAzure.Commands.ServiceManagement.Model.RoleConfiguration], [WorkerRole1,

                            Microsoft.WindowsAzure.Commands.ServiceManagement.Model.RoleConfiguration]}

VirtualIPs                : {WindowsAzure4ContractContract}

ReservedIPName            :

ServiceName               : Guestos11

OperationDescription      : Get-AzureDeployment

OperationId               : c679eea5-ed7e-a48a-aeb4-d49a617ba85a

OperationStatus           : Succeeded

 ———————

 
Thank you John Gose, Martin Grasruck, Tim Omta .  
Comments (3)

  1. Simon says:

    Hi, I extended the proposed script to allow for multiple subscriptions, suppress errors when getting the deployments and changed some other details. The new version is available at gist.github.com/…/ed8315998f3105c2a7a5 .

  2. Abhishek Anand says:

    Thank You Simon !! That really helps.

    One of my colleague ( Martin Grasruck )  also made some modification to add staging in place .

    gist.github.com/…/3a78dd18725fbe18db2b

  3. Simon says:

    Perfect, I just had a look and Martin obviously has more powershell skills 🙂

    Great work.