Hi Surjeet Singh,
Thank you for posting your query on Microsoft Q&A. I am Saiteja from Q&A will be assisting you with your query. I see @Fady Samy has provided you the summary of how service accounts are created and excluded from conditional access policy. I would like to add few more points additionally to it.
As per your query, I understand that you would like to create service accounts in Azure to access and manage resources.
To create service accounts there are two types of options:
- Service principles
- Managed identities
Service principle: You can register an application in Azure app registrations with relevant permissions and provide the consent to the application, then it becomes a service principle. You can provide the permissions based on which resource or feature it has to access. You can follow this link to configure an app and create a service principle.
Managed identities: Configuring managed identities have more benefits for accessing Azure resources, App services and many other services. Managed identities work as an automatic authentication in non-interactive sign in where you need Microsoft Entra authentication. There are two types of Managed identities those are system assigned
, and user assigned
. You can go through this link to learn more about types of managed identities. Please go through this document to find the services that supports managed identities.
If you would like to configure user assigned Managed identities, please go through this document:
If you would like to configure system assigned Managed identities, here is the document.
Once you configure these identities, you can assign the role for managed identities using this document. For service principles, you can follow this document.
Important Note: If you are using a service principal to assign roles, you might get the error "Insufficient privileges to complete the operation." This error is likely because Azure is attempting to look up the assignee identity in Microsoft Entra ID and the service principal cannot read Microsoft Entra ID by default. In this case, you need to grant the service principal permissions to read data in the directory. Alternatively, if you are using Azure CLI, you can create the role assignment by using the assignee object ID to skip the Microsoft Entra lookup.
Now you can go through this document, to understand how service accounts work in Microsoft Entra ID.
Once the identities have been created, you can configure conditional access policy to exclude service accounts from the policy using this document.
I hope this information is helpful. Please feel free to reach out if you have any further questions.
If the answer is helpful, please click "Accept Answer" and kindly "upvote it". If you have extra questions about this answer, please click "Comment"