RoleRoot returns false for WebRole because WebRole uses IIS like a regular website. Therefore, it is difficult to get environment variables from WebRole.
To get the path correctly, I had to use the classic version of Server.MapPath and refer to the bin folder instead of approot :
private string FooPathWebRole() { string appRoot = HttpContext.Current.Server.MapPath(@"~\"); return Path.Combine(appRoot + @"\", @"bin\file.foo"); }
For WorkerRole, nothing has changed:
private string FooPathWorkerRole() { string appRoot = Environment.GetEnvironmentVariable("RoleRoot"); return Path.Combine(appRoot + @"\", @"approot\file.foo"); }
In addition, I found out that Azure does not import p12 certificates. I would have to convert it to another format, which, in my opinion, would not work for me. So, the best option is to put them in the root application and mark it. Building an action on the Content .
source share