projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZipDeploy ARM Template fails with (500) Internal Server Error: The response for resource had empty or invalid content.

BBergquist opened this issue · comments

Repro steps.

  1. Create a template for a Linux web app
  2. Try to deploy a package via the ZipDeploy subresource.

The log/error given by the failure.

Status message from Deployment details:

{
    "status": "Failed",
    "error": {
        "code": "ResourceDeploymentFailure",
        "message": "The response for resource had empty or invalid content."
    }
}

Debug your Azure website remotely.

Subscription: 7e48...07fe
Site Name: MTE...eus

Mention any other details that might be useful.

From the Deployment details:
Request

{
    "content": {
        "properties": {
            "packageUri": "https://REDACTED.blob.core.windows.net/test/package.zip?sv=2019....",
            "AppOffline": "true"
        }
    }
}

Response

{
    "content": ""
}

When I look in the app logs, the deployment succeeds. It seems to just be an issue w/ the ARM integration.

@suwatch - it looks like you own the code?

protected override async Task<HttpResponseMessage> CreateDirectoryPutResponse(DirectoryInfoBase info, string localFilePath)

@BBergquist My apology I did not see the UTC time of the failure. If you used ARM template, do provide correlationId as well.

@sanchitmehta / @purva-vasudeo this is linux. BTW, Kudu in Linux used a slightly different codes/repos.

The failure is persistent, across multiple tenants. One timestamp of a failure for that web app was: 6/24/2021, 01:26:15 (UTC)

Hi @BBergquist , thanks for reporting this.

We have a fix for this in our upcoming release. As a workaround you can use a raw ARM request for zipdeploy. One way to do this is via ARMClient -

ARMClient.exe put "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.Web/sites/<SiteName>/extensions/ZipDeploy?api-version=2016-09-01"