3

I have a very strange issue:

I have an Azure Cloud Service with one Worker Role in it. In this Worker Role I would like to start a Command Line as an administrator with some arguments, which I store in the 'command' variable. It could be e.x. ipconfig as well.

using (var p = new Process())
{
    p.StartInfo.FileName = "cmd.exe";
    p.StartInfo.CreateNoWindow = false;
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.RedirectStandardInput = true;
    p.StartInfo.RedirectStandardError = true;
    p.StartInfo.Arguments = "cmd /K " + command;
    p.Start();
}

This scenario worked well until the beginning of this year, but now I had to implement some new features to the application, so I cloned the repository and opened the solution.

I recently upgraded my Azure SDK to 2.6, so I update my Cloud Service as well. Everything works fine in local, so I deployed it to staging environment.

But the Command Line Client doesn't open as I expected. I can't see a taskbar button/icon for the cmd and cannot see it at the Task Manager's Processes window. But, it appears at the details window. What happened, why couldn't I see the cmd window and the result inside it?

I know that the Guest OS version is updated as well, can it be a problem? I want to use the newest Azure SDK and of course the newest Guest OS.

I think it's related some UAC permissions, but I am not sure about it. So why I couldn't see now the opened cmd windows at rdp? Which could change at the architecture of the Worker Role?

EDIT

The newest version of Windows Server 2012 R2 is 4.19. The oldest version which I can use from the Family 4 is version 4.17, but using an older version doesn't solve my problem.

I would like to making Pageant automatically load keys on startup when a given message comes from the queue to the worker: http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter9.html#pageant-cmdline

Yes, I asked this question earlier and with the help of you I can solve the problem, but that solution isn't working now: Add private key file to Pageant from Azure local storage resource

I thinking that could it possible to solve this problem with Startup Scripts?

Community
  • 1
  • 1
Gábor Domonkos
  • 1,081
  • 1
  • 17
  • 33
  • From the docs `If you use the Start method in an ASP.NET Web page or server control, the new process executes on the Web server with restricted permissions.` https://msdn.microsoft.com/en-us/library/e8zac0ca(v=vs.110).aspx – Ken Brittain May 14 '15 at 11:35
  • Ken, it's irrelevant as he runs in a WorkerRole not Web Role it's not a Webpage or server control. – Panos May 14 '15 at 15:49
  • Can you try with different versions of the guest OS to see whether it is an issue with the 'newest' version? Also, what are you trying to achieve with the spawned process - can it be achieved in pure .Net? – Nick Heppleston May 15 '15 at 00:16
  • have you tried using a startup task? – yonisha Mar 11 '17 at 15:10

0 Answers0