This scenario demonstrates how you can use Azure Managed Identity to return a list of Office 365 Groups from the Microsoft Graph without needing to pass any credentials.
It also guides you through how you can create and configure a service principal for local development.
This scenario requires
- Active Azure Subscription
- Azure PowerShell Module
- Windows PowerShell
- Azure CLI v2.8.0
- Office 365 CLI v2.11.0
Active login to Azure CLI & Office 365 CLI is assumed
- Open PowerShell prompt
- Execute
.\deploy.ps1
to deploy Azure resources
- Managed Identity is enabled as part of the deployment
- App Role is assigned as part of the deployment
- Connect to Azure using
Connect-AzAccount
cmdlet - Execute
./localcert.ps1
- Take a copy of the output values
Do not use PowerShell Core for this script, it will complete but the identity will not work
- Open
local.settings.json
- Update
LocalDevAppId
value withApp Id
- Update
LocalTenantId
value withTenant Id
- Update
LocalThumbprint
value withThumbprint