简体   繁体   中英

write rule on NSG in azure

Lets say I have an NSG rule that I want to allow a user write permission to create an inbond rule. Access to any other resource should be blocked for that user.

How can we write custom RBAC rule in ARM Template?

Solution1 Powershell

Step1 You need to create a new guest user in azure active directory. Go to Azure portal > Azure Active Directory >add a guest user > Go to your guest user Email and accept the invitation.

Step2 Using Powershell to login Azure with your Admin account.Run these codes: AzureRmRoleAssignment -ObjectId <your external user Object Id> -RoleDefinitionName Contributor -Scope "<your NSG resource ID>

You can go to Azure portal to find the value of Object ID and the Resource ID.

Step3 Login Azure portal using the guest user, you will find only the NSG in your all resources.

Solution 2 Azure Portal

Step1 You need to create a new guest user in azure active directory. Go to Azure portal > Azure Active Directory >add a guest user > Go to your guest user Email and accept the invitation.

Step2 Go to Your NSG> Access control> Add> Select a role and Select the guest user> Save

在此处输入图片说明

Step3 Login Azure portal using the guest user, you will find only the NSG in your all resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM