Home > Windows Azure PowerShell > Introducing Website Diagnostic cmdlets in Windows Azure PowerShell

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!

image

 

Create new website called wawsrocks

image

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

image

 

image

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

image

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!

image

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

image

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

image

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

image

 

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!

About these ads
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,812 other followers

%d bloggers like this: