How to get file size info after a download from a storage account

Gerardo Zago Stefanoni 20 Reputation points
2023-11-08T23:34:22.4766667+00:00

I've been able to set diagnostic settings for my storage account and I was able to get some information regarding the uploads/downloads of files. However what I need is a way to get the file size of those uploads/downloads. Currently I can get info regarding the name of the file, extention, time, if it was a download or an upload, the caller ip adress. Is there a way to get the file size as well?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,476 questions
Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,043 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,294 questions
0 comments No comments
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 14,571 Reputation points
    2023-11-09T06:25:48.5566667+00:00

    Gerardo Zago Stefanoni, Thank you for posting this question on Microsoft Q&A. Based on your question, I assume that you have enabled the diagnostic settings on Blob service and have all the logs flowing to Log Analytics. In this case, both upload and download operations have the content size information available as well and you may use the query like below:

    Upload

    StorageBlobLogs
    | where OperationName  == 'PutBlob'
    | project TimeGenerated, OperationName, CallerIpAddress, RequestBodySize
    

    //RequestBodySize contains size as the file/blob is being uploaded

    Download

    StorageBlobLogs
    | where OperationName  == 'GetBlob'
    | project TimeGenerated, OperationName, CallerIpAddress, ResponseBodySize
    

    //ResponseBodySize contains size as the file/blob is being downloaded.

    If the answer did not help, please add more context/follow-up question for it, and we will help you out. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful