Automatically add newly created subscriptions to Azure Auromation Managed Identity

Shekar Yenagandula 116 Reputation points

In Azure Automation, running task to enable soft delete across all subscription.
For running across subscriptions, I have to add all the subscriptions to the Identity with the permission.
Let's assume if we are creating new subscriptions it should be added automatically to the Identity.
I tried and it's seems like not possible through Azure Automation.
Any suggestions?
I have code to get all the subscriptions and add it to identity but I want to run it scheduled and In Azure environment if possible.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,159 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Roderick Bant 2,051 Reputation points

    The solution I tend to use is create a Management Group structure in Azure where you assign a role to the managed identity at the management group level and place the subscription in that management group, you will be able to manage the resources within the subscription without having to do a lot of individual role assignments.

    See the documentation on Management Groups for details.

  2. Maxim Sergeev 6,566 Reputation points Microsoft Employee

    HI there,

    You can't start managing the subscriptions by using Azure Automation without adding to them be managed by Azure Automation (which requires to have Managed Identity enabled).

    You can do this by using powershell, but outside of azure automation account, for example in Azure DevOps pipelines (but it will require to have at least a contributor role as well)

    0 comments No comments

  3. Luke Murray 10,611 Reputation points MVP