How to export logs at C:\home\data\jobs\continuous in Azure to a storage account

Kumar, Pratiyush (893) 20 Reputation points
2025-06-16T06:16:18.14+00:00

I have logs getting generated at C:\home\data\jobs\triggeredin Azure for a Web App service WebJob. How can i export these logs to an Azure storage account?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,991 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Harshitha Veeramalla 1,306 Reputation points Microsoft External Staff Moderator
    2025-06-16T11:26:56.57+00:00

    Hi @Kumar, Pratiyush,

    I am able to send the WebJob logs from App Service to Storage Account from Azure CLI.

    • You need Username and password from the publishing profile.

    Run the below command to get the Publish profile credentials.

    az webapp deployment list-publishing-profiles --name AppInsights2025 --resource-group RGName  --output json 
    
    • Next run this command by copying the UserName and Password from the above output.

    and get the Kudu VFS URL from the Web Job Web Hook properties

    User's image

    OR from the log file URL.

    User's image

    curl -u "UName:Pwd"   "https://appinsights2025****.scm.canadacentral-01.azurewebsites.net/vfs/data/jobs/continuous/DaaS/job_log.txt"   --output job_log.txt
    
    • Then, run the az storage blob upload command to upload file to Container.
    az storage blob upload  --account-name StorageAccName --container-name ContainerName --file job_log.txt   --name "webjoblogs /DaaS-log.txt"
    

    A folder with name webjoblogs and Daas prefix txt file will be created in the specified container.

    {8B0A99A3-0591-44E7-97A1-E6AA4B274AA5}

    download and check the logs.

    User's image

    As you want to automate this process(script), you can schedule a job in the Run book.Run only the below commands while scheduling.

    First command will get the latest file (at specified time).And the second command uploads the file to container.

    curl -u "UName:Pwd"   "https://appins***.scm.canadacentral-01.azurewebsites.net/vfs/data/jobs/continuous/DaaS/job_log.txt" --output job_log.txt
    
    az storage blob upload --account-name SAName --container-name ContainerName --file FilePath --name BlobName 
    

    Refer this MSDoc to schedule a Script in Run Book.

    Hope this helps


    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions, please reply back

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.