Failed to grant "read" permissions to the Managed Instance - azure

I create an azure managed instance, I want to set one account to active directory admin ,But I cannot grant "read" permission to the MI like below screenshot

Obviously, you do not have an administrator role. You need to have your tenant administrator grant you the company administrator or global administrator
role.
Log in to Azure as a global administrator>Azure AD>users>select user>Assigned roles

Related

Cannot Restrict access to Azure AD administration portal

I am unable to select "Yes" on the Restrict access to Azure AD administration portal option for my Azure AD, even though I have the Global Administrator role. Every time I select yes and hit save I get an "insufficient privileges" message.
Ended up creating a new user and assigning the Global Administrator role to that user. The new user was then able to change the setting.

Azure AD - Can a Service Principal assign itself RBAC role in an Azure Subscription?

I have a Web API that is protected by Azure AD. I have created an app registration for the Web API that only allows users from that Azure AD to access the API (i.e. single tenant). This process also created a Service Principal in that tenant.
What I am wondering is if this Service Principal can self-assign itself RBAC role (any RBAC role for that matter) in an Azure Subscription that trusts this Azure AD? Or will this be a user-initiated action where a user with appropriate permission (like Owner or User Access Administrator) has to assign appropriate role to this Service Principal?
From whatever my understanding is, I believe it is latter (i.e. another user has to perform this operation). However it looks like it should be possible though.
The reason I say this is when I create a new Azure Subscription, I am automatically assigned an Owner role in that Azure Subscription (I am a Global Administrator in my Azure AD). I am wondering how that is accomplished.
If it is indeed possible, then what Azure AD role should be assigned to the Service Principal?
Any insights into this will be highly appreciated.
Of course it can, but the service principal also needs the Microsoft.Authorization/roleAssignments/write permission e.g. Owner or User Access Administrator to assign another RBAC role to itself.
If you mean the service principal has no RBAC role currently, then it can't, even if it is a Global admin in the tenant, it could not assign the RBAC role to itself directly.
Besides, the user account is different from a service principal, if a user is a global admin in the tenant, he can simply Elevate access to manage all Azure subscriptions and management groups for himself(this just works for the user, not service principal), then he will get the User Access Administrator role at the root scope, then he can assign any RBAC role to himself.
If your service principal is a global admin and wants to assign RBAC role to itself, you may need to assign the global admin role to another user account first, then elevate access to manage all Azure subscriptions, then use the user account to assign the RBAC role to the service principal.
You are correct that a principal can only grant itself permissions when it already has rights to do so. It would follow that a brand new MSI principal would not be a member of any groups or assigned any RBAC roles and therefore could not grant itself additional rights.
In the case of an Azure Subscription, the principal which creates the subscription either has permission to do so in an existing tenant or is creating a new tenant and subscription, and rights are granted by the system to the user as the creator/owner.
A possible approach to automate granting rights to new MSIs would be to use an Azure Function, calling the Microsoft Graph to query for new MSIs matching a search criteria, then grant the MSI principal the required permissions. The Function would have to have an MSI assigned which would need permission to grant the required rights to the new MSI at the desired scope.

"Insufficient privileges to complete the operation." in Azure

My situation is as follows: I want to create an Azure service principal. But when I try to do it with this command az ad sp create-for-rbac, I always get the error "Insufficient privileges to complete the operation."
Am I correct in assuming this appears because I was invited by a regular user to this subscription?
And in order to expand my privileges do I need to be assigned the administrator role in this subscription?
You're probably not a User Access Administrator since this is a role that needs to be set quite explicitly.
In the end, the reason is quite simple: you have "Insufficient privileges to complete the operation". You can read up on and try to Understand role definitions for Azure resources here.
az ad sp create-for-rbac requires permissions in the subscription / a resource group (Owner or User access administrator role to be specific), and in addition requires permissions in the linked Azure Active Directory to register applications (as the command creates an app registration).

azure permission to create "service principal"

Hello how are you? Im only owner of my organization subscription in Azure and I need to create service principals.
How can I give permission to my user? Or can I create a new role to assign this permission?
Any ideas?
Thanks in advance
Note: The roles of the subscription and the roles of Azure Active directory are different.
Im only owner of my organization subscription in Azure and I need to
create service principals.
You can follow this document: https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal
How can I give permission to my user? Or can I create a new role to assign this permission?
If I understand your issue correctly, you want to give the user permission to create service principals. If you are the admin of your Azure Active Directory, you can grant the user Application administrator role. Then the user will be able to create service principals. You can refer to this document.

Permissions required to run Remove-AzureRMAdGroup

I'm using an SPN to remove an Azure AD group (Remove-AzureRMAdGroup), but get the error insufficient privileges.
I granted the SPN the following permissions:
Active Directory Graph (2)
- Application Read and write all applications
- Application Read and write directory data
Microsoft Graph (1)
- Application Read and write groups
What permissions are apparently missing here? If we assign the SPN the Azure AD role UserAccountAdmin it works, but we'd prefer to have least privileged access.
Currently, the Read and write directory data permission does not include the ability to do any deletions such as deleting groups. What you need is microsoft.directory/groups/delete permission.
But there is no support today for custom roles in Azure Active Directory. Only the predefined Administrator Roles. You have to grant the SPN the Azure AD role User administrator role which include group deletion permission.
Here are the steps.

Resources