问题
Using "package" option in VS2017, packaged "classic" cloud service with options set for remote desktop. Created cert within dialog and all went well, uploaded service to Azure; unable to enable RDP however. Cert is not visible within certificates blade nor in the "enable remote desktop" blade, and cannot (obviously) RDP.
Also tried enabling per documentation (here) using Encryption Certificate for Extensions but cert is not listed (in fact, nothing listed).
Just need to get to a log file to understand something that used to work and I'm about to demo!!
回答1:
I was finally able to get this working. Here is the magic incantation which as far as I can tell is not documented fully anywhere.
Step 1. Run "package" on the Azure solution.
Step 2. From the dialog, select "Enable remote desktop for all roles," then select "Settings". Create a new certificate and make sure to give it a user-friendly name, like "RDP1". Do NOT deploy at this point.
Step 3. Run mmc, make sure you have the "Certificates" snap-in loaded. (File | Add/Remove Snapin". Go to Certificates | Local Computer and find the cert you just created ("RDP1").
Step 4. Export the cert to a pfx file, that is, making sure you include the private key. Remember the folder you exported to.
Step 5. In the Azure portal, in your Cloud Service section, click on "Certificates".
Step 6. Make sure there are NO OTHER certs loaded. Upload your newly created cert. Azure will get confused as to which cert to use if there are more than one loaded.
Step 7. Go to the remote desktop blade and click on "Enabled". You see now why you only want one cert loaded -- the dropdown only lists "CN=Azure Tools" (which they all are) and not the friendly name. (Why? would be an excellent question to ask, but we won't go there.) Use the same login credentials you used to create the cert way back in Step 2 (remember that?). Make sure to "Save" which can take minutes (again, "Why?" would be appropriate here.)
Step 7. Upload and deploy your cloud service.
Step 8. Click on the web role or worker role in the "Overview" blade (pick the instance you're interested in). In the new blade you'll see a "Connect" button. Click it and it will download an RDP file which if you simply double-click will launch Remote Desktop on your machine.
This worked for me. Your mileage may vary.
来源:https://stackoverflow.com/questions/48512407/azure-classic-cloud-service-cannot-rdp