Skip to content

Commit

Permalink
Merge pull request #217 from Azure-App-Service/satishra/onedeploy-arm…
Browse files Browse the repository at this point in the history
…-payload-fix

Fixing GetArticfactURLFromARMJSON for onedeploy
  • Loading branch information
SatishRanjan authored Jul 7, 2021
2 parents 01c1887 + 2db412d commit eaea7b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Kudu.Services/Deployment/PushDeploymentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ private string GetArticfactURLFromARMJSON(JObject requestObject)
{
try
{
// ARM template should have properties field and a packageUri field inside the properties field.
string packageUri = requestObject.Value<JObject>("properties").Value<string>("packageUri");
// ARM template should have properties field and a packageUri field inside the properties field.
string packageUri = requestObject.Value<JObject>("properties") != null ? requestObject.Value<JObject>("properties").Value<string>("packageUri") : requestObject.Value<string>("packageUri");
if (string.IsNullOrEmpty(packageUri))
{
throw new ArgumentException("Invalid Url in the JSON request");
Expand Down Expand Up @@ -513,7 +513,7 @@ private async Task<IActionResult> PushDeployAsync(ArtifactDeploymentInfo deploym
FileSystemHelpers.RemoveUnixSymlink(nodeModulesSymlinkFile, TimeSpan.FromSeconds(5));
}
}
catch(Exception)
catch (Exception)
{
// best effort
}
Expand Down Expand Up @@ -767,10 +767,10 @@ private void ExtractTriggers(IRepository repository, ArtifactDeploymentInfo zipD
// takes 20 seconds to load. On my machine it takes 900 msec.
using (var zip = ZipFile.OpenRead(Path.Combine(_environment.SitePackagesPath, zipDeploymentInfo.ArtifactFileName)))
{
var entries = zip.Entries
// Only select host.json, proxies.json, or function.json that are from top level directories only
// Tested with a zip containing 120k files, and this took 90 msec
// on my machine.
var entries = zip.Entries
// Only select host.json, proxies.json, or function.json that are from top level directories only
// Tested with a zip containing 120k files, and this took 90 msec
// on my machine.
.Where(e =>
e.FullName.Equals(Constants.FunctionsHostConfigFile, StringComparison.OrdinalIgnoreCase) ||
e.FullName.Equals(Constants.ProxyConfigFile, StringComparison.OrdinalIgnoreCase) ||
Expand Down

0 comments on commit eaea7b9

Please sign in to comment.