Where is ADF IActivityLogger logger stored? - azure

I am currently Working on Azure Data Factory Pipeline.
I am putting _logger.write("My error content.") on my .net custom activity.
However, I cannot find where the log would be stored.
I looked on internet and could not figure out.

ADF logs are stored in adfjobs container in your Azure Storage account.
Each slice output is assigned an unique Run ID. You can find this ID in Azure portal when you click on slice details in your DataFactory Diagram or Monitor and Manage pane. This Run ID is also the name of the folder you're looking for in adfjobs container. In that folder, you have Logs and Runtime subfolders and in Logs, you will find both system logs and your user logs.

Related

Map Azure Blob Storage files to a custom activity in Azure Data Factory

I have a container with 100 binary files. Is there a way to run a custom activity (can be a .net program or, ideally, a container) for each one of these files using Azure Data Factory?
I created batch account in Azure portal
and created pool in batch account.
Image for reference:
I created pipeline in ADF and I created custom Activity using following details:
AzureBatch2:
Here AzureBlobStorage1 is blob storage linked service where bin files are there.
AzureBlobStorage1:
binaryfile:
Custom1 Settings:
I set command as
cmd
I started debug and it is running successfully.
Custom Activity created adfjobs folder in binaryfile storage account.
Image for reference:
It is working fine from my end kindly check from your end.

How to find who has deleted the file share folder from the storage account in azure

Some one has deleted the file share folder from the storage account in azure . It can be recovered as soft delete is enabled. But how to know that who has deleted the file?
It is possible to view operations within an Azure resource using Resource Logs. This is possible by Monitoring Azure Blob Storage which is a feature of Azure Monitor.
You would first start with creating a Diagnostic Setting- https://learn.microsoft.com/en-us/azure/storage/blobs/monitor-blob-storage?tabs=azure-portal#creating-a-diagnostic-setting
And then view logged activity by using a Log Analytics query or you can go the destination that you are forwarding the logs to as setup in the diagnostics setting and look for the respective API, example- "DeleteBlob" or "DeleteContainer" etc.,
However, if you have not already setup a diagnostic setting already and are forwarding data to a specific destination, it may not be possible to retrieve this information right now. Hope this helps!

Can we save azure functions logs to a file?

I know this might be a repeated question, but I am asking it again because I am not able to find any specific answer.
I am new to Azure functions. I have written an Azure functions in Java. I have a requirement to save the logs into files which will be Daily rolling log files (i.e. new log file should be created each day with the name %fileName%_ddmmyy)
When I use context.getLogger() , I am able to see the logs under Application Insights and Azure Monitor, but I cant find any option to save them into a log file. If I use Log4j, etc, I cannot see the logs under Application Insights and Azure Monitor.
I want to be able to see the logs under Application Insights and Azure Monitor as well as save them to log file which will rotate daily.
Is there any way using which I can achieve this scenario ? Any help would be appreciated.
PS : I need it in Java only. I am using java8.
AFAIK, you can export manually everyday Logs like below using export option in Logs section of function app or application insights logs:
Alternatively, you can use diagnostic setting of function and send logs to your Storage Account or else to Log Analytic workspace. This is an example workaround:
https://stackoverflow.com/a/73383532/17623802
Go to Function App Resource -> Find Diagnostic settings under Monitoring
Click on Add diagnostic setting
Give a name of your Diagnostic setting name
You can choose to export all logs and metrics or you can select from specific categories.
and then select Archive to storage account
Select the subscription and storage account
DONE.
For More info -> https://learn.microsoft.com/en-us/azure/azure-functions/functions-monitor-log-analytics?tabs=csharp
ALTERNATE
If above doesn't work then you can also create stream analytics jobs and dump the logs data in storage account.
https://learn.microsoft.com/en-us/azure/stream-analytics/app-insights-export-stream-analytics

Can we fetch custom logs in Azure OMS

Our Project is a Java Spring boot application, We have a logging system using log4j, Which we are pushing into the Azure Storage accounts.
Question:
I want to query these custom logs in OMS. (Is it possible)
If Yes how.
Till now what i have tried is.
1. Pushed the logs in Blob storage using Logback and container looks like
Pushed logs in table storage
And configured Storage accounts in log analytics in Azure workspace
But i am unable to see any Analytic data to query in OMS .
Please help.
If you can't use Application Insights, you can read logs files from Storage and use HTTP Data Collector API to push logs into Log Analytics workspace. Samples and reference: https://learn.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api

Where does Azure keeps non-vm logs? Can them be downloaded programmatically?

Azure keeps a bunch of VM (and cloud service) related logs in WAD* tables. The question is about actions which do not necessarily affect VMs. Say one deleted a Table Storage. Does Azure keep a log record about that? If yes, where? How to fetch them using a program/script?
The Service Management REST API can be used to retrieve the operation logs programmatically.
List Subscription Operations
https://msdn.microsoft.com/library/azure/gg715318.aspx

Resources