Tag Archives: Diagnostics

Managing Log Files with Windows Azure PowerShell Cmdlets 2.0

This is part 5 of a series:

In this example I’m going to show you how you can manage log data from your Windows Azure Application using new functionality in the Windows Azure PowerShell Cmdlets 2.0.

Just as in the other articles you will need to add the PowerShell Snapin (or module):

  Add-PsSnapin WAPPSCmdlets

Ditto, I have this handy initialization block and helper function GetDiagRoles:

Initialization and Helper Function

 
 $storageAccountName = "YourStorageAccountName" 
 $storageAccountKey = "YourStorageAccountKey" 
 $deploymentSlot = "Production" 
 $serviceName = "YourHostedService" 
 $subscriptionId = "YourSubscriptionId" 
 # Thumbprint for your cert goes below
 $mgmtCert = Get-Item cert:CurrentUserMyD7BECD4D63EBAF86023BB4F1A5FBF5C2C924902A 
 
 
 function GetDiagRoles { 
   Get-HostedService -ServiceName $serviceName -SubscriptionId $subscriptionId -Certificate $cert | ` 
   Get-Deployment -Slot $deploymentslot | ` 
   Get-DiagnosticAwareRoles -StorageAccountName $storageAccount -StorageAccountKey $storageKey 
 }

What is distinct about managing log files remotely in Windows Azure is determining where on the file system the log files actually are.

I’ve written some samples that show some techniques you can use from PowerShell for determining file locations.

When determining the local path for a named local resource I’m using guidance from MSDN: http://msdn.microsoft.com/en-us/library/ee758708.aspx.

For the rest of the log paths I am essentially just using observations of how the paths are constructed. At this point there is no guarantee this format will change but for the time being it doesn’t look too likely.

Returns the Local Path for IIS Logs

function GetIISLogsPath()
{
 $input | foreach { 
  $path = "C:ResourcesDirectory" + $_.DeploymentId + "." + $_.RoleName + ".DiagnosticStoreLogFiles"
  return $path
 }
}

Returns the Local Path for IIS Failed Request Logs

function GetIISFailedRequestPath()
{
 $input | foreach {
  $path = "C:ResourcesDirectory" + $_.DeploymentId + "." + $_.RoleName + ".DiagnosticStoreFailedReqLogFiles"
  return $path
 }
}

Returns the Local Path for Crash Dumps

function GetCrashDumpsPath($rolename, $deploymentid)
{
 $input | foreach {
  $path = "C:ResourcesDirectory" + $_ + "." + $_ + ".DiagnosticStoreCrashdumps"
  return $path
 }
}

Returns the Local Path for a Named Local Resource

function GetLocalResourcePath($localResource)
{
 $input | foreach {
  $path = "C:Resourcesdirectory" + $_.DeploymentId + "." + $_.RoleName + "." + $localResource
  return $path
 }
}

Now that we have some helper functions to figure out where are logs are in our Windows Azure Deployment we need a method of modifying the logging data sources in Windows Azure Diagnostics.
The long function below does just that. It takes the local path of the files you want to transfer, what container in Windows Azure Storage to transfer the files to, a quota (can be set to 0) and how often to transfer that directory to storage in minutes.

Configures a local directory in a Windows Azure role to be transferred into Windows Azure Storage.

function SetDirectory($path, $container, $quota, $transferAllInMinutes)
{
  $input | foreach { 
    $role = $_ 
    $role | Get-DiagnosticAwareRoleInstances  |
      foreach {
          $roleinstance = $_
          $diagConfig = $role | Get-DiagnosticConfiguration -InstanceId $roleinstance -BufferName Directories
          $existingDirectory = $false
          $newDirectoryConfig = $null
          for($i=0;$i -lt $diagConfig.DataSources.Count; $i++)
          {
             $tmpDiag = $diagConfig.DataSources[$i]
             if($tmpDiag.Path -eq $path)
             {
                $existingDirectory = $true
                $newDirectoryConfig = $diagConfig.DataSources[$i]
                break
             }
          }
 
          # doesn't already exist in the collection so create a new one
          if($existingDirectory -eq $false) 
          {
            $newDirectoryConfig = New-Object -TypeName Microsoft.WindowsAzure.Diagnostics.DirectoryConfiguration
          }
          $newDirectoryConfig.Container = $container
          $newDirectoryConfig.Path = $path
          $newDirectoryConfig.DirectoryQuotaInMB = $quota
          if($existingDirectory -eq $false)
          {
            $diagConfig.DataSources.Add($newDirectoryConfig)
          }
 
          $role | Set-FileBasedLog -DirectoriesConfiguration $diagConfig.DataSources -BufferQuotaInMB $quota -TransferPeriod $transferAllInMinutes
        }
    }
}

