Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Calamari.AzureAppService
{
public class ZipPackageProvider : IPackageProvider
{
public string UploadUrlPath => @"/api/zipdeploy";
public string UploadUrlPath => @"/api/publish";
public bool SupportsAsynchronousDeployment => true;

public async Task<FileInfo> PackageArchive(string sourceDirectory, string targetDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Calamari.Common.Plumbing.Logging;
using Calamari.Common.Plumbing.Pipeline;
using Calamari.Common.Plumbing.Variables;
using Newtonsoft.Json;
using Octopus.CoreUtilities.Extensions;
using Polly;
using Polly.Timeout;
Expand Down Expand Up @@ -150,7 +151,7 @@ public async Task Execute(RunningDeployment context)
Log.Verbose($"Retrieving publishing profile for App Service to determine correct deployment endpoint.");
using var publishingProfileXmlStream = await armClient.GetPublishingProfileXmlWithSecrets(targetSite);
var publishingProfile = await PublishingProfile.ParseXml(publishingProfileXmlStream);

Log.Verbose($"Using deployment endpoint '{publishingProfile.PublishUrl}' from publishing profile.");

Log.Info($"Uploading package to {targetSite.SiteAndSlot}");
Expand Down Expand Up @@ -233,7 +234,7 @@ private async Task UploadZipAsync(IAzureAccount azureAccount,
{
await using var fileStream = new FileStream(uploadZipPath, FileMode.Open, FileAccess.Read, FileShare.Read);
using var streamContent = new StreamContent(fileStream);
streamContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
streamContent.Headers.ContentType = new MediaTypeHeaderValue("application/zip");

//we have to create a new request message each time
var request = new HttpRequestMessage(HttpMethod.Post, zipUploadUrl)
Expand Down Expand Up @@ -287,7 +288,7 @@ private async Task UploadZipAndPollAsync(IAzureAccount azureAccount,
if (!new FileInfo(uploadZipPath).Exists)
throw new FileNotFoundException(uploadZipPath);

var zipUploadUrl = $"{publishingProfile.PublishUrl}{packageProvider.UploadUrlPath}?isAsync=true";
var zipUploadUrl = $"{publishingProfile.PublishUrl}{packageProvider.UploadUrlPath}?remoteBuild=false&deployer=Octopus";
Log.Verbose($"Publishing {uploadZipPath} to {zipUploadUrl} and checking for deployment");

using var httpClient = new HttpClient(new HttpClientHandler
Expand All @@ -311,7 +312,7 @@ private async Task UploadZipAndPollAsync(IAzureAccount azureAccount,
//we have to create a new request message each time
await using var fileStream = new FileStream(uploadZipPath, FileMode.Open, FileAccess.Read, FileShare.Read);
using var streamContent = new StreamContent(fileStream);
streamContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
streamContent.Headers.ContentType = new MediaTypeHeaderValue("application/zip");

var uploadRequest = new HttpRequestMessage(HttpMethod.Post, zipUploadUrl)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.ResourceManager.AppService" Version="1.0.2" />
<PackageReference Include="Azure.ResourceManager.ResourceGraph" Version="1.0.1" />
<PackageReference Include="Azure.ResourceManager.AppService" Version="1.4.1" />
<PackageReference Include="Azure.ResourceManager.ResourceGraph" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha">
<PrivateAssets>all</PrivateAssets>
Expand Down