Configure Azure Activity logs to stream to specified Storage account from all subscriptions

Kaushik Ray 0 Reputation points
2025-01-21T13:00:08.1766667+00:00

I want to send all Activity logs from all subscriptions (with in my Managment group) to a specific storage account. Do we have any Built in policy which can be enforced at management group and propagated to all subscriptions ?

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
956 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 25,856 Reputation points MVP
    2025-01-21T13:11:13.7066667+00:00

    Hi,

    There is no such built-in policy available but you can make copy of "Configure Azure Activity logs to stream to specified Log Analytics workspace" policy and there are a few things that you need to change:

    • parameter logAnalytics change it to storageAccountResourceId. Replace in the policy everywhere where it is referenced. Remove strongType from the parameter.
    • within the policy you can change the subscriptionToLa name to subscriptionToSa
    • Change property workspaceId to storageAccountId.
    • Change role definition from /providers/microsoft.authorization/roleDefinitions/92aaf0da-9dab-42b6-94a3-d43ce8d16293 to /providers/microsoft.authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab.

    I hope this helps you not only achieve this particular task but also in case you encounter other scenarios that may require modifying existing built-in policy.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

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