I'm implementing a Cloud Service (worker role) application in Azure which can add private key files to Pageant from an Azure Local Storage. The p
variable is a Process
which starts cmd.exe
as well.
var filename = "pageant.exe";
var workerRoleStorageName = "PrivateKeys";
var privatekeyfilename = "ThePrivateKey.ppk";
var localResource = RoleEnvironment.GetLocalResource(workerRoleStorageName);
var path = Path.Combine(localResource.RootPath, privatekeyfilename);
p.StandardInput.WriteLine(filename + " "+ path);
I'm in local now, so the content of the path
variable is something like this:
c:\Users\Username\AppData\Local\dftmp\Resources\4691e8f6-fdbd-42ad-af67-986b491aca89\directory\PrivateKeys\ThePrivateKey.ppk
But at the last line of code I have got the following error message:
Couldn't load this key (unable to open file).
It's quite interesting, because if I set up a hard coded simple path it works fine:
var path = @"E:\PrivateKeys\ThePrivateKey.ppk";
I know that the Azure Local Storage folder is hidden in this case, so I tried to set the E:\PrivateKeys
folder to hidden, but it still worked with the hard coded path.
What do you think, why I can't add this file to Pageant from that path?