Executing Local Development
So first you need tokens for a Secure Application Model (SAM) application and you should have completed setting up for local development
First install the needed packages for the frontend:
cd "X:\Development\CIPP-Project\CIPP"
yarn install --network-timeout 500000
You should now have everything you require to start a local development instance of the Azure Function App (API), the Static Web App (frontend) or both.
Starting only the frontend:
swa start 'X:\Development\CIPP-Project\CIPP' --swa-config-location "C:\DoesntExist"
We use an invalid path for --swa-config-location
on purpose. We do this because the config provided in the CIPP folder only works for the actual Static Web Application (SWA) engine and not the local emulator.
To start only the API function app:
func start --script-root "X:\Development\CIPP-Project\CIPP-API"
To start both, it's recommended to use func start
and swa start
independently. You can also have the SWA utility start the API but this brings in some added difficulties because you can't see the API logs directly in the console.
func start --script-root "X:\Development\CIPP-Project\CIPP-API"
swa start "X:\Development\CIPP-Project\CIPP" --swa-config-location "C:\DoesntExist" --api-location http://localhost:7071/
Or start everything
cd X:\Development\CIPP-Project
azurite
cd X:\Development\CIPP-Project\CIPP-API
func start
cd X:\Development\CIPP-Project\CIPP
yarn run start swa
cd X:\Development\CIPP-Project\CIPP
yarn run dev
If you need the APIs to connect to Microsoft 365 and / or to test the Secure Application Model functionality itself you have to make a local.settings.json
file in the CIPP-API
folder. This file isn't detected by git (because of the .gitignore
file) so it's not pushed with any changes/contributions you make. This file stores the Secure Application Model tokens, and a Azure Storage connection string for the durable function queues.
The contents of your local.settings.json
file differs depending on whether you are using the Azurite storage emulator or Azure Storage itself.
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "powershell",
"FUNCTIONS_WORKER_RUNTIME_VERSION": "7.4",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"ApplicationID": "<APPLICATION ID>",
"ApplicationSecret": "<APPLICATION SECRET>",
"RefreshToken": "<REFRESH TOKEN>",
"TenantID":"<TENANT ID>",
"DEV_SKIP_BPA_TIMER": true,
"DEV_SKIP_DOMAIN_TIMER": true,
"SetFromProfile": true,
"FUNCTIONS_EXTENSION_VERSION": "4",
"AzureWebJobs.BestPracticeAnalyser_OrchestrationStarterTimer.Disabled": true,
"AzureWebJobs.Domain_OrchestrationStarterTimer.Disabled": true,
"WEBSITE_SITE_NAME": "mylocalcippinstance",
}
}
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "powershell",
"FUNCTIONS_WORKER_RUNTIME_VERSION": "7.4",
"AzureWebJobsStorage": "DefaultEndpointsProtocol=<AZURESTORAGECONNECTIONSTRING>",
"ApplicationID": "<APPLICATION ID>",
"ApplicationSecret": "<APPLICATION SECRET>",
"RefreshToken": "<REFRESH TOKEN>",
"TenantID":"<TENANT ID>",
"DEV_SKIP_BPA_TIMER": true,
"DEV_SKIP_DOMAIN_TIMER": true,
"SetFromProfile": true,
"FUNCTIONS_EXTENSION_VERSION": "4",
"AzureWebJobs.BestPracticeAnalyser_OrchestrationStarterTimer.Disabled": true,
"AzureWebJobs.Domain_OrchestrationStarterTimer.Disabled": true,
"WEBSITE_SITE_NAME": "mylocalcippinstance",
}
}
Optional Values:
"ExternalDurablePowerShellSDK": true
Last updated
Was this helpful?