Windows Azure PowerShell Cmdlets In a Nutshell

Windows Azure PowerShell Cmdlets is a great tool to manage your Windows Azure services but if you are like me, you would wanna know where all the stuff is going. This post is all about it.
2013-04-26 05:05
Tugberk Ugurlu


Managing your Windows Azure services is super easy with the various management options and my favorite among these options is Windows Azure PowerShell Cmdlets. It's very well-documented and if you know PowerShell enough, Windows Azure PowerShell Cmdlets are really easy to grasp. In this post I would like to give a few details about this management option and hopefully, it'll give you a head start.

Install it and get going

Installation of the Windows Azure PowerShell Cmdlets is very easy. It's also well-documented. You can reach the download link from the "Downloads" section on Windows Azure web site. From there, all you need to do is follow the instructions to install the Cmdlets through Web Platform Installer.

After the installation, we can view that we have the Windows Azure PowerShell Cmdlets installed on our system by running "Get-Module -ListAvailable" command:

image

To get you started using Cmdlets, you can see the "Get Started with Windows Azure Cmdlets" article which explains how you will set up the trust between your machine and your Windows Azure account. However, I will cover some steps here as well.

First thing you need to do is download your publish settings file. There is a handy cmdlet to do this for you: Get-AzurePublishSettingsFile. By running this command, it will go to your account and create a management certificate for your account and download the necessary publish settings file.

Next step is to import this publish settings file through another handy cmdlet: Import-AzurePublishSettingsFile <publishsettings-file-path>. This command is actually setting up lots of stuff on your machine.

  • Under "%appdata%\Windows Azure Powershell", it creates necessary configuration files for the cmdlets to get the authentication information.

image

  • These configuration files don't actually contain certificate information on its own; they just hold the thumbprint of our management certificate and your subscription id.
  • Actual certificate is imported inside your certificate store. You can view the installed certificate by running "dir Cert:\CurrentUser\My" command.

image

Now you are ready to go. Run "Get-AzureSubscription" command to see your subscription details and you will see that it's set as your default subscription. So, from now on, you don't need to do anything with your subscription. You can just run the commands without worrying about your credentials (of course, this maybe a good or bad thing; depends on your situation). For example, I ran the Get-AzureVM command to view my VMs:

image

So, where is my stuff?

We installed the stuff and we just saw that it's working. So, where did all the stuff go and how does this thing even work? Well, if you know PowerShell, you also know that modules are stored under specific folders. You can view these folders by running the '$env:PSModulePath.split(';')' command:

image

Notice that there is a path for Windows Azure PowerShell Cmdlets, too. Without knowing this stuff, we could also view the module definition and get to its location from there:

Get-Module -ListAvailable -Name Azure

image

"C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure" directory is where you will find the real meat:

image

On the other hand, when we imported the publish settings, it puts a few stuff about my subscription under "%appdata%\Windows Azure Powershell". The certificate is also installed under my certificate store as mentioned before.

Clean Up

When you start managing your Windows Azure services through PowerShell Cmdlets, you have your Windows Azure account information and management certificate information at various places on your computer. Even if you uninstall your Windows Azure PowerShell Cmdlets from your machine, you are not basically cleaning up everything. Let's start by uninstalling the Cmdlets from your computer.

Simply go to Control Panel > Programs > Programs and Features and find the installed program named as Windows Azure PowerShell and uninstall it. You will be done.

image

Next step is to go to "%appdata%\Windows Azure Powershell" directory and delete the folder completely. One more step to go now: delete your certificate. Find out what the thumbprint of your certificate is:

image

Then, run the Remove-Item command to remove the certificate:

Remove-Item Cert:\CurrentUser\My\507DAAF6F285C4A72A45909ACCEE552B4E2AE916 –DeleteKey

You are all done uninstalling Windows Azure PowerShell Cmdlets. Remember, Windows Azure is powerful but it's more powerful when you manage it through PowerShell Smile

References

SignalR and Real-time Web Application Scenarios Webcast Recording (In Turkish) is Available

A few days ago, I presented on a webcast about ASP.NET SignalR and real-time web application scenarios in Turkish and its recording is now available.
2013-04-22 02:52
Tugberk Ugurlu


