Allow desktop interaction within Azure Cloud Service with third-party desktop app (automated via code)

Hello,
I am developing a wrapper service as Worker Role which will take request from Service Bus and automate a third-party desktop app to produce an output file and then upload result back to our web server.  The automation is accomplished with the app's
built-in .Net remoting based API.  This all works on my local development machine.  I am using code as below to start the desktop app.  In Azure:
If I am not logged on to RDP and run the app as SYSTEM (or whatever the default WorkerRole account is), it waits forever for the MainWindowHandle.
if I start the app manually in the RDP and try to get a reference to the running process (again as SYSTEM), I get Access Denied from WaitForInputIdle.
if I start the app from code as the RDP user (ProcessStartInfo assign user/pass), I get InvalidOperationException - the app might not have a graphical interface from the WaitForInputIdle.
Could anyone suggest the proper strategy for starting processes in a Worker Role that must create a window?
For reference, I only care about the window to the extent that I need to make sure it's there.  All other interaction with the process is via the .Net Remoting API.
private void GetOrStartThirdPartApp()
_process = Process.GetProcessesByName("ThirdPartApp").FirstOrDefault();
if (_process == null)
_process = new Process();
_process.StartInfo.Arguments = string.Format(@"-I ""{0}""", config.GetSetting("RolePath"));
_process.StartInfo.WorkingDirectory = config.GetSetting("WorkingFolder");
_process.StartInfo.FileName = config.GetSetting("ExecutablePath");
_process.StartInfo.LoadUserProfile = true;
_process.StartInfo.UseShellExecute = false;
if (config.GetSettingAsBoolean("StartThirdPartAppWithRunAs", false))
_process.StartInfo.UserName = "user";
var password = new SecureString();
foreach (var c in "thepassword".ToCharArray())
password.AppendChar(c);
_process.StartInfo.Password = password;
_process.Start();
while (_process.MainWindowHandle == IntPtr.Zero) Thread.Sleep(50);
_process.WaitForInputIdle();
_process.Exited += _process_Exited;

I'd keep the app with the UI and the queue reader in the same process and account - not a worker role.  On start up you launch the desktop application and the queue reader in the same account, one after another.
From what I've experienced, two users don't have the same
Window Stations, so you can't pass a window handle in a different logged-in account across that boundary.  Read the Window Station documentation - you may find something that helps.
You could use other techniques like sockets to communicate cross-process and cross-window station, too.
Darin R.

