Use TF in Azure to Assign Role to Managed Identity and Allow Role to Hit API Endpoints

I would like to use a managed Identity in Azure to grant API Auth from one application in an Azure tenant to an API in the same tenant.

These are the things I know how to do in TF:

  • Create a user-assigned managed identity
  • Assign the identity to the calling application

These are the things I don’t know how to do in TF:

  • Create a role for the API that grants access to the endpoints in my API (is there a predefined role I can use?)
  • Assign that role to the managed identity.

Thanks for any help you can provide.