Reccomanded way to automate App Registration process via PowerShell?

Riccardo Tramontini 0 Reputation points
2024-05-16T10:04:26.0666667+00:00

Hi,

I am developing a PowerShell script that needs to automate the App Registration process in Azure, creating an Application that should be able to read EntraID Audit logs and interact with Azure services (with Reader role) via its service principal.

The application will be used to launch https://github.com/microsoft/ARI script on Azure Tenants and also to query LogAnalytics/Storage Accounts/Event Hubs to download relevant data logs.

I found following sources:

Is there a proper way to achive this using up to date modules/commands? My requirements are the following:

  • Minimal user input, ideally just providing admin credentials once at startup
  • App Registration creation and secret assignment
  • Assign application permissions (NOT delegated) to read EntraID Activity logs and Reader role for the Azure tenant
  • Grant admin consent via same PowerShell script if needed for EntraID Activity logs scope

Thanks and if I am somehow missing crucial understanding or approching the issue from a wrong point of view any advise is appriciated!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,486 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,675 questions
0 comments No comments
{count} votes

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.