Skip to content

Commit

Permalink
Add support for WEBSITE_RUN_FROM_PACKAGE {Azure#3497)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewc committed Sep 22, 2018
1 parent 08cb762 commit 4a33862
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/WebJobs.Script.WebHost/Models/HostAssignmentContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ public string ZipUrl
{
get
{
if (Environment.ContainsKey(EnvironmentSettingNames.AzureWebsiteAltZipDeployment))
if (Environment.ContainsKey(EnvironmentSettingNames.AzureWebsiteRunFromPackage))
{
return Environment[EnvironmentSettingNames.AzureWebsiteRunFromPackage];
}
else if (Environment.ContainsKey(EnvironmentSettingNames.AzureWebsiteAltZipDeployment))
{
return Environment[EnvironmentSettingNames.AzureWebsiteAltZipDeployment];
}
Expand Down
4 changes: 3 additions & 1 deletion src/WebJobs.Script/Environment/EnvironmentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public static bool IsRemoteDebuggingEnabled(this IEnvironment environment)

public static bool IsZipDeployment(this IEnvironment environment)
{
return !string.IsNullOrEmpty(environment.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteZipDeployment));
return !string.IsNullOrEmpty(environment.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteZipDeployment)) ||
!string.IsNullOrEmpty(environment.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteAltZipDeployment)) ||
!string.IsNullOrEmpty(environment.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteRunFromPackage));
}

public static bool FileSystemIsReadOnly(this IEnvironment environment)
Expand Down
8 changes: 6 additions & 2 deletions src/WebJobs.Script/Environment/EnvironmentSettingNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ public static class EnvironmentSettingNames
public const string AzureWebsiteOwnerName = "WEBSITE_OWNER_NAME";
public const string AzureWebsiteInstanceId = "WEBSITE_INSTANCE_ID";
public const string AzureWebsiteSku = "WEBSITE_SKU";
public const string AzureWebsiteZipDeployment = "WEBSITE_USE_ZIP";
public const string AzureWebsiteAltZipDeployment = "WEBSITE_RUN_FROM_ZIP";
public const string RemoteDebuggingPort = "REMOTEDEBUGGINGPORT";
public const string AzureWebsitePlaceholderMode = "WEBSITE_PLACEHOLDER_MODE";
public const string AzureWebsiteHomePath = "HOME";
Expand Down Expand Up @@ -40,5 +38,11 @@ public static class EnvironmentSettingNames

public const string ContainerStartContext = "CONTAINER_START_CONTEXT";
public const string ContainerStartContextSasUri = "CONTAINER_START_CONTEXT_SAS_URI";

// unfortunately there are 3 versions of this setting that have to be supported
// due to renames
public const string AzureWebsiteZipDeployment = "WEBSITE_USE_ZIP";
public const string AzureWebsiteAltZipDeployment = "WEBSITE_RUN_FROM_ZIP";
public const string AzureWebsiteRunFromPackage = "WEBSITE_RUN_FROM_PACKAGE";
}
}

0 comments on commit 4a33862

Please sign in to comment.