Here's what I tried so far:
1) Uploading console tools to the app using Kudu and running them. Well this is not possible because writing to registry is not permitted.
2) Uploading RemoteAgent using Kudu and running it. I'm getting:
No DNS entries exist for host xxx. No such host is known.
from the dotTrace UI when connecting to the URL printed in the Kudu console. The App srevice can only listen on ports 80 and 443.
3) Using dotTrace SDK and JetBrains.Profiler.Api looked promising. It doesn't want to attach the profiler on Azure though (as opposed to locally where it has no issues), with this code it hits the timeout exception.
private void AttachProfiler(ProfilingType profilingType)
{
var folder = AppDomain.CurrentDomain.BaseDirectory;
FileList = GetListFile(folder);
CurrentProfilingType = profilingType.ToString();
SelfAttach.Attach(new SaveSnapshotProfilingConfig
{
ProfilingControlKind = ProfilingControlKind.Api,
SaveDir = Path.Combine(folder, "Temp") ,
RedistDir = Path.Combine(folder, "_JetBrains.Profiler.SelfSdk.2019.1.3"),
ProfilingType = profilingType,
ListFile = FileList
});
SleepUntilAttachedOrTimedOut();
}
private static string GetListFile(string folder)
{
return Path.Combine(folder, "snapshot_list.xml");
}
private void SleepUntilAttachedOrTimedOut()
{
var totalMilliseconds = 0;
while (!CheckProfilerAttached())
{
var intervalMilliseconds = 250;
Thread.Sleep(intervalMilliseconds);
totalMilliseconds += intervalMilliseconds;
if (totalMilliseconds >= 60000)
{
throw new TimeoutException("Could not attach profiler. Timeout.");
}
}
}
private bool CheckProfilerAttached() => SelfAttach.State == SelfApiState.Active;
Currently impossible. Issue created here: https://youtrack.jetbrains.com/issue/PROF-921