azure permission to create "service principal" - azure

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.

Related

Adding Users to the AAD Group via MS Graph

I am trying to add users to the AD Group via MS Graph API using application permission, and can't give GroupMamber.ReadwriteAll permission as this will allow app registration to add people to any group which is a security concern. My app registration is the owner of the AAD group.
Any help is much appreciated.
Thanks.
Please note that, to add users to the Azure AD Group via MS Graph API, you must have one of the below permissions as mentioned in this MsDoc.
Without having at least one of the above permissions, you cannot add users to the Azure AD group.
I assigned the app as owner of the group like below:
I tried to add users to the Azure AD group without granting any of the above permissions and got the error like below:
After granting the required permission, I was able to add the user to Azure AD group successfully like below:

Failed to grant "read" permissions to the Managed Instance

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

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).

Insufficient permissions to create Azure DevOps project while having Owner permission

After being invited to a client's Azure account and having "Owner" role + access to "Azure AD user, group, service principal" granted I am able create App Services, import source from Github but when I try to create a DevOps project to start actual work I get an error:
Following the link towards more details I can see that its about permission issue but if I re-check my permissions:
It says "Owner" but the scope is: "This resource" - note that these infos are under the single Subscription that my client created, however if I click my name for detailed view on my identity I see "Guest":
What would be the proper way to grant me global permissions on my clients Azure account?
Thanks!
If you create a project, it will automatically create an AD App named like organizationname-projectname-513f22f1-befd-xxxxxxcfe90f1 in the App Registerations in your tenant.
To fix the issue, let the global admin of your tenant to modify the user settings. Navigate to the Azure Active Directory in the portal -> User settings -> set Users can register applications to Yes.
Then in the Manage external collaboration settings, set the Guest users permission are limited to No.
Besides, if you can get an administrator role, no matter the settings are, you can create the app directly.

Resources