How to create an user in azure portal with read only access to all resources in all subscription? - azure

I want to create an user in azure portal with read only access to all resources in all of my subscription.
This user should not be able to modify any thing in any of my available subscriptions.

Seems You are trying to add a user who should have read only access to all resources in all of your subscription beside This user should not be able to modify anything on the tenant.
So the best way is to add that user as Global Reader(Can read everything that a global administrator can, but not update anything.) Role
Which provides authority to access all resources in all of your
subscription but cannot modify anything among the available
subscriptions.
Hope this would help you.

This only covers Azure Active Directory resources. If you are trying to give read-only to Azure SUBSCRIPTION Resources, add the users to the Azure Role: "Readers".

The best recommendation here will be to add users with the reader permission to each subscription.

You would need to set your RBAC assignments per subscription. In case you have many subscriptions, you can automate this with a Logic App and doing requests to the Management API. Reference here. So on your logic app, you basically get a list of subscriptions, and then iterate them, and make the RBAC add assignment request for each of the subscriptions and for your given user(s).

Related

Self Remove Contributor access from all my Azure subscriptions

I have been assigned to a lot of Azure subscriptions as a contributor by our customers its more than 200. But I need to remove my contributor access and remove the attachment from their subscriptions. How can I self remove my access or is there any other way I can automate this task without asking the customers one by one?
Simple answer to your question is no, you can't.
By default Contributor role does not give access to granting/revoking permissions and role assignments. Because of this you can't remove yourself (or anybody else).
What you would need to do is contact owner in individual subscriptions and request them to remove yourself. You would also need to contact Azure AD administrators to remove from the Azure ADs associated with these Azure Subscriptions.

Divide Owner RBAC Role of Azure

I am trying to divide the Azure Owner RBAC role between IAM actions and Other Actions, is it possible if yes then please help.
I have tried to list out all the actions of all the Azure RBAC roles and tried to distinguish between IAM and Other actions but this is not a good practice i know, even i have tried to list out actions of Owner role which is "*". i have tried 100's of websites as well for the solutions but dint work for me
As mentioned in the comment, I think you can use the Contributor, compared to Owner, it can do anything as the Owner but not manage the access to resources(the AD related thing you said).
For the AD related thing of Owner, you could just check the NotActions of Contributor.
And if you want to divide the Owner's permissions in two, I think it does not make sense, because once your custom role has the permission to manage the access to resources, he can assign other roles(e.g. Owner) to anyone like himself.
So in your case, you could just assign the Owner to the user who should need the most permissions, assign the Contributor to the user that you don't want to give the permissions of AD related thing.
As far as I know, Azure RABC role is used to manage azure resource. Regarding how to manage actions in Azure AD, Azure provides other roles to control it. For more details, please refer to
https://learn.microsoft.com/en-us/azure/active-directory/users-groups-roles/directory-assign-admin-roles
https://learn.microsoft.com/en-us/azure/role-based-access-control/overview
https://learn.microsoft.com/en-us/azure/role-based-access-control/rbac-and-directory-admin-roles

Azure role that can't create resources

I want to find or create an azure role that has the same capabilities as an Owner, or at the very least a contributer. But this role should not have access to create azure resources.
I've been going through the pre-defined roles that exist.
this makes no sense in Azure RBAC context. you cant edit but not create resources, because this is being governed by the same permission: resource/write.
you can achieve something like that by having a role that can do anything except writes, but that would mean that it cannot edit resources, which is not what you are after, probably.
technically you can grant contributor permissions to each individual resource, that way user wont be able to create new resources, only modify existing ones (he would be able to delete resource).
I have the same requirements, and I managed to configure it by taking the Contributor role as base and adding
"Microsoft.Resources/*/write"
in notActions section of role JSON configuration.
What it does is that it prevents deployments. Every resource creation is a deployment.
As far as I have tested every "edit" operation on resources works, even deployment slot creation for Web Apps, but you can disable that too if you need.

Azure: limited access to external user

We have an azure subscription and keep some important resources (VMs, network interfaces, ...) there. A new engineer from an outsource company is joining us, he'll need to manage resources as part of his job (create/update/remove new VMs,...).
We'd like to organize access in such a way that we have full access to resources that he creates, he has full access to resources that he creates, but he has no access to resources that we create
Is it possible?
It is possible.
Azure Role-Based Access Control (RBAC) enables fine-grained access management for Azure. Using RBAC, you can grant only the amount of access that users need to perform their jobs. This article helps you get up and running with RBAC in the Azure portal.
If you want more details about how RBAC helps you manage access, see what is Role-Based-Access Control.
You can config RABC roles to manager it, also you can set permission to resource group, If you have not grant permission to new user, he can't find that resource.
More information about use RBAC to manage access to your Azure subscription resources, please refer to this article.
Hope this helps.
I was speaking with a Azure employee and they said this: You are able to assign roles on the account and some roles have access to specific things and some don't. https://learn.microsoft.com/en-us/azure/billing/billing-add-change-azure-subscription-administrator I hope that helps!

Application Authorization for Registering App and Creating Groups - Azure AD

I have a Java application running on premise in order to manage Azure app registrations and groups. For that purpose I registered an app and its service principle in Azure. I am using one of the samples under (https://github.com/Azure-Samples/aad-java-manage-users-groups-and-roles/). I am having trouble about giving right permissions to my app so that it can register other apps, create groups, assign them to groups and do client secret operations. I am receiving 403 unauthorized response. What are least possible Azure AD permissions for these operations? Which steps and options should I take/follow to implement that requirements in portal?
Thanks
UPDATE 1
Giving owner right is a big move. So that's not the answer I was looking for. That's why I am not marking it as a solution for my question but that would definitely work if you are willing to do that. Code also works.
Part of my question was least possible permissions. After experimenting I found that in app permissions:
Windows Azure Active Directory->Read Write Directory Data
Windows Azure Active Directory->Read Write All Applications
Microsoft Graph->Read Write Directory Data
Microsoft Graph->Read Write All Domains
Microsoft Graph->Read Write All Groups
solved the problem. Active Directory ones allowed me to create app and create group, graph ones allowed me to add app to group. Instead of Graph, adding app as User Access Admin also let me the app to group.
UPDATE 2
I am trying to repeat same process with another app. This time although I gave same permissions as I did in Update 1 this time adding new app to group fails with 403. Any idea how this really works? I am really confused...
You need create a service principal and give it Owner role to your subscription. You could check the code, the new created user is gived CONTRIBUTOR to your subscription. So, your sp need Owner role.
// Assign role to AD user, it needs `Owner` role.
RoleAssignment roleAssignment1 = authenticated.roleAssignments()
.define(raName1)
.forUser(user)
.withBuiltInRole(BuiltInRole.READER)
.withSubscriptionScope("3b4d41fa-e91d-4bc7-bc11-13d221b3b77d")
.create();
System.out.println("Created Role Assignment:");
You could do it on Azure Portal.
<your subscription>--><Access Control>--><Add>.
More information about this please refer to this official document.
Update:
I test in my lab, you don't need give your sp Graph permission, you only need give your sp your subscription Owner role. This is my test result.

Resources