Thanks for reaching out to Microsoft Q&A.
To create an Azure policy that identifies who created resources within a subscription, you can use the ARM policy along with Activity Log insights, as there is no direct policy that tracks the resource creator. However, you can leverage resource tagging or utilize audit logs for tracking.
One approach is to implement a tagging policy that enforces resource owners to tag resources with their names or identities. Here's an example policy that checks if a resource is missing a specific tag (like Creator
), and if it is, the policy will require users to provide that tag.
Steps to Create and Assign Policy:
- Navigate to the Azure Portal and search for Policy.
- Select Definitions and then click + Policy definition.
- Create the JSON policy structure
- After creating the policy, go to Assignments and assign it to your subscription, specifying the enforcement scope.
Auditing Using Activity Logs:
You can also use Activity Logs to track who created a resource after the fact:
- Go to Activity Log under Monitor.
- Filter for "Create" operations to see who created resources and when.
Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.