首页 文章

无法从Azure网站创建新计划

提问于
浏览
0

我按照此处的教程设置Azure Scheduler:http://fabriccontroller.net/blog/posts/a-complete-overview-to-get-started-with-the-windows-azure-scheduler/

我想在Azure网站上运行我的应用程序,但它阻止我创建我的X509Certificate .

我找到了这篇文章:http://blog.tylerdoerksen.com/2013/08/23/pfx-certificate-files-and-windows-azure-websites/哪个指出了这个问题:

事实证明,当您加载证书时,系统将使用本地目录来存储密钥(??)密钥的默认位置是本地用户配置文件下,而Windows Azure网站则没有本地用户 Profiles 目录 . “

所以按照他的建议并添加以下标志:“X509KeyStorageFlags.MachineKeySet”我可以逃脱:

CryptographicException:系统找不到指定的文件

但我现在得到:

CryptographicException:访问被拒绝 .

是否真的无法使用AzureWebsite中的SDK?!如果我被迫使用WebRole而不是Azure网站,它会破坏Azure Scheduler的很多吸引力 .

在这个主题中:http://social.msdn.microsoft.com/Forums/windowsazure/en-US/cfe06e73-53e1-4030-b82d-53200be37647/load-privately-created-p12-cert-from-azureblob-and-have-it-be-trusted看起来好像他们在Azure网站上成功创建了一个X509Certificate,那么当我尝试时,我的不同之处就是抛出"Access Denied"?

1 回答

  • 2

    问题是在PublishSettings文件中使用ManagementCertificate字符串...我使用VisualStudio控制台在本地计算机上创建了自签名证书,并导出了'.cer'和'.pfx' .

    将自签名.cer上载到我的Azure /设置/管理证书中将.pfx与我的解决方案捆绑在一起并发布到Azure网站

    然后使用以下代码创建证书:

    var certificate = new X509Certificate2(
                HttpContext.Current.Server.MapPath("~/<filename>.pfx"), "<password>", X509KeyStorageFlags.MachineKeySet);
    

相关问题