Skip to content

Commit

Permalink
Enable functions detector deeplink
Browse files Browse the repository at this point in the history
  • Loading branch information
Michimune Kohno authored and sanchitmehta committed May 2, 2019
1 parent b405116 commit 30942e3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Kudu.Services.Web/Pages/Detectors/index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "";
var hostName = Environment.GetEnvironmentVariable("HTTP_HOST") ?? "";
var slotName = "";
var isFunctionApp = Environment.GetEnvironmentVariable("FUNCTIONS_WORKER_RUNTIME") != null;

var index = ownerName.IndexOf('+');
if (index >= 0)
Expand All @@ -15,13 +16,19 @@
}

string detectorPath;
if (Kudu.Core.Helpers.OSDetector.IsOnWindows())
string troubleshootExt = "";
if (isFunctionApp)
{
detectorPath = "diagnostics%2Favailability%2Fanalysis";
troubleshootExt = "appsvc.troubleshoot%3Dtrue%7C"; // "appsvc.troubleshoot=true|"
detectorPath = "diagnostics%2Ffunctionappdownanderrors"; // "diagnostics/functionappdownanderrors"
}
else if (Kudu.Core.Helpers.OSDetector.IsOnWindows())
{
detectorPath = "diagnostics%2Favailability%2Fanalysis"; // "diagnostics/availability/analysis"
}
else
{
detectorPath = "detectors%2FLinuxAppDown";
detectorPath = "detectors%2FLinuxAppDown"; // "detectors/LinuxAppDown"
}

var hostNameIndex = hostName.IndexOf('.');
Expand Down Expand Up @@ -50,7 +57,9 @@

var isSlot = !String.IsNullOrWhiteSpace(slotName) && !slotName.Equals("production", StringComparison.CurrentCultureIgnoreCase);

var detectorDeepLink = "https://portal.azure.com/?websitesextension_ext=asd.featurePath%3D"
var detectorDeepLink = "https://portal.azure.com/?websitesextension_ext="
+ troubleshootExt
+ "asd.featurePath%3D"
+ detectorPath
+ "#resource/subscriptions/" + subscriptionId
+ "/resourceGroups/" + resourceGroup
Expand Down

0 comments on commit 30942e3

Please sign in to comment.