سؤال

I am currently trying to upgrade our Azure Cloud Service (Web and Worker roles) to .Net 4.5 Framework. For this, we must change our Azure deployment from Windows Server 2008 to Windows Server 2012.

This requires us to change the OSFamily from "1" to "3" in our ServiceConfiguration file.

Current System

  • .Net 4.0
  • MVC3
  • EF 4.4
  • Azure Tools 1.6
  • Visual Studio 2010
  • Windows Server 2008

Upgraded System

  • .Net 4.5
  • MVC4
  • EF 5
  • Azure Tools 1.8
  • Visual Studio 2012
  • Windows Server 2012

I am running into a problem when we query the Azure Certificates to figure out if we are on "Production" or "Staging" environment.

The following lines of code find the certificates. Shortened for clarity.

// Open the certificate store for the current user.
            X509Store certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
            certStore.Open(OpenFlags.ReadOnly);

            foreach (var cert in certStore.Certificates)
            {
                OutputToFile.OutputDataReceived("Cert - " + cert.FriendlyName + " -- Thumb -- " + cert.Thumbprint);
            }

            // Find the certificate with the specified thumbprint.
            X509Certificate2Collection certCollection = certStore.Certificates.Find(
                                 X509FindType.FindByThumbprint,
                                 thumbPrint,
                                 false);

            // Close the certificate store.
            certStore.Close();

As you can see, I am printing the cert details to a log file to see where if breaks down. On OSFamily="1" (Windows Server 2008) this work perfectly. It finds the certificates.

However when I set OSFamily="3" (Windows Server 2012) the log file does not print the certificate details from the loop.

It also works fine locally.

Is this an issue with Windows Server 2012 or some issue with Azure deployments? Must I do an extra step with my certificates since moving to Windows Server 2012?

Any direction would be greatly appreciated.

هل كانت مفيدة؟

المحلول

I found the answer to my question here: Azure Autoscaling works locally but not when deployed

In OS Family 3, WaWorkerHost is running under “NETWORK SERVICE” account, this account doesn’t have private key access permission. So I needed to run the role with elevated permission.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top