1
votes

Is there a way to tell which user uploaded the file in an azure blob container? do you have to manually add it to the metadata?

1
if you're using the account key to upload the file, then no. If you're using RBAC you may be able to find it in the activity logThiago Custodio

1 Answers

1
votes

The comment is basically correct, but the log is not in the Activity log , if you are using the storage account key to upload blob, you will not be able to know who uploaded the file. So in this way you could add it manually to the metadata as you mentioned.

If you upload blob via Azure AD auth e.g. use AAD auth flow to get the token, use the token to call REST API to upload blob(some other ways essentially use this), then you can use the Azure Storage analytics logging, follow this to configure it, select the Logging version with 2.0.

enter image description here

After configure, if you upload blob via AAD auth, you can find the log in the container named $log, in the log, there is a UserPrincipalName, it is the user.

enter image description here