Add a user to a resource group in Azure - azure

I have 2 subscriptions in Azure (subA and subB).
SubB has a lot of resource groups.
User John has access to subscriptions SubA and SubC.
I want to add user John to a resource group (resourceG_A) which belongs to subscriptions subB (that the user doesn't have). I want that John has access to perform some tasks in resourceG_A, such as start, stop VM. But this user sould not be able to see/access other VMs in other resource groups that belong to subscription subB.
What would be the better way to do it using the portal ?

you can grant your user permissions on the resource group (such as virtual machine contributor) that would make sure he can only control virtual machines inside the resource group only
using portal: https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal

Related

How to force user to access via pim in Azure

While creating access package or group, How can I force uses to get access (for any resources) via PIM in Azure?
While creating the group there is a option called "Azure AD roles can
be assigned to the group". What is this all about? If I say "Yes", its
showing up the "Roles".
I'm bit confused about the additional settings. Is this the setting to do this?
I don't know about access packages or access groups. But for my PIM setup I have Azure AD groups where users are added. And once they get access to the group they become eligible for requesting roles through PIM.
I have then a role in PIM, I make it eligible, and assign it to the group.
Users can open PIM, go to My Roles, and then activate the role.
Activating the role gives them permissions for one hour to access resources in a resource group. (This is all depending on what settings you put on the role in PIM). Outside of PIM they have no permissions whatsoever, so if they need access to resources they must request it via PIM.
PIM
Azure Resource
Change the default filter on Resource Type from Subscription to Resource Group or Resource if you want to assign permissions on smaller scopes
Do the things.

Service principal or Managed Identity

I have a client that can only give me full access to one or two resource groups.
I need to deliver some prescripted terraform resources that contain the need for a service principal.
Can you lock an SP to a resource group? The subscription itself is a production subscription so they want to know if you can tie down using role base access just to that group.
Or should I be create a MI account?
Can you lock an SP to a resource group?
You most certainly can. Azure Role-based access control is very granular and you can apply access control at any level (management group, subscription, resource group or even at individual resource).
Please see this for more details: https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-steps.

IAM or AD in azure

In azure cloud i want to create two users. Both the users will not able to watch , manage others resources like user1 created a VM and user2 also create another VM so user2 should not able to watch or start,stop, terminate user1 resources what ever resource user1 using. As a whole user can manage and view only his resources not others
You can create a resource group for each user.
Then give them Contributor role to their resource group.
They will then be able to only see/create/modify things in their resource group and nothing else.
So user 1 can't see user 2's resources and vice versa.
Though if they have roles at subscription-level then they will have those rights across all resource groups.
So if you don't want that, remove their subscription-level roles.

Azure Access Control for Resource Groups

I have a Subscription in my company that is shared for all members of the team (all employees).
We use this subscription for test, dev and also production workloads.
We have only one subscription because it is a sponsored subscription thanks to our MS partnership, so we don't want to create other subscriptions.
I want to restrict the access to a particular resource group that will host production resources where sensible data will be managed.
Because all members of the teams are contributor in the subscription level, they have access to all resource group and I can't remove them from the resource group.
So how can I proceed if I want to revoke their access to the resource group and allow them to use all other resource groups?
So how can I proceed if I want to revoke their access to the resource
group and allow them to use all other resource groups?
AFAIK, Only way to do so is remove the users role (Contributor) at the subscription level and assign them at each resource group (other than production resource group). If a user has a higher role (say Contributor) at subscription level, then you can't assign a lower role (say Reader) at resource group level.
Essentially with Azure RBAC, when you grant access at a parent scope, those permissions are inherited to the child scopes.
You can read more about Azure RBAC here: https://learn.microsoft.com/en-us/azure/role-based-access-control/overview#how-rbac-works.

Microsoft Azure: How to setup Contributor-role User Groups for separate Resource Groups?

I am trying to setup 2 separate Contributor-role user group for 2 separate Resource Groups in Microsoft Azure. In the new portal, I added 2 groups in the Contributor role. So after I created a new Azure website and its resource group, the 2 contributor user groups are automatically accessible to the new resource group, however, I want to only allow one group to be able to access that resource. I went in to the Resource Group blade and select the User group I don't want it to access, however, the 'Remove' button is disabled. So how can I remove the User group?
And also I realized that a member of the User Group is not able to see the resource assigned but if that member is added explicitly as a user(without a group), the user is then able to access the resource group. So my question is, is the Resource Group not supported for user group (yet)? In my case, should I create 2 separate active directory for the 2 different user groups?
It sounds like you've assigned your 2 groups to the Contributor role at the subscription level. If you want to remove access for one of those groups (or otherwise manage access at a more granular level than the subscription) you should go to your subscription, remove the group there (where it was assigned), and then individually add that same group to the Resource Groups that you want it to have access. Make sense?
Role assignments are supported for user groups.
My hypothesis for the user/group issue is that you may have recently added the user to the group. If you sign the user out and in again they might be able to get access.
Feel free to email me specifically on this issue as well.

Resources