Now the step of actually configuring your role using all of this code.

The snippet below configures IIS logs, IIS failed request logs and a local resource named “customLogging” to be transferred to storage every 15 minutes.

Configuring Logs to be Transferred

GetDiagRoles | foreach {
  $CurrentRole = $_
 
  if($CurrentRole.RoleName -eq "MyWebRole")
  {
   # Retrieve the local paths in the role
   $iislogs = $CurrentRole | GetIISLogsPath
   $iisFailedLogs = $CurrentRole  | GetIISFailedRequestPath
   $customLogs = $CurrentRole | GetLocalResourcePath "customLogging"
 
   # Configure diagnostics to transfer log data to storage
   $CurrentRole | SetDirectory $iisFailedLogs "wad-iis-failedreqlogfiles"  0 15
   $CurrentRole | SetDirectory $iislogs "wad-iis-logfiles"  0 15
   $CurrentRole | SetDirectory $customLogs  "wad-customlogging"  0 15 
  }
}

The snippet below downloads the files from each container to the local file system.

Downloading the Data from Storage

Save-Container -ContainerName "wad-iis-logfiles" -LocalPath "c:diagdata" `
			-StorageAccountKey $storagekey -StorageAccountName $storageAccount
 
Save-Container -ContainerName "wad-iis-failedreqlogfiles" -LocalPath "c:diagdata" `
			-StorageAccountKey $storagekey -StorageAccountName $storageAccount
 
Save-Container -ContainerName "wad-customlogging" -LocalPath "c:diagdata" `
			-StorageAccountKey $storagekey -StorageAccountName $storageAccount

Finally, to clean up storage from each container we provide you with the Clear-Container cmdlet.

Note: Currently, we do not provide a -From or -To parameter to Clear-Container. To ensure that you do not delete data that may currently be being logged
you will need to ensure your scheduled transfers do not overlap during the same time period of a deletion. Yes, we are looking into improving this scenario.

Cleaning up a Container

Clear-Container -ContainerName "wad-iis-logfiles"  `
			-StorageAccountKey $storagekey -StorageAccountName $storageAccount
 
Clear-Container -ContainerName "wad-iis-failedreqlogfiles" `
			-StorageAccountKey $storagekey -StorageAccountName $storageAccount
 
Clear-Container -ContainerName "wad-customlogging" `
			-StorageAccountKey $storagekey -StorageAccountName $storageAccount

Print Current Windows Azure Diagnostic Settings

This is part 3 of a series.

Here is a handy helper function to help you view what diagnostics settings are currently configured for your Windows Azure service.

(Tip: I add all of these helper functions to a PowerShell Module (.psm1) script, export functions and variables and include it in my other scripts)

Just as in the other articles you will need to add the PowerShell Snapin (or module):

  Add-PsSnapin WAPPSCmdlets

Ditto, I have this handy initialization block and helper function GetDiagRoles:

Initialization and Helper Function

  $storageAccountName = "YourStorageAccountName" 
  $storageAccountKey = "YourStorageAccountKey" 
  $deploymentSlot = "Production" 
  $serviceName = "YourHostedService" 
  $subscriptionId = "YourSubscriptionId" 
  # Thumbprint for your cert goes below 
  $mgmtCert = Get-Item cert:CurrentUserMyD7BECD4D63EBAF86023BB4F1A5FBF5C2C924902A 
 
  function GetDiagRoles { 
    Get-HostedService -ServiceName $serviceName -SubscriptionId $subscriptionId -Certificate $mgmtCert | ` 
        Get-Deployment -Slot $deploymentslot | ` 
        Get-DiagnosticAwareRoles -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey 
   }

PrintDiagnosticSettings Helper Function

