0
votes

I have enabled logging for my Azure Blob Storage account per Microsoft Documentation (link below), but the $logs container where this data is stored doesn't seem to be visible on the Azure Portal. However, I can see it from Azure Storage Explorer desktop application. I've tried looking for some sort of setting that would allow me to see it in the standard portal, but no luck. Is this not possible? Thank you

1

1 Answers

0
votes

The diagnostics logs are saved in a blob container named $logs in your storage account. You can view the log data using a storage explorer like the Microsoft Storage Explorer, or programmatically using the storage client library or PowerShell.

The following PowerShell snippet is an example of filtering the list of log blobs by name to specify a time, and by metadata to identify just those logs that contain write operations.

Get-AzureStorageBlob -Container '$logs' |  
Where-Object {  
    $_.Name -match 'table/2014/05/21/05' -and   
    $_.ICloudBlob.Metadata.LogType -match 'write'  
} |  
ForEach-Object {  
    "{0}  {1}  {2}  {3}" –f $_.Name,   
    $_.ICloudBlob.Metadata.StartTime,   
    $_.ICloudBlob.Metadata.EndTime,   
    $_.ICloudBlob.Metadata.LogType  
}

The following is a sample URI that can be used to access the log:

https://<accountname>.blob.core.windows.net/$logs/blob/2011/07/31/1800/000001.log

For information about listing blobs programmatically, please refer to this article.