我構建了一個指向Windows Azure管理庫的Azure Web作業控制檯。 我試圖通過使用公共設置方法來驗證我的應用程序。Web作業中的Windows Azure管理庫認證錯誤
該程序在我的本地上正常工作,但在出現X509Certificates錯誤的Azure Web Jobs上失敗。
這是我爲web工作計劃所做的工作。
設置文件在控制檯應用程序,從設置文件創建通過複製粘貼&和subscriptionId證書字符串證書。
new CertificateCloudCredentials( subscriptionId, new 509Certificate2(Convert.FromBase64String(base64EncodedCertificate)));
部署&試圖在Azure上的Web作業 「按需運行」。
錯誤
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr) at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx) at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data) at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData)
異常而執行:
System.Security.Cryptography.CryptographicException, The system cannot find the file specified.
我解決了這個問題。我們可以自己製作* .pfx並在我們的webjob控制檯應用程序中使用它。 1. https://www.simple-talk.com/cloud/security-and-compliance/windows-azure-management-certificates/ –