Question

I am trying to download website logs for a specific website using powershell:

Save-AzureWebsiteLog -Name website1 -output file.zip

It throws an error about the maximum message size quota, I have searched for an answer but all I can find is setting this on the server web.config - wouldn't this be a setting for the client, as it is the one making the request for the response?

save-azurewebsitelog : The maximum message size quota for incoming messages (65536) has been exceeded. To increase the
quota, use the MaxReceivedMessageSize property on the appropriate binding element.
At line:1 char:1
+ save-azurewebsitelog -name website1 -output file.zip
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Save-AzureWebsiteLog], CommunicationException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Websites.SaveAzureWebsiteLogCommand

I am asking if anyone knows how to set this MaxRecievedMessageSize to something higher than 65536 so that I can download my IIS logs.

Was it helpful?

Solution

  1. You can open an issue for this here: https://github.com/Azure/azure-powershell

  2. In the mean-while you can access your scm site and download your IIS logs from there by browsing to: https://{siteName}.scm.azurewebsites.net (provide your deployment credentials) and clicking on the Diagnostics dump link at the top.

    For more information on this scm site go here: http://blogs.msdn.com/b/windowsazure/archive/2014/03/04/windows-azure-websites-online-tools-you-should-know-about.aspx

OTHER TIPS

I made this script as a workaround:-

$username = "<enter git deployment username>"
$password = "<enter git deployment password>"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))
$apiUrl = "https://<website name>.scm.azurewebsites.net/api/zip/LogFiles/"
$response = Invoke-WebRequest -Uri $apiUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Method GET 
try
{
$filename = [System.IO.Path]::GetFileName($response.BaseResponse.ResponseUri.OriginalString)
$filepath = [System.IO.Path]::Combine("c:\asdf\", "http1.zip")
$filestream = [System.IO.File]::Create($filepath)
$response.RawContentStream.WriteTo($filestream)
}
finally
{
$filestream.Close()
}

This issue occurs when the log files exceed 65536, We will look at fixing this. in the meantime, please delete the OLD log files after downloading them, so you wont hit this issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top