Skip to main content

Create certificate for use with Azure PowerShell cmdlets

There are two ways to access your Azure subscription from PowerShell(PS). The first is to use Add-AzureAccount and subsequently be greeted with a login. The other way is to use Set-AzureSubscription and use certificates.

Below is the method of using certificates for more fluid scripts.

  1. Open visual studio command prompt as an administrator. This is located under your Visual Studio family of applications. 

  2. run this command (replacing <NameOfYourCert> with a name)
    makecert -sky exchange -r -n "CN=<NameOfYourCert>" -pe -a sha1 -len 2048 -ss My "<NameOfYourCert>.cer"
  3. Run certmr.msc by searching it on your start menu.
  4. Navigate to Personal -> Certificates and find your certificate. Right click your certificate and click 'Export...'
  5. Run through the wizard selecting all default options. Do not export your private key and save your certificate anywhere on your desktop
  6. Log into Azure go to Settings and Import your certificate

  7. Once uploaded you should see your management certificate appear and you will be able to run the PowerShell script below. You should be able to see the SubscriptionId and Thumbprint from the first screenshot from step 6.
    Set-AzureSubscription -SubscriptionId "<YourSubscriptionIdFromAzure>" -Certificate (Get-Item "Cert:\CurrentUser\my\$<YourCertificateThumbprint>") 


  1. The location of makecert for Visual Studio 2013: C:\Program Files (x86)\Windows Kits\8.1\bin\x64

  2. oh b.t.w. thanks Raph.. helped me out big time :)


Post a Comment

Popular posts from this blog

from zero to production in eighty days

When I mean zero, I literally mean zero. A brand new project, a PO that's new to IT, no existing processes in place and a small team of four including myself and the PO.

The departmental organisation we were working for doesn't have any developers, scrum masters, product owners working for them. Everything they did was either done by another department or outsourced completely.

This is a story how we went from zero to production in eighty days.

My first time speaking at a conference

Since time immemorial we humans have valued the art of public speaking. Today, I want to share with you my experiences in speaking at conferences for the first time. Recently, I spoke at both DDD Melbourne and DDD Perth. Both of which were positive experiences that I learnt a lot in.

Have You Ever Produced Negative Value in a System!?

As developers we encourage our product owners to order the priority of their backlog in order of value. However, every time a new feature is implemented by a development team, there is a certain degree of risk associated with the introduction of that new code. Namely, risk of breaking another part of the product and maintenance cost. When a development team pulls in a new feature to implement there is a certain acceptance of this risk. In many cases, the risks that arise due to additional code complexity doesn't justify the value added by the new feature itself, so the development team can start implementing it.

Are there scenarios where the value added to a software product can be negative though?