Accessing classic resources in multiple subscriptions using AzureClassicRunAsAccount - azure

I want to access Classic Azure resources present in Multiple subscriptions in my Azure powershell Runbook, I use AzureClassicRunAsAccount For accessing the resources in my subscription. For ARM resources which use AzureRunAsAccount I understand a spn is created and giving access to the spn on a different subscription will let the runbook access it. But how do I do the same for ClassicRunAsAccount, this doesn't have an Spn created right ?

Related

Azure RBAC Custom Roles

I am currently trying to work out a concept for a roles and rights concept. Azure RBAC already has a few built-in roles but I am trying to create a few more custom roles. Are custom roles directly linked to the RBAC? And does anyone have any suggestions which roles I should definitely add? I'm not familiar with all applications in Azure at the moment since i have only been working with azure for a few weeks, so I would appreciate some suggestions. I am also trying to understand the hierarchy and structure behind Azure RBAC.
If anyone has worked out such a concept themselves or works a lot with azure rbac, feel free to share your experiences or results!
Azure role-based access control (Azure RBAC) helps manage who has access to Azure resources, what they can do with those resources, and what areas they have access to.
Azure RBAC is an authorization system built on Azure Resource Manager that provides fine-grained access management of Azure resources.
Create your own custom roles. Just like built-in roles, assign custom roles to users, groups, and service principals at management group (in preview only), subscription, and resource group scopes.
Custom roles can be shared between subscriptions that trust the same Azure AD directory. There is a limit of 5,000 custom roles per directory. Custom roles can be created using the Azure portal, Azure PowerShell, Azure CLI, or the REST API.

Can we assign Azure Blueprint to a resource or a resource group

We may assign Roles, Policies, ARM templates and Resource groups to users via Azure Blueprints during deployments at organization's scope or to one or more subscriptions. But can we do the vice-versa. I mean can a VNET or VM be assigned to interact with some other user via Azure Blueprints.
This is a deployment question raised by my management. We currently are searching for an answer.
Each Published Version of an Azure Blueprint can be assigned only to an existing management group or subscription.
For more information read here.

How to run one Azure Automation runbook for all subscriptions in same tenant?

How can we run one Azure Automation runbook for all our subscriptions in the same tenant? Currently, I am making use of one runbook which retrieves the resources in the tenant, but it is listing the resources only from one subscription whereas I have 3 subscriptions present.
How do I make sure it outputs all the resources from all subscriptions? Please help
The problem is that the runbook runs in the security context of an Azure automation account and that account is connected to a subscription and therefore only sees resources within that subscription.
https://learn.microsoft.com/en-us/azure/automation/automation-create-standalone-account
There is a "Azure management group" which works cross subscription
https://learn.microsoft.com/en-us/azure/governance/management-groups/overview
It may be possible to run the runbook in a context of a management group user that has access to all subscriptions. But I have never tried this so not sure if it would work.
I would suggest that you install and run the runbook in each subscription. Then combine the contents of each report.

Azure Subscription Policies

I would need to create a policy in subscription level contributor cannot able to create virtual machines and virtual network or any vnets. Only owner are able to create Vnets. How to do this
It looks like you might need to create a custom role.
You can add various roles using RBAC for Access management of cloud resources.
The following document has the information on all the built-in roles in Azure RBAC:
https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
If built-in roles do not fulfill your requirements, you can also use create your own custom roles using PowerShell:
https://learn.microsoft.com/en-us/azure/role-based-access-control/tutorial-custom-role-powershell
Here is the Azure doc on understanding various roles and create in Azure portal:
https://learn.microsoft.com/en-us/azure/role-based-access-control/rbac-and-directory-admin-roles

Only give PS access to a specific VM?

I have an VM running in Azure which I would like the client to be able to turn on/off easily. I tought this would be simple; just a PS-script that performs an startup/shutdown/dealloc. But it seems I can't generate a "Azure Publish Settings"-file that only gives access to that VM? At the moment it seems I can only control this at the subscription level?
The Azure Publish Settings file basically contains the access information for an entire Azure subscription. It does not specify access to a specific resource (e.g. VM) but to all resources inside of a subscription.
To limit access to a subset of resources in Azure, you should be looking at the new role-based access (RBAC) functionality, which is available in the Azure preview portal and the latest Azure PowerShell cmdlets.
How it works is that you create an Azure resource group, to which you can assign roles with specific rights, and to this role you can then assign individual users.
Check the following Azure documentation link for details on how to do this.

Resources