Share via

How to create a custom policy that shows who create the resources on Azure

Cinthia Rodriguez 130 Reputation points
2024-10-11T20:27:31.9466667+00:00

Hello Everyone,

I would like to get your help regarding to know what could be a json structure to create a Azure policy that will allow me to identify who create the Azure resources on a subscription.

Thank you and help will be very helpfull.

Azure Policy
Azure Policy

An Azure service that is used to implement corporate governance and standards at scale for Azure resources.

0 comments No comments

Answer accepted by question author
  1. Marcin Policht 85,075 Reputation points MVP Volunteer Moderator
    2024-10-11T20:57:07.51+00:00

    You don't need a policy for this. This information is already recorded in the Activity Log. More at https://dotnet.territoriali.olinfo.it/en-us/azure/azure-monitor/essentials/activity-log-insights


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Rodolfo Urbano Rodrigues 0 Reputation points
    2026-04-08T20:17:08.81+00:00

    Hello everyone,

    I understand that Azure Activity Log already records who created a resource, and that when resources are provisioned via IaC, it is possible to automatically include a createdBy tag during deployment.

    However, I would like to know whether there is any way to achieve this automatically through Azure Policy for resources created directly from the Azure Portal or other web-based platform actions.

    My goal is to ensure that whenever a resource is created manually through the platform, a tag such as createdBy is automatically added and populated with the name or identity of the person who created it.

    I’m aware that Azure Policy can add or modify tags, but it does not seem to have access to the identity of the user who initiated the resource creation.

    Additionally, I’ve noticed that other cloud providers already offer this type of capability natively, automatically associating resource creation with user identity metadata.

    So my question is:

    Is it possible to use Azure Policy alone to automatically create a createdBy tag and populate it with the identity of the user who created the resource at creation time?

    If not, what would be the recommended approach to achieve this behavior for resources created outside IaC, while still keeping it automated and governance-friendly?

    Thank you.

    0 comments No comments

  2. Cinthia Rodriguez 130 Reputation points
    2024-10-15T17:22:40.54+00:00

    Hi @rootjohn how can I use the Azure Activity Logs with a policy that will create a tag as "createdby",there is a policy by default that allow to create tag for resources,as explained here https://dotnet.territoriali.olinfo.it/en-us/azure/azure-resource-manager/management/tag-policies but, I need help to know how to configure that policy for example with the Activity logs


  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Cinthia Rodriguez 130 Reputation points
    2024-10-12T02:19:26.33+00:00

    Hi , yes I am aware, but I still need a policy as that as customer require to have a Tag that shows , who create the resources on their subscription

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.