From f59fb3acbdfb284e873446df0db15fba1fe6557b Mon Sep 17 00:00:00 2001 From: purva-vasudeo Date: Wed, 9 Jun 2021 18:39:26 -0700 Subject: [PATCH] Fix post-receive hook when migrating from dynamic to normal kudu in 2.2 --- Kudu.Services.Web/KuduWebUtil.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Kudu.Services.Web/KuduWebUtil.cs b/Kudu.Services.Web/KuduWebUtil.cs index 75879d12..cf58d04f 100644 --- a/Kudu.Services.Web/KuduWebUtil.cs +++ b/Kudu.Services.Web/KuduWebUtil.cs @@ -230,6 +230,10 @@ internal static void MigrateToNetCorePatch(IEnvironment environment) { FileSystemHelpers.WriteAllText(gitPostReceiveHookFile, fileText.Replace("dotnet", "benv dotnet=2.2 dotnet")); } + else if(!fileText.Contains("dotnet") && fileText.Contains("$KUDU_EXE") && isRunningOnAzure) + { + FileSystemHelpers.WriteAllText(gitPostReceiveHookFile, fileText.Replace("$KUDU_EXE", "benv dotnet=2.2 dotnet $KUDU_EXE")); + } } else {