Hello,
New to Go - first task I’m putting it to use for is to query for information from the older Azure ‘classic’ api, a.k.a Azure Service Management API.
MS made an SDK to use Go with azure:
I’ve successfully used it to call the ARM azure api (new/current model) but I have a need to hit the older classic api. I see the sdk supports this here:
^ thats shows several packages specifically for ‘classic’. The issue I’m having is that for ARM, I provide essentially what is an api id and key, which there are examples for as it’s the most common use, however for these classic packages I must use a certificate. I have the certificate which was made on windows (a .cer file which has public key and is uploaded to azure, and a .pfx file which contains the private key and is on my local machine). I can’t find examples anywhere on how I am supposed to actually use this certificate to authenticate to azure.
From the previous link I assume I start in this package:
which has a function with this signature:
func NewClient(subscriptionID string, managementCert []byte) (Client, error)
^ https://godoc.org/github.com/Azure/azure-sdk-for-go/services/classic/management#NewClient
I have no idea how to get from where I am now, having a pfx file, to correctly calling this function? I see it takes the cert as a byte slice, but I don’t know if the pfx is in the right format to begin with and/or how to get it into a byte slice?
Any help/guidance would be much appreciated.
Regards,
-djc