We have an Azure Function app that is currently triggered using a blob trigger. Recently, a new requirement has come up where we need to obtain the user information or any identifier of the user who triggered the blob trigger by uploading a blob to the designated blob storage container.
The scenario we are dealing with involves two types of access methods:
AAD Authentication: When a user is logged in using Azure Active Directory (AAD) authentication and uploads a blob, we need to capture their user information or any identifier associated with their account. Access Key: On the other hand, if the user accesses the Azure Function using an access key directly, we do not need to capture any user information. Our goal is to enable user-specific tracking and logging of blob uploads when AAD authentication is used, but not when accessed via access keys.
Is there any way to achieve this functionality within Azure Functions? If so, how can we implement it? We are open to using any available Azure services or custom solutions to fulfill this requirement.
Thank you for your time and assistance!