Giter VIP home page Giter VIP logo

az.msigraphpermissions's Introduction

Az.MsiGraphPermissions 1.0.0.1

Want to apply Graph Permissions / Roles to a Managed Service Identity in Azure? Now you can!

This module only exists to patch this missing feature from the AAD Managed Identity UI. Hopefully this will not be needed for long!

How to install

Install-Module Az.MsiGraphPermissions

How to use

Connect-AzAccount -Tenant "powers-hell.com" -UseDeviceAuthentication
$token = Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com"
$roles = @(
    "DeviceManagementApps.ReadWrite.All", 
    "DeviceManagementConfiguration.Read.All", 
    "DeviceManagementManagedDevices.Read.All", 
    "DeviceManagementRBAC.Read.All", 
    "DeviceManagementServiceConfig.ReadWrite.All", 
    "GroupMember.Read.All"
)
Add-GraphPermissionToMsi -ApplicationName "MyObviouslyCoolApp" -GraphApiPermission $roles -Token $token.Token

In the above example we get our auth token using the Az.Accounts module, but any MSAL solution can be leveraged.

Once auth is granted, using the managed service identity name, supply a list of Graph API permissions by name and watch the magic happen.

If the MSI already has the supplied permissions you will be notified.

Features to come

  • View current applied permissions / roles
  • Remove current applied permissions / roles
  • Output the results of Add-GraphPermissionToMsi as an object

Want to contribute?

Fork away, this module probably wont live long, but the feature list above would be a great opportunity to work on for anyone new to PowerShell / Azure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.