I needed to create a bunch of connection strings to use in my code. But this can be error prone and painful, especially if you have many data centers. In addition, you may decide to regenerate the primary storage key, in which case the whole nightmare would need to be repeated.
In my previous post, I illustrated how to provision a bunch of Azure storage accounts. So this post is a continuation from there to retrieve the primary storage keys. PowerShell syntax is really simple so it really doesn't require much explanation.
Figure 1: Powershell output showing my connection strings
Now I can just past into my app.config file for my Visual Studio project.
Figure 2: The Visual Studio solution that will use my connection string
Figure 3: Updated App.config file