Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FriedrichWeinmann/MiniGraph
https://github.com/FriedrichWeinmann/MiniGraph
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/FriedrichWeinmann/MiniGraph
- Owner: FriedrichWeinmann
- License: mit
- Created: 2021-03-18T07:03:32.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-19T09:50:20.000Z (8 months ago)
- Last Synced: 2024-06-24T23:37:09.888Z (5 months ago)
- Language: PowerShell
- Size: 53.7 KB
- Stars: 37
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-entra - MiniGraph - Minimal overhead Microsoft Graph client implementation for lean environment like Azure Functions [![stars](https://badgen.net/github/stars/FriedrichWeinmann/MiniGraph)](https://badgen.net/github/stars/FriedrichWeinmann/MiniGraph) (Tools / CLI)
README
# MiniGraph
## Introduction
The MiniGraph module is designed as a minimal overhead Microsoft Graph client implementation.
It is intended for lean environments such as Azure Functions where a maximum performance in all aspects is required.## Installation
The module has been published to the PowerShell Gallery.
To install it, run:```powershell
Install-Module MiniGraph
```## Use
> Authenticate
First you need to authenticate.
Three authentication workflows are provided:+ Application: Certificate
+ Application: Secret
+ Delegate: Username & PasswordFor example, the connection with a certificate object could work like this:
```powershell
$cert = Get-Item -Path 'Cert:\CurrentUser\My\082D5CB4BA31EED7E2E522B39992E34871C92BF5'
Connect-GraphCertificate -TenantID '0639f07d-76e1-49cb-82ac-abcdefabcdefa' -ClientID '0639f07d-76e1-49cb-82ac-1234567890123' -Certificate $cert
```> Execute
After connecting to graph, execute queries like this:
```powershell
# Return all groups
Invoke-GraphRequest -Query groups
```You can now basically follow the guidance in the graph api reference and take it from there.
> Graph Beta Endpoint
If you need to work against the beta endpoint, switching to that for the current session can be done like this:
```powershell
Set-GraphEndpoint -Type beta
```## Common Issues
> Scopes
Make sure you verify the scopes (permissions) needed for a request.
They must be assigned as Api Permission in the registered application in the Azure portal.
Admin Consent must be given for Application permissions.
For delegate permissions, either Admin Consent or User Consent must have been granted, as `Connect-GraphCredential` does not support any mechanisms to request Consent.> Must contain client_assertion or client_secret
This usually happens when trying to connect with credentials.
The registered application must be configured for this authentication type in the authentication tab:+ In Platform configurations, add a Web Platform with redirect URI "http://localhost"
+ In Advanced settings, enable "Allow public client flows"