Development Tips
Tips for local development
Reusing Local Settings
You can reuse your local.settings.json
file to test direct calls to Microsoft's Graph API, first setup environment variables from the values in your local.settings.json
file:
This creates environment variables which you can access directly in PowerShell or in other scripts using $ENV:<key>
. For example to use the refresh token you could use: $ENV:RefreshToken
.
Here's an example using the environment variables in a PowerShell script to call the Microsoft Graph API:
This adds your Graph Tokens as environment variables to your PowerShell session. This represents a security risk and you should use it only for testing / development purposes.
You can clean up the environment variables set in the earlier script by running:
It is also important to note that running locally removes the SWA authentication aspect of the app, meaning that anyone on your LAN could connect to the instance.
Last updated