Similar Messages

  • Windows Azure Cloud Service with MVC4WebRole template giving "Not running in a hosted service or the Development Fabric." Error.

    Azure SDK used - 1.7 & 2.0
    When we create new project for Windows Azure Cloud Service with MVC4WebRole template & try to run it locally its giving error as "Not running in a hosted service or the Development Fabric."
    We are aware that making Azure project as start up project will resolve this error but we want to run the application locally before testing it with cloud.
    It’s not working with Cassini so we have tried with IIS but still it’s giving the same error.
    In another project when we added ASP.Net MVC4 Application & then for that project we have generated the Azure cloud service project using "Add Windows Azure Cloud Service Project". By this way debugging it locally works fine.
    Is there something additional settings present in Windows Azure Cloud Service with MVC4WebRole template which is causing this issue?

    hello,
    According your description, I try to reproduce it in my PC.
    >1. I create a could project and add a MVC4 web role into project.
    >2. I set the azure project as a start project and run, it works fine.
    >3. I change the MVC4 web role as a startup project and run, it works fine too. Of course before this, I exited the Azure Simulator.
    But this project was a empty project. It didn't included azure DLL file, such as Diagnostics file. So I think you could comment out the "system.diagnostics" node and try again. Also, you could refer to this same thread:http://stackoverflow.com/questions/13879443/not-running-in-a-hosted-service-or-the-development-fabric-production-not-debug
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • In azure cloud service with Location West Europe, why the IP address shows the server is locate in United States?

    We have 9 projects in azure cloud service, and all are use West Europe location, but with different subscription, and we found that one of those cloud service which its IP address is United
    States(Why?) and others are all in Amsterdam(this is correct)
    Can someone explain why? the server which it's ip located in United
    States is very slow, BTW i'm in Amsterdam.

    Hi LH,
    I have saw the same problem on Brazil. There has some comments about this issue, you can refer to it:
    Microsoft owns large ranges of IP addresses which are typically registered in Redmond, so usually Azure IP addresses around the world show up as being
    physically located in Redmond when using these types of tools.
    It's more or less an issue with the way our IP are registered. They all "belong" to Microsoft in the US and Brasil
    IP locator tools like whatismyip are sometimes incorrect. Some will give the real location, some will give the location of the ISP, etc …
    IP geo lookup tools typically rely on a static database of IP address range registrations.
    It's a Microsoft issue in the sense that we may publish the correct location for our datacenters
    (eg. Amsterdam should locate in Europe and not in Redmond…) – but it's also a 3rd party tools issue.
    If you want to be sure – use
    http://msdn.microsoft.com/en-us/library/windowsazure/dn175718.aspx 
     And you could also  see this blog about this issue :
    http://azure.microsoft.com/blog/2014/06/11/windows-azures-use-of-non-us-ipv4-address-space-in-us-regions/
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Help with third-party Atari App from AppStore

    Not sure anyone knows but I thought I'd take a stab at it. You download the Atari app for free, then you cam buy game packs. Example, one game pack includes Centipede, Millipede, etc... So, the games are awesome... Look great, made specifically for iPad.. So the sound in settings, they're not turned down... They're up. Sounds on each game show that they're up. Yet, when I play, no sound whatsoever! Can anyone help?known glitch perhaps?

    I'm an idiot. Kid moved the mute switch on side of iPad

  • Image preview not working with 3rd party photo apps in iPhoto/Image Capture

    I haven't had a problem until recently with the iPhone 4. Pictures taken with third party photo apps such as Shake It Photo or Hipstamatic no longer generate a thumbnail preview in either iPhoto or Image Capture. It's just a generic jpg icon. All pictures taken with Apple's camera app appear just fine. I also had a problem where I couldn't import any of the photos, but I restarted the phone a couple times and that seemed to fix the importing issue, but not the thumbnail preview issue. This is particularly weird because i've been importing pictures since the first day this phone came out, and it's only been doing this since yesterday.
    I know a lot of people are having problems getting their iPhoto to recognize the phone at all or that there are photos on the phone, but is anyone else having the same problem as me? Any solutions? I have iPhoto 8.1.2.
    Thanks!
    Message was edited by: Bud Inski

    I have this issue but didn't recognize it until I read your post. I thought it was 2 bad photos.
    I'll subscribe to this tread to see if anyone comes up with a fix.

  • Is there a way for converting WCF service into Azure Cloud Service without dealing with project files.

    Here is my situation.
    We provide Platform and SDK to other people where they can build WCF services and deploy that on site. We have a  many ISVs who has built wcf services, packaged them and ship them.
    Packaging consist of couple of manifest file and .dll file that make up wcf service. Now we want to go on cloud with our platform.
    Long story short - I have all the dlls for my wcf service but no project file.
    Is there a way to generate cloud service package from this dll files?

    Hi,
    You can't simply package your dlls and deploy it as a azure cloud service deployment package - you will need to have your project as well as service definition file which will define your role and instances.
    You can read more about packaging an Application by Using the CSPack Command-Line Tool here -http://msdn.microsoft.com/en-us/library/azure/gg433133.aspx
    another way to go to cloud platform is by making use of azure web sites, however you will still need your service files do deploy.
    If you have the dlls and the service files with you - then you can simply use the web site publish wizard and deploy to azure web site.
    Read more about it here - http://azure.microsoft.com/en-us/documentation/articles/web-sites-deploy/
    Bhushan | Blog |
    LinkedIn | Twitter

  • How to develop and deploy multiple worker roles in single azure cloud services?

    I am Manikandan, From Myeasydocs.com.
    We have developed our application as web projects.  Now we are going to move to azure cloud services, i have successfully migrated our application in cloud services and it worked fine. I am having difficulties with back ground task. i have nearly 12
    schedule tasks in our applications. I need assist on creating multiple worker role creation and deployment.
    Is there is any site on explaining the worker role process in details?
    Thanks in advance .. !!

    Hi,
    In Worker role, Applications hosted within worker roles can run asynchronous, long-running or perpetual tasks independent of user interaction or input. It is a service component that is useful for generalized development, and may perform background processing
    for a web role. A worker role is frequently used for long-running tasks that are non-interactive, but you can host any type of workload.
    I suggest you to follow the below article which explains about Creating and Deploying of Web Roles and Worker Roles in Azure Cloud Service using Visual Studio.
    https://msdn.microsoft.com/en-us/magazine/jj618299.aspx
    Hope this helps !
    Regards,
    Sowmya

  • Having trouble with creation of a cloud service with multiple virtual machines using java sdk.

    I am creating a cloud service on azure with 2 virtual machines using java sdk API. Service created successfully.
    My input endpoint details are as follows.
    INPUT ENDPOINTS
    Head : 191.238.144.47:2400
    Head : 191.238.144.47:22
    Node0 : 191.238.144.47:43211
    For Head instance port 2400 is for HTTPS and port 22 is for SSH and for Node0 instance port 43211 is for SSH.
    But I am having problem with doing a ssh on Head instance. Sometimes it works sometimes doesn't. Same problem with HTTPS also.
    I have some application running over there but when i try to access it thru browser sometimes it works but most of the time doesn't. When I restart the instances from azure portal, its works after
    that(not always but most of the time). 
    Now I am confused what is going on there. I am creating cloud service and virtual machines using java sdk and setting input endpoints also. After creation of all instances i restart every instance programmatically .
    I am not sure whether restart is required or not. It must be something to do with input endpoints only but not able to get the right thing i guess. When i do the same thing thru azure portal(creation of cloud service with virtual machines and setting up input
    end points) everything works fine but not achieving the result when implementing it by java sdk API. Please help me.

    HI Nithin,
    Thanks for your reply. I am setting the endpoints after creating my instances using update call. Here's the code snippet.
    AzureService aServ = new AzureService(session);
     if(aServ.checkNameAvailability(clusterName)) {
               aServ.createHostedService(clusterName, "dbX cluster");         
             // Creating head instance
             aServ.createHead(clusterName, imgName, headType, userName, pswd);  
            // Setting end points for head node
             String name = "ssh";
             int port = 22;
             aServ.updateVMInputEndpoint(clusterName, "Head", name, port);
             // Restarting head instance
             aServ.restartVM(clusterName, "Head");
           String roleName = "Node";
           String tmpRoleName = "";
           for(int i=0; i<noi; i++) {
                      port = 43210+(i+1);
                      tmpRoleName = roleName + i;
                   // Creating node instance
                    aServ.createVM(clusterName, tmpRoleName, imgName, nodeType, userName, pswd);
                  // Setting end points for node instance
                   aServ.updateVMInputEndpoint(clusterName, tmpRoleName, name, port);
                  // Restarting node instance
                 aServ.restartVM(clusterName, tmpRoleName);
          // Method to update the input endpoint details 
          public void updateVMInputEndpoint(String clusterName, String vmName, String name, int port)
            throws Exception {
                    VirtualMachineGetResponse resp = computeManagementClient.getVirtualMachinesOperations().
                                                            get(clusterName, clusterName, vmName);
                    VirtualMachineUpdateParameters updateParameters = new VirtualMachineUpdateParameters();
                    //get the configuration list
                    ArrayList<ConfigurationSet> configlist = resp.getConfigurationSets();
                    //get inputendpoint list and update it
                    ArrayList<InputEndpoint> endpointlist = configlist.get(0).getInputEndpoints();
                    InputEndpoint inputEndpoint = new InputEndpoint();
                    inputEndpoint.setEnableDirectServerReturn(false);
                    inputEndpoint.setPort(port);
                    inputEndpoint.setLocalPort(port);
                    inputEndpoint.setName(name);
                    inputEndpoint.setProtocol(InputEndpointTransportProtocol.TCP);
                    endpointlist.add(inputEndpoint);
                    // Open port for https on head node
                    if(vmName.equals("Head")) {
                            inputEndpoint = new InputEndpoint();
                            inputEndpoint.setEnableDirectServerReturn(false);
                            inputEndpoint.setPort(2400);
                            inputEndpoint.setLocalPort(2400);
                            inputEndpoint.setName("https");
                            inputEndpoint.setProtocol(InputEndpointTransportProtocol.TCP);
                            endpointlist.add(inputEndpoint);
                    updateParameters.setConfigurationSets(configlist);
                    //required for update
                    OSVirtualHardDisk osVirtualHardDisk = resp.getOSVirtualHardDisk();
                    updateParameters.setOSVirtualHardDisk(osVirtualHardDisk);
                    updateParameters.setRoleName(resp.getRoleName());
                    OperationResponse updtResp = computeManagementClient.getVirtualMachinesOperations().update(clusterName, clusterName, resp.getRoleName(), updateParameters);
    And every time i am creating a new cloud service along with head and node instances. Region is "South Central US".
    I am setting ProvisionGuestAgent field to true at instance creation time. Thank you.

  • "Failed to debug the Windows Azure Cloud Service project. The Output directory .... does not exist" - Looking for Solution Config Name Folder?

    Good evening,
    I've been working on and with a VS2013 Update 2 / Azure SDK 2.3 Cloud Service project for a while now and never had a problem debugging it (setting the .ccproj Project as Startup Project) but at the moment I cannot Debug it anymore - I always get the following
    error message:
    Failed to debug the Windows Azure Cloud Service project.  The output directory 'D:\Workspace\Development\Sources\AzureBackend\csx\Backend - Debug' does not exist.
    Now what's odd here, is the last part - the "Backend - Debug" is the Solution configuration name, ALL projects in that particular solution configuration are set to the Debug Configuration. The .ccproj file also only specifies Debug|Any CPU (and
    Release|Any CPU respectively) as its output folder(s). Why is the Solution config appearing up there?
    And more importantly.. why is this happening and what can I do?!
    Thanks,
    -Jörg
    Ps: there seems to be a related
    connect bug and these sorts of issues do appear around the forums but none contains a solution (neither reinstalling the Azure SDK nor cloaking the workspace/re-retrieving & building everything worked).

    Good morning Jambor,
    I already tried de-installing everything Azure-Tooling related including the Azure SDK, Restarting my machine and re-installing the SDK.
    Same result. I can build the .ccproj perfectly fine and the cspack file IS generated perfectly fine, only debugging does not work and there's NO information in the VS output window (again - all projects succeed to build).
    I tried explicitely running VS as Administrator, no change. I removed all IIS Express sites (as the ccproj has one web worker role), remapped my local TFS workspace.. nothing helped.
    As building works, deploying to Azure Cloud Service (manually and via Publish inside VS) all works -perfectly-, I am pretty sure this IS a bug and I'd LOVE to help to get this fixed. As I said, currently I cannot debug and/or run & test my work, hence
    I cannot do ANY work.

  • How integrate azure media services with blob storage?

    I need to upload lots of content over blob storage which contains different types of files.
    Now my problem is that files contains lots of videos also.
    I want to way by which i can integrate azure media services with blob storage so that i can stream that video.
    So probably i don't want to upload my videos on azure media services storage because i want all my content to be at one place which is blob storage.
    Is there any way to achieve this?
    Thanks,
    Rajesh Khunt
    Blog : http://programmersgeek.wordpress.com/
    Twitter : http://twitter.com/#!/r_rajeshkhunt
    Linkedin : http://in.linkedin.com/in/rajeshkhunt

    Hi Rajesh
    Every Media Services account needs a blob storage account associated with it. You can choose an existing blob storage account for that purpose. In order for Media Services to work with your videos you need to create an asset using the Media Services APIs.
    That call results in the creation of a container which has the name in the following format asset-<AssetId>. The actual video files need to go as blobs within this container but these files need to be known to Media Services and you can do so by adding
    AssetFiles to the asset using the Media Services APIs. Once you do that the asset is well known to Media Services and you can stream it.

  • Is it possible to do Continuous deployment for azure cloud services(website,web and worker roles) using VSO Release management?

    Hi,
    I am trying to do continuous deployment using visual studio online and release management for Azure cloud services. But not able to find the way to do it(with the help of different blogs, those are describing using VM only).
    I tried using Release management visual studio extension also. But no Luck.
    Please help me if it is possible to do continuous deployment using release management.
    Thanks,
    Phani

    Hi,
     Please refer to the following Forum Thread with similar question which has been answered. Let us know if this helps.
     https://social.msdn.microsoft.com/Forums/en-US/9d8322f6-36e5-4cca-a982-d420d34d2072/realease-management-deployment-to-azure-websites-webworker-roles?forum=tfsbuild
    Regards,
    Nithin Rathnakar

  • Is there a list of best practices for Azure Cloud Services?

    Hi all;
    I was talking with a Sql Server expert today and learned that Azure Sql Server can take up to a minute to respond to a query that normally takes a fraction of a second. This is one of those things where it's really valuable to learn it when architecting as
    opposed to when we go live.
    Cloud Services are not Sql Server (obviously) but that led to the question - Is there a list of best practices for Azure Cloud Services? If so, what are they?
    We will be placing the cloud services in multiple datacenters and using traffic manager to point people to the right one. The cloud service will set between an IMAP client & server, pretending to be the mail client to the server, and the server to the client.
    Mostly it will pass all requests & responses across from one to the other.
    thanks - dave
    What we did for the last 6 months -
    Made the world's coolest reporting & docgen system even more amazing

    hi dave,
    >>Cloud Services are not Sql Server (obviously) but that led to the question - Is there a list of best practices for Azure Cloud Services? If so, what are they?
    For this issue, I have collected some blogs and document about best practices for azure cloud service, you can view them, but I am not sure they are your need.
    http://msdn.microsoft.com/en-us/library/azure/xx130451.aspx
    http://gauravmantri.com/2013/01/11/some-best-practices-for-building-windows-azure-cloud-applications/
    http://www.hanselman.com/blog/CloudPowerHowToScaleAzureWebsitesGloballyWithTrafficManager.aspx
    http://msdn.microsoft.com/en-us/library/azure/jj717232.aspxhttp://azure.microsoft.com/en-us/documentation/articles/best-practices-performance/
    >>The cloud service will set between an IMAP client & server, pretending to be the mail client to the server, and the server to the client. Mostly it will pass all requests & responses across from one to the other.
    For your scenarioes, If you'd like to communicate with each instances, I recommend you refer to this document (
    http://msdn.microsoft.com/en-us/library/azure/hh180158.aspx ). And generally, if we want connect the client to server on Azure, the service bus is a good choice (http://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-multi-tier-app-using-service-bus-queues/
    If I misunderstood, please let me know.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Windows Azure Cloud Service Downtime alert

    Hi,
    One of the Cloud services that we have deployed on Windows Azure Cloud services using Azure Worker role is unexpectedly transitioning to Stopped state. There doesn't appear to be any valid reason behind this  and it runs normally after we switch to
    running state from portal. 
    Is it possible to develop some alert service which informs the Administrator or configured alert users that the Cloud service has shut down ? We tried to configure the Windows Azure alert but the metrics & logging doesn't seem to match with Cloud service
    downtime. Please let us know what is the diagnositics or logging option which we should make use to come up an optimal design for the Alert system.
    Thanks in advance,
    Deepesh
    Thanks & Regards, Deep

    Hi,
    From my experience, several operations in the Service Management API permit you to manage your cloud service either by referencing a deployment by its deployment name, or by referencing the deployment environment (staging or production) in
    which the deployment is running. Refer to
    http://msdn.microsoft.com/en-us/library/windowsazure/ee460812.aspx for more information about Operations on Cloud Services, we can do lots of things via this API, in “Get Cloud Service Properties” section, it has a “RoleInstanceList” property, refer to
    http://msdn.microsoft.com/en-us/library/windowsazure/ee460806.aspx#bk_roleinstancelist for more information about
     RoleInstanceList. In this article it has PersistentVMDowntime property, the detail information as following.
    PersistentVMDowntime
    Specifies information about when the Virtual Machine has been started and stopped.
    The PersistentVMDowntime element is only available using version 2012-03-01 or higher.
    Hope this helps, if this didn’t give you help, please feel free to let me know.
    Best Regards
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What are the differences between Azure(Cloud) Service Bus and On-Premises Service Bus (Windows Service Bus 1.0)?

    Hi,
    I want to know the exacts differences between Windows Azure(Cloud) Service Bus and On-Premises Service Bus (Windows Service Bus 1.0)
    Thanks
    mit

    Might ask them over here.
    http://social.technet.microsoft.com/Forums/en-us/home?category=biztalkserver
    http://social.msdn.microsoft.com/Forums/windowsazure/en-US/home?forum=windowsazuremanagement%2Cservbus%2Cazuremobile&filter=alltypes&sort=lastpostdesc
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Azure Cloud Services

    Hello i think Microsoft Azure Cloud Services is going to help many companies to manage more eficiently their business, but i dont like your PAY-AS-YOU-GO Subscritions i think you should provide certain basic services with commercial ads, and more advanced
    with a price.

    Filinto.  Thanks for your feedback here.
    I understand what you're asking for.  Let me check if you are aware of some of the other ways to pay for or consume Azure Services. 
    First of there are the 30 day free trials http://azure.microsoft.com/en-us/pricing/free-trial/
    second MSDN is another way to pay for and consume Azure services.
    We don't have any plans to have an advertisement-funded model for Azure SQL Database.
    Thanks Guy

Maybe you are looking for

  • Partial Goods Receipt for Inbound Delivery

    Hello Frends, We have a requirement to generate partial goods receipt against Inbound delivery created in Intercompany scenarios, however when we analzed there two alternative ways possible - 1.  Goods Receipt in Inbound Delivery - Transaction VL32N

  • Connect to wifi but not the Internet

    My iMac is connect to the wifi but not actually online, can anyone help?!

  • Course Type combination of Sequence, Alternate Group and Default in PP01

    Hi Guys, Need your help that we are facing currently. While linking Course type with Course program(Mandatory block),  we are facing  issue below- No sequence number visible on portal. Trainings are visible in Alternative section. After initial analy

  • Scopes / Color-Correction Question

    When I apply a color-correction effect - RGB Curves for instance - before I make a single adjustment the scopes jump to new values, as if I had made an adjustment. When I click the eyeball to turn the effect off the scopes all go back to their origin

  • Selecting an object that is behind another object

    Is there a keyboard command for selecting objects that are behind other objects in the stacking order? or is the only way to select them from layers menu? i'm always selecting the object that is on top of what I want to select, and wonder if there is