Preeti Joshi
Preeti Joshi

Reputation: 989

How to send Azure Function logs to blob storage?

I have a working Azure Function and I added a few logs with log (Ilogger instance) and I can see them in the logs console in Azure Portal whenever I test the function or hit the function URL in via browser.

I want to send the same logs Azure Blob so I configured the,

Diagnostics Logs-> Application Logging (Blob) on -> Level Verbose -> Storage accounts settings set up to an existing storage account with container.

But I don't see my logs there. I see the folders generarted and logs written, but they are like just standard requests status messages like below:

2018-08-09T07:37:29,Information,TestFunction,cec757,636693970496377375,0,4860,6,Sending response: 200.0 OK,

What am I missing? I didn't see a way to add addAzureWebAppDiagnostics() call to ILoggerFactory. Please help!

Upvotes: 2

Views: 5766

Answers (1)

By default the function logs are stored in Tables if using the old storage logging option, you should be able to access your logs using storage explorer:

  1. Visit the Function Portal.

  2. Click on Function app settings-> Configure app settings

  3. Locate the value for the App setting key AzureWebJobsStorage.

  4. Extract the account AccountName and AccountKey values and provide them to Azure Storage Explorer

Your logs should be located in the table section. if that's the case, you can create a trigger function to move them to blobs if this is what you are trying to accomplish.

Upvotes: 1

Related Questions