Introducing Website Diagnostic cmdlets in Windows Azure PowerShell

Recently Windows Azure PowerShell has the support of diagnosing azure websites from command line. The experience is pretty smooth and straightforward, let’s get into it step by step:

Download and install Windows Azure PowerShell installer and open it. The article assumes you have already created free trial account.

Download your Windows Azure publish settings file and import it and yes, this’s the most painful thing you’ll do here I promise!



Create new website called wawsrocks


Now we have a website created, to make sure it works fine use Show-AzureWebsite cmdlet like this




To enable the diagnostics on file system just execute Enable-AzureWebsiteApplicationDiagnostic (woof what a long name!). Then you make sure it’s enabled using Get-AzureWebsite cmdlet


I’ve picked Verbose logging level among the available options: Information, Error, Verbose and Warning.

At this moment, I can start enjoy watching everything happening on the website by executing Get-AzureWebsiteLog –Tail cmdlet!


The logs are saved on the the file system of the website and besides that you can change the behavior to make the logs go to Windows Azure Storage Table just by executing these cmdlets


The New-AzureStorageAcccount creates a storage account that will have the logs in a table called WAWSAppLogTable. In the future releases Windows Azure PowerShell will support a cmdlet to query the log entries and filter them.

In case you want to break up with application logging on file, execute this cmdlet


If you are so angry :@%#$Q you can also remove the website and the storage account



The complete listing of the cmdlets used to make this sample is found in this gist.

At the end, I hope you have happy logging weekend!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s