I seem to be having an issue with Azure self-signed certificates. I create a self signed certificate and upload it to the Azure management portal. I then use the Azure Managed API for C# to access the portal correctly. However, after 2 days my certificate gets invalidated and I need to create a new one.
My question is why does my completely valid certificate invalidate itself?
My Process is as follows:
Create certificate
makecert.exe -r -pe -n CN=MyComputerName-AzureCert -ss my -sr localmachine -eku 1.3.6.1.5.5.7.3.2 -len 2048 -e 01/01/2016 MyComputerName-AzureCert.cer
Upload certificate to management portal
Call Azure Rest Api from C# (Excerpt)
X509Certificate2 cert = new X509Certificate2(filePath); var credentials = CreateCredentialsFromCertification(subscriptionId, cert);
//...code omitted for brevity
CreateCloudServiceAsync(credentials, label, location, serviceName)
//Works!
Call Step 3 again a few days later
Response : ForbiddenError. The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.
Check Azure : Certificate still exists.
- Check Machine: Certificate still exists with expiration date of 2016
Does anyone have any idea what would cause this? Am I missing a step? Would I need to import my certificate into the machine? Why would it work and then stop?
Any input would be greatly appreciated :)