function PrintDiagnosticSettings
{
      $input | foreach {
      $RoleObject = $_
      $RoleObject | Get-DiagnosticAwareRoleInstances | 
      foreach {
          $roleinstance = $_
          write-host ""
          write-host -BackgroundColor DarkBlue -ForegroundColor White "Retrieving Diagnostic Settings for RoleInstance: " $roleinstance
 
          # Diagnostics Configuration for Logs
          $diagConfig = $RoleObject | Get-DiagnosticConfiguration -BufferName Logs -InstanceId $roleinstance
          write-host -BackgroundColor DarkGreen -ForegroundColor White "Windows Azure Logs - BufferQuota (MB): " $diagConfig.BufferQuotaInMB " LogLevel:" $diagConfig.ScheduledTransferLogLevelFilter " Scheduled Transfer to Storage: " $diagConfig.ScheduledTransferPeriod.ToString()
          write-host ""
 
          # Diagnostics Configuration for Diagnostic Infrastructure Logs
          $diagConfig = $RoleObject | Get-DiagnosticConfiguration -BufferName DiagnosticInfrastructureLogs -InstanceId $roleinstance
          write-host -BackgroundColor DarkGreen -ForegroundColor White "Diagnostic Infrastructure Logs - BufferQuota (MB): " $diagConfig.BufferQuotaInMB " LogLevel:" $diagConfig.ScheduledTransferLogLevelFilter " Scheduled Transfer to Storage: " $diagConfig.ScheduledTransferPeriod.ToString()
          write-host ""
 
          # Diagnostics Configuration for Performance Counters          
          $diagConfig = $RoleObject | Get-DiagnosticConfiguration -BufferName PerformanceCounters -InstanceId $roleinstance
          write-host -BackgroundColor DarkGreen -ForegroundColor White "Performance Counters - BufferQuota (MB): " $diagConfig.BufferQuotaInMB " Scheduled Transfer to Storage: " $diagConfig.ScheduledTransferPeriod.ToString()
          $diagConfig.DataSources | foreach {
            $CounterSpecifier = $_.CounterSpecifier
            $SampleRate = $_.SampleRate
            write-host "  Counter: " $CounterSpecifier " SampleRate: " $SampleRate
          }
          write-host ""
 
          # Diagnostics Configuration for Windows Event Logs          
          $diagConfig = $RoleObject | Get-DiagnosticConfiguration -BufferName WindowsEventLogs -InstanceId $roleinstance
          write-host -BackgroundColor DarkGreen -ForegroundColor White "Windows Event Logs - BufferQuota (MB): " $diagConfig.BufferQuotaInMB " LogLevel:" $diagConfig.ScheduledTransferLogLevelFilter  " Scheduled Transfer to Storage: " $diagConfig.ScheduledTransferPeriod.ToString()
          $diagConfig.DataSources | foreach {
            $logName = $_.ToString()
            write-host " Log Name: " $logName
          }
          write-host ""
 
          # Diagnostics Configuration for Directories          
          $diagConfig = $RoleObject | Get-DiagnosticConfiguration -BufferName Directories -InstanceId $roleinstance
          write-host -BackgroundColor DarkGreen -ForegroundColor White "Directories - BufferQuota (MB): " $diagConfig.BufferQuotaInMB " Scheduled Transfer to Storage: " $diagConfig.ScheduledTransferPeriod.ToString()
          $diagConfig.DataSources | foreach {
            $container = $_.Container
            $path = $_.Path
            write-host "  Path: " $path " Container: " $container " Quota (MB): " $diagConfig.BufferQuotaInMB 
          }
      }
    }
}

Usage

  GetDiagRoles | PrintDiagnosticSettings

Output Example

Windows Event Logs with Windows Azure Diagnostics and PowerShell

This is part 4 of a series

In this example I’m going to show you how you can easily configure Windows Azure Diagnostics to transfer over events from the Windows Event Log on your roles.

Just as in the other articles you will need to add the PowerShell Snapin (or module):

  Add-PsSnapin WAPPSCmdlets

Ditto, I have this handy initialization block and helper function GetDiagRoles:

Initialization and Helper Function

 
 $storageAccountName = "YourStorageAccountName" 
 $storageAccountKey = "YourStorageAccountKey" 
 $deploymentSlot = "Production" 
 $serviceName = "YourHostedService" 
 $subscriptionId = "YourSubscriptionId" 
 # Thumbprint for your cert goes below
 $mgmtCert = Get-Item cert:CurrentUserMyD7BECD4D63EBAF86023BB4F1A5FBF5C2C924902A 
 
 
 function GetDiagRoles { 
   Get-HostedService -ServiceName $serviceName -SubscriptionId $subscriptionId -Certificate $cert | ` 
   Get-Deployment -Slot $deploymentslot | ` 
   Get-DiagnosticAwareRoles -StorageAccountName $storageAccount -StorageAccountKey $storageKey 
 }

Once initialized, simple create an array of strings telling the diagnostics systems what event logs to capture.

(Tip: The datasources are actually XPath queries which can be filtered to a very granural level if needed: Example).

Configuring Windows Event Logs

  GetDiagRoles | foreach {
    $eventLogs = new-object string[] 2
    $eventLogs[0] = "Application!*"
    $eventLogs[1] = "System!*"
    $_ | Set-WAEventLog -EventLogs $eventLogs -loglevel Error -TransferPeriod 15
 
  }

How to retrieve the data? Once the diagnostic system has had time to transfer any Windows Event logs to storage it’s as simple as the following examples:

# Dump out all event logs in storage to the console
GetDiagRoles | Get-WAEventLog

# Dump all event logs in storage that 
# have faulting in the message to the console
GetdiagRoles | foreach { 
  $_ | Get-WAEventLog | Where { $_.Description -like "*faulting*" }
}

# Save all windows event logs to the file system (as .csv)
GetdiagRoles | foreach { 
  $FileName = "c:DiagData" + $_.RoleName + "eventlogs.csv"
  $_ | Get-WAEventLog -LocalPath $FileName
}

Of course there are -From and -To arguments for all of the Get-* diagnostic cmdlets so you can filter by certain time ranges etc.
A few other goodies we have added are the ability to clear your diagnostic settings (reset them to none) and also the ability to clean out your diagnostic storage.

# Clear all settings for the Windows Azure Log
GetDiagRoles | foreach {
  $_ | Set-WAEventLog -Clear
}

# Clear all data for the Windows Event Log
Clear-WAEventLog -StorageAccountKey $key -StorageAccountName $name

Windows Azure Diagnostics and PowerShell – Performance Counters

This is part 2 of a series.

With the introduction of Windows Azure PowerShell Cmdlets 2.0 we have added a lot of functionality around managing Windows Azure Diagnostics. This is a 2nd article in a series that covers various aspects of diagnostics and PowerShell. Click here to see the previous article on using tracing and the Windows Azure Log.

Just as in the other articles you will need to add the PowerShell Snapin (or module):

  Add-PsSnapin WAPPSCmdlets

Next I have a handy helper function called GetDiagRoles that I use for all of my diagnostic examples:

Initialization and Helper Function

  $storageAccountName = "YourStorageAccountName" 
  $storageAccountKey = "YourStorageAccountKey" 
  $deploymentSlot = "Production" 
  $serviceName = "YourHostedService" 
  $subscriptionId = "YourSubscriptionId" 
  # Thumbprint for your cert goes below 
  $mgmtCert = Get-Item cert:CurrentUserMyD7BECD4D63EBAF86023BB4F1A5FBF5C2C924902A 
 
  function GetDiagRoles { 
    Get-HostedService -ServiceName $serviceName -SubscriptionId $subscriptionId -Certificate $mgmtCert | ` 
        Get-Deployment -Slot $deploymentslot | ` 
        Get-DiagnosticAwareRoles -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey 
   }

I have another helper function I have written that basically creates a new PerformanceCounterConfiguration object. You will need an array of these to pass to the Set-PerformanceCounter cmdlet. The function takes the performance counter specifier (more on this shortly) and the sample rate in seconds for each counter.

Helper Function that Initializes a Counter Object

function CPC($specifier, $SampleRate) { 
   $perfCounter = New-Object Microsoft.WindowsAzure.Diagnostics.PerformanceCounterConfiguration 
   $perfCounter.CounterSpecifier = $specifier 
   $perfCounter.SampleRate = [TimeSpan]::FromSeconds($SampleRate) 
   return $perfCounter 
}

