简体   繁体   中英

Publish Azure Web Role Without SSL Cert Fails

I have an azure web role project that for the production site has an ssl cert, let's call it https://www.myapp.com . I have no issues with publishing this and it works as expected.

However, for testing purposes, we have another site spun up that we don't need ssl on. It runs on the default azure site name, http://myapp-test.cloudapp.net . Ever since I added the cert for the production configuration, the test publish refuses to run, stating that the cert isn't added on the target Azure deployment. This makes sense, I haven't added the cert to the test site. However, trying to remove the test configuration for the certificate throws another error, as the csdef file has defined a certificate and not providing one in the test config prevents the publish.

How do I setup a configuration with the cert and one without the cert?

Below is my production configuration, with sensitive data removed.

<Role name="MyApp">
<Instances count="1" />
<ConfigurationSettings>
  <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="" />
  <Setting name="DataConnectionString" value="" />
  <Setting name="ServiceBusConnectionString" value="" />
  <Setting name="ENVIRONMENT" value="production" />
</ConfigurationSettings>
<Certificates>
  <Certificate name="MyAppSSL" thumbprint="thumbprint value" thumbprintAlgorithm="" />
</Certificates>

And the test configuration:

<Role name="MyApp">
<Instances count="1" />
<ConfigurationSettings>
  <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="data" />
  <Setting name="DataConnectionString" value="data" />
  <Setting name="ServiceBusConnectionString" value="" />
  <Setting name="ENVIRONMENT" value="staging" />
</ConfigurationSettings>
<!-- removing the certificate config prevents the publish from happening, but including it also prevents the publish since I don't have the cert on the test site-->

您可以只创建一个虚拟的自签名证书,然后将其上传到测试站点,然后使用该虚拟的证书指纹更新CSCFG。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM