diff --git a/Kudu.Services/Deployment/PushDeploymentController.cs b/Kudu.Services/Deployment/PushDeploymentController.cs index 7eebb039..f691f21c 100644 --- a/Kudu.Services/Deployment/PushDeploymentController.cs +++ b/Kudu.Services/Deployment/PushDeploymentController.cs @@ -406,6 +406,7 @@ public async Task OneDeploy( break; case ArtifactType.Zip: + SetRunFromZipDeploymentInfo(deploymentInfo); deploymentInfo.Fetch = LocalZipHandler; deploymentInfo.TargetSubDirectoryRelativePath = path; @@ -873,5 +874,26 @@ private ObjectResult StatusCode400(string message) { return StatusCode(StatusCodes.Status400BadRequest, message); } + + private void SetRunFromZipDeploymentInfo(ArtifactDeploymentInfo deploymentInfo) + { + if (deploymentInfo == null + || _settings == null) + { + return; + } + + if (_settings.RunFromLocalZip()) + { + // This is used if the deployment is Run-From-Zip + // the name of the deployed file in D:\home\data\SitePackages\{name}.zip is the + // timestamp in the format yyyMMddHHmmss. + deploymentInfo.ArtifactFileName = $"{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.zip"; + + // This is also for Run-From-Zip where we need to extract the triggers + // for post deployment sync triggers. + deploymentInfo.SyncFunctionsTriggersPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + } + } } } \ No newline at end of file