From there it is up to you to pass the performance counters you are interested in. I’ve written another function that wraps up a the functionality of creating a PowerShell array, populating it with the counters I am interested in and sets them for the diagnostic aware role I pass in from GetDiagRoles. Note: I’m also comparing the current role name to the name of one of my web roles so I’m only adding web related counters on instances that I care about. I retrieved the counter names by typing in: typeperf.exe /qx while logged into my Windows Azure roles via RDP. This way I can actually get counters specific to the machines in the service (and the processes such as RulesEngineService.exe (my sample NT service). Finally, it makes a call to the Set-PerformanceCounter cmdlet with the array of performance counters, and configures diagnostics to transfer these to Windows Azure Storage every 15 minutes.

Helper Function that Configures Counters for a Role

 function SetPerfmonCounters { 
    $sampleRate = 15 
    $counters = @() 
    $counters += CPC "Processor(_Total)% Processor Time" $sampleRate 
    $counters += CPC "MemoryAvailable MBytes" $sampleRate 
    $counters += CPC "PhysicalDisk(*)Current Disk Queue Length" $sampleRate 
    $counters += CPC "SystemContext Switches/sec" $sampleRate 
    # Process specific counters (retrieved via typeperf.exe /qx) 
    $counters += CPC "Process(RulesEngineService)% Processor Time" $sampleRate 
    $counters += CPC "Process(RulesEngineService)Private Bytes" $sampleRate 
    # $RoleName is populated from a call to GetDiagRoles in the next snippet. 
    if($RoleName -eq "SomeWebRole") { 
        $counters += CPC "W3SVC_W3WP(*)Requests / Sec" $sampleRate 
        $counters += CPC "ASP.NETRequests Queued" $sampleRate 
        $counters += CPC "ASP.NETError Events Raised" $sampleRate 
        $counters += CPC "ASP.NETRequest Wait Time" $sampleRate 
        # Process specific counters (retrieved via typeperf.exe /qx  
        $counters += CPC "Process(W3WP)% Processor Time" $sampleRate 
        $counters += CPC "Process(W3WP)Private Bytes" $sampleRate 
     } 
     $input | Set-PerformanceCounter -PerformanceCounters $counters -TransferPeriod 15 
}

Now linking all of this together to configure performance logging is pretty simple. In the snippet below I call GetDiagRoles which returns a collection of all of the diagnostic aware roles in my service. Which I then pipe individually to the SetPerfmonCounters function previously created.

Set Counters for each Role

  GetDiagRoles | foreach { 
       $_ | SetPerfmonCounters 
  }

Now I am successfully logging perfmon data and transferring it to storage. What’s next? Well analysis and clean up of course! To analyze the data we have added another cmdlet called Get-PerfmonLogs that downloads the data and optionally converts it to .blg for analysis. The snippet below creates a perfmon log foreach role in your service using the BLG format. Note the Get-PerfmonLog cmdlet also supports -From and -To (or -FromUTC or -ToUTC) so you can selectively download performance counter data.

Download Perfmon Logs for Each Role

   GetDiagRoles | foreach { 
     $Filename = "c:DiagData" + $_.RoleName + "perf.blg" 
     $_ | Get-PerfmonLog -LocalPath $Filename -Format BLG 
   }

Once the data is downloaded you can of course analyze it using Perfmon or utilize the Clear-PerfmonLogs to clean up the previously downloaded perfmon counters from Windows Azure Storage. Note all of the Clear-* diagnostic data cmdlets support a -From and -To parameter to allow you to manage what data to delete.

Analysis using Perfmon

Delete Perfmon Data from Storage for Each Role

     GetDiagRoles | foreach { 
     $_ | Clear-PerfmonLog -From "9/19/2011 6:00:00 AM" -To "9/19/2011 9:00:00 AM" 
}

Finally, one last example. If you ever have the need to completely clear out and reset your perfmon counters there is a -Clear switch that gives you this functionality.

Reset Perfmon Logs for Each Role

  GetDiagRoles | foreach { 
       $_ | Set-PerfmonLog -Clear 
  }

Getting Started with Windows Azure Diagnostics and PowerShell

This is part 1 of a series.

In my BUILD session Monitoring and Troubleshooting Windows Azure Applications I mention several code samples that make life much easier for implementing diagnostics with the Windows Azure PowerShell Cmdlets 2.0. This is the first in a series that walk you through configuring end-to-end diagnostics for your Windows Azure Application with PowerShell.

To get started with the Windows Azure PowerShell Cmdlets you will first need to add the WAPPSCmdlets snapin to your script:

Add-PsSnapin WAPPSCmdlets

After the snapin is loaded you will need to get access to the roles that you want to configure or retrieve diagnostic information about.

 
 $storageAccountName = "YourStorageAccountName" 
 $storageAccountKey = "YourStorageAccountKey" 
 $deploymentSlot = "Production" 
 $serviceName = "YourHostedService" 
 $subscriptionId = "YourSubscriptionId" 
 # Thumbprint for your cert goes below
 $mgmtCert = Get-Item cert:CurrentUserMyD7BECD4D63EBAF86023BB4F1A5FBF5C2C924902A 
 
 
 function GetDiagRoles { 
   Get-HostedService -ServiceName $serviceName -SubscriptionId $subscriptionId -Certificate $cert | ` 
   Get-Deployment -Slot $deploymentslot | ` 
   Get-DiagnosticAwareRoles -StorageAccountName $storageAccount -StorageAccountKey $storageKey 
 }

GetDiagRoles performs the following steps:
1) Retrieves your hosted service
2) Retrieves the correct deployment (staging or production)
3) Returns a collection of all of the roles that have diagnostics enabled.

For example the following code will print all of the role names that are returned:

  GetDiagRoles | foreach {
    write-host $_.RoleName 
  }


Note: The $_ operator basically means the “current” object in the collection.

Of course we want to configure diagnostics and not just print out role names.
The following example sets the diagnostic system to transfer any trace logs that have a loglevel of Error to storage every 15 minutes.

  GetDiagRoles | foreach {
    # Sets Windows Azure Diagnostics to transfer any trace messages from your code 
    # that are errors to storage over every 15 minutes. 
    $_ | Set-WindowsAzureLog -LogLevelFilter Error -TransferPeriod 15
  }

This functionality makes it extremely useful to instrument your code to capture errors or just trace execution of your code to look for logic errors.

[sourcecode language="CSharp"]

try
{
// something that could throw an exception
}
catch(Exception exc)
{
System.Diagnostics.Trace.TraceError(DateTime.Now + " " + exc.ToString());
}

How to retrieve the data? Once the diagnostic system has had time to transfer any trace logs to storage it's as simple as the following examples:

# Dump out all tracelogs in storage to the console
GetDiagRoles | Get-WindowsAzureLog

# Dump all tracelogs in storage that 
# have exception in the message to the console
GetDiagRoles | Get-WindowsAzureLog | `
	  Where { $_.Message -like "*exception*" }

# Save all trace logs to the file system (as .csv)
GetDiagRoles | foreach {
  $FileName = "c:DiagData" + $_.RoleName + "azurelogs.csv"
  $_ | Get-WindowsAzureLog -LocalPath $FileName
}

Of course there are -From and -To arguments for all of the Get-* diagnostic cmdlets so you can filter by certain time ranges etc.
A few other goodies we have added are the ability to clear your diagnostic settings (reset them to none) and also the ability to clean out your diagnostic storage.

# Clear all settings for the Windows Azure Log
GetDiagRoles | foreach {
  $_ | Set-WindowsAzureLog -Clear
}

# Clear all data for the Windows Azure Log
Clear-WindowsAzureLog -StorageAccountKey $key -StorageAccountName $name

Look for more posts from me on how to do more advanced Windows Azure diagnostics such as perfmon logs and file system logging.

Announcing the release of Windows Azure Platform PowerShell Cmdlets 2.0

Even while we are here at BUILD we are working hard to make deploying and managing your Windows Azure applications simpler. We have made some significant improvements to the Windows Azure Platform PowerShell Cmdlets and we are proud to announce we are releasing them today on CodePlex: http://wappowershell.codeplex.com/releases.

In this release we focused on the following scenarios:

  • Automation of Deployment Scenarios
  • Windows Azure Diagnostics Management
  • Consistency and Simpler Deployment

As part of making the cmdlets more consistent and easier to deploy we have renamed a few cmdlets and enhanced others with the intent of following PowerShell cmdlet design guidelines much closer. From a deployment perspective we have merged the Access Control Service PowerShell Cmdlets with the existing Windows Azure PowerShell Cmdlets to have both in a single installation.

In addition to those changes we have added quite a few new and powerful cmdlets in this release:

Hosted services, affinity groups and role instance management.
New-HostedService Creation of a new hosted service.
Remove-HostedService Removal of an existing hosted service.
Set-HostedService Update an existing hosted service properties.
Reset-RoleInstance Allows for the reset or reimage of role instances.
Get-RoleInstanceStatus Returns the status of role instances.
Get-RoleInstanceCount Returns the number of instances for a role.
New-AffinityGroup Creation of a new affinity group.
Remove-AffinityGroup Removal of an existing affinity group.
Update-AffinityGroup Updates an existing affinity group.
Automation of Sql Azure Deployments
New-SQLAzureServer Creation of a new Sql Azure server.
Remove-SqlAzureServer Removes an existing Sql Azure server.
Get-SqlAzureServer Returns an existing Sql Azure Server.
New-SqlAzureFirewallRule Adds a new Sql Azure firewall rule to a server.
Get-SqlAzureFirewallRules Returns the firewall rules for the specified Sql Azure server.
Remove-SqlAzureFirewallRule Removes an existing Sql Azure fireall rule.
Set-SqlAzurePassword Set/Reset the password for a Sql Azure server.
Windows Azure Diagnostics Management
Get-PerfmonLog Downloads the specified performance counters for a deployment and optionally converts them to perfmon format (.blg)
Clear-PerfmonLog Clears the performance counters for a deployment (or all deployments) from Windows Azure Storage.
Get-WindowsAzureLog Downloads the specified Windows Azure logs for a deployment.
Clear-WindowsAzureLog Clears the Windows Azure logs for a deployment (or all deployments) from Windows Azure Storage.
Get-WAEventLog Downloads the specified Windows Azure event logs for a deployment.
Clear-WAEventLog Clears the Windows Azure event logs for a deployment (or all deployments) from Windows Azure Storage.
Get-InfrastructureLog Downloads the specified diagnostic infrastructure logs for a deployment.
Clear-InfrastructureLog Clears the diagnostic infrastructure logs for a deployment (or all deployments) from Windows Azure Storage.
Windows Azure Storage
New-StorageAccount Creates a new storage account.
Remove-StorageAccount Removes an existing storage account.
Get-StorageAccount Returns all storage accounts under the specified subscription.
Get-Container Returns the blob containers for the specified account.
Clear-Container Clears the specified blob container(s) of its contents.
Save-Container Saves the contents of the specified blob container(s) to the local file system.
Get-StorageServicePropertiesForAnalytics Returns the current properties for storage analytics for the specified account.
Set-StorageServicePropertiesForAnalytics Sets the service analytics settings for a storage account.
Get-StorageAnalyticsLogs Saves to the file system storage analytic logs for the specified storage account.
Get-StorageAnalyticsMetrics Saves to the file system storage analytics metrics for the specified storage account.

Breaking Changes From 1.0 to 2.0

Previous Releases Version 2.0
Import-Module AcsManagementToolsSnapIn Import-Module WAPPSCmdlets
Add-PsSnapin AzureManagementToolsSnapIn Add-PsSnapin WAPPSCmdlets or Import-Module WAPPSCmdlets
Previous Releases Version 2.0
Set-WindowsEventLog Set-WAEventLog
Get-StorageProperties Get-StorageAccountProperties
Get-StorageServices Get-StorageAccount
Previous Releases Version 2.0
StorageServiceName StorageAccountName (See New-Deployment, Set-Deployment / Update-Deployment)


Updated Namespaces in the Cmdlets Solution

The namespaces in the cmdlets solution have undergone substantial change. While this should not typically affect any existing scripts, it should be taken into account in the rare event that classes in the cmdlets project are being instantiated directly.

Click Here To download the Windows Azure PowerShell Cmdlets

Make sure and take a look at the Readme.docx in the install folder (C:WindowsAzureWAPPSCmdletsdocs).

Expect more blog posts and code samples to follow!