A few days ago, I presented on a webcast about ASP.NET SignalR and real-time web application scenarios in Turkish and it went pretty great I think. I also managed to record the webcast successfully and put it on Vimeo.

SignalR ve Realtime Web Uygulama Senaryoları from Tugberk Ugurlu on Vimeo.

Hope you'll like it Smile

Istanbul Part of Global Windows Azure Bootcamp Events

Global Windows Azure Bootcamp will be happening on the 27th of April, 2013 all over the World and Microsoft Istanbul office will also be hosting one of these events.
2013-04-19 15:28
Tugberk Ugurlu


Global Windows Azure Bootcamp will be happening on the 27th of April, 2013 all over the World and Istanbul will be also hosting one of these events. Global Windows Azure Bootcamp Istanbul will be held at Microsoft Istanbul office and the registration is open. You can register the event through Eventbrite.

azure

Daron Yondem, Ilkay Ilknur and myself will be presenting on several topics and you can view the list of sessions on the event registration page as well. See you there Smile

Links, Source Code and Slides From My Microsoft Web Camp Talks

Web Camp Istanbul was held at Microsoft Istanbul office yesterday and here are the links, source code and slides from my talks
2013-04-07 16:01
Tugberk Ugurlu


Within the Microsoft Web Camps Spring 2013 Tour, Web Camp Istanbul was held at Microsoft Istanbul office and we had such an incredible, enjoyable event. During the day, Jon Galloway, Umit Sunar and myself presented several topics including Windows Azure, ASP.NET MVC, ASP.NET Web API and ASP.NET SignalR.

During the day, I helped Jon by trying to be the dummy guy during his ASP.NET MVC presentation. I also presented on ASP.NET Web API and ASP.NET SignalR where I showed a few sample applications. You could find the source code for those samples on my GitHub repository: https://github.com/tugberkugurlu/IstanbulWebCamps201304.

You can also find the slides for the ASP.NET Web API session: ASP.NET Web API Intro - Microsoft Web Camp, Istanbul. Here are also some links for the stuff that I have mentioned during the sessions.

ASP.NET SignalR

ASP.NET Web API

I would like to thank Jon Galloway for coming to Istanbul for this event and allowing us to have such a fun day. I personally really enjoyed the whole event and also the small Istanbul tour I had with Jon Smile I also would like to thank Brady Gaster as he's one of the people who made this event happen. I'm hoping that we will keep seeing these types of web events in Istanbul more Smile

Basics of Git Rebase

Git Rebase is only one of the powerful features of git and it allows you to have a clean history in a highly branching workflow.
2013-03-30 18:18
Tugberk Ugurlu


You may wonder why the title starts with "Basics". The answer is simple: I know only the basics of git rebase :) It's only one of the powerful features of git and it allows you to have a clean history in a highly branching workflow. "Rebase" is quite powerful as mentioned and what I'm about to show you is only one of the reasons why to use rebase. I highly recommend Keith Dahlby's NDC talk which he took some time to show the rebase feature.

Let's see the easiest sample where rebase comes handy. We have the following history where we have two branches: master and feature-1.

image

Typically, what you would do here is to merge the feature-1 branch onto master which is fairly reasonable and it works. However, it creates you a unnecessary commit + a ridiculous graph which would be a mess if you think of hundreds of branches:

image

What you can do with rebase is to patch the feature-1 branch onto master. Later then, you can merge from there. The following command is what you need to run:

image

After running the rebase command, we can run "gitk –all" to see the graph:

image

It's now nice clean history. Notice that the master is still pointing where it was. It's because we haven't merge the feature-1 branch yet. Let's checkout to master branch and run "git merge feature-1" to merge feature-1 branch onto master branch:

image

Nicely done! Open up the gitk one more time and see the clean history:

image

After we remove the feature-1 branch by running "git branch –D feature-1", we won't have any trace from feature-1 branch which is absolutely OK as feature branches are just the implementation details, that's all.

image

Rebase can hurt

With git rebase, at the very basic level, you are messing with the history which can be dangerous depending on the case. On the other hand, when you have a collision, it's not a picnic to solve those collisions with interactive rebase without a deep firsthand knowledge but it's worth looking into even if it seems hard at the first glance Smile