Disabling remote desktop does not remove endpoint that was previously created

Con risposta Disabling remote desktop does not remove endpoint that was previously created

  • Monday, December 12, 2011 12:02 AM
     
     

    I previously enabled remote desktop in my Azure project to allow me to debug in our staging environment. This added a 3rd endpoint on port 3389in addition to 80 and 443.

    I've finished debugging and disabled remote desktop in the publishing wizard then did another deployment to staging. I then tried to do a VIP swap with our production instance, but Azure admin console is throwing an error due to staging have 3 endpoints and production have 2 (you can't do a VIP swap between instances that have different # of endpoints).

    I've triple checked that in the publish wizard that I specific to have remote desktop disabled. The Azure admin console shows that port 80, 443 and 3389 are in the staging deployment. I've verified in the .csdef file that remote desktop is set to "false".

    How do I disable this endpoint? Am I missing a step to disable it?



    • Edited by TrevinChow Monday, December 12, 2011 12:34 AM
    •  

All Replies

  • Monday, December 12, 2011 1:19 AM
     
     

    When you enable remote desktop, it adds the port and a couple startup tasks to enable things. It also adds configuration settings, including one that specifies whether remote desktop should actually be enabled or not.

    When you disable RDP, I believe it leaves all that stuff there but sets the "enabled" config setting to "false."

    If you really want to undo all the changes, remote the RemoteAccess and RemoteForwarder modules in the <Import> tag in ServiceDefinition.csdef, and remove all the Microsoft.WindowsAzure.Plugins.Remote* config settings from ServiceConfiguration.*.cscfg (Local and Cloud). That will completely remove the endpoint.

  • Monday, December 12, 2011 1:25 AM
     
      Has Code

    Steve,

     

    We actually set all our config files to false for the RDP:

     

    .azurePubXml:

    <AzureEnableRemoteDesktop>False</AzureEnableRemoteDesktop>

    .csfcfg:

    <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="false" />

    .csdef:

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceDefinition name="mysite.App" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
    <WebRole name="www" vmsize="Small">
    <Sites>
    <Site name="Web">
        <VirtualApplication name="r" physicalDirectory="../ReviewPost/ReviewPost" />
        <Bindings>
            <Binding name="Endpoint1" endpointName="Endpoint1" />
            <Binding name="Endpoint2" endpointName="Endpoint2" />
        </Bindings>
    </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
      <InputEndpoint name="Endpoint2" protocol="https" port="443" certificate="STAR.mysite.com" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="RemoteAccess" />
      <Import moduleName="RemoteForwarder" />
    </Imports>
    <Certificates>
      <Certificate name="STAR.mysite.com" storeLocation="LocalMachine" storeName="My" />
    </Certificates>
    </WebRole>
    </ServiceDefinition>

    Given the above, what's missing?

  • Monday, December 12, 2011 2:02 AM
     
     Answered
    Looks like you forgot to remove the RemoteAccess and RemoteForwarder imports. Those are what add the the endpoints and the config settings. (After you remove those, you'll need to also remove all the corresponding config settings in *.cscfg.)
    • Marked As Answer by TrevinChow Monday, December 12, 2011 3:01 AM
    •  
  • Monday, December 12, 2011 2:10 AM
     
     

    Thanks, I just removed the imports and that fixed it.

    I'm surprised I have to edit the files manually and just un-checking the "enable remote desktop" option in the Azure publishing wizard in VS doesn't actually disable AND remove the endpoint.  IOW, why would the endpoint still need to remain if it's disabled?

  • Monday, December 12, 2011 2:26 AM
     
     

    I agree. Logically, there is:

    1. Add RDP (add the modules and config settings)
    2. Remove RDP (remove the modules and config settings)
    3. Enable RDP (set that config setting to "true")
    4. Disable RDP (set that config setting to "false")

    We've implemented two operations. "Enable remote desktop" is a combination of #1 and #3, and "Disable remote desktop" is #4. Nothing does #2, which is what you want. :)

    There is a good reason to just disable instead of removing... you can always re-enable by just clicking a checkbox in the portal instead of having to redeploy. But yes, there should be some way to undo the change that happens when you click "enable" for the first time.