Skip to content

Configure Function App

Gunjan Datta edited this page Jan 16, 2026 · 6 revisions

Required Files

Download the PowerShell Script function-app.ps1 file from the latest release.

1. Configure Profile

Select App files under the Functions menu. Click on the selected file to change it to the profile.ps1 script.

Configure Profile

2. Update Profile

Comment out the highlighted section, and save the file.

Update Profile

3. Update Requirements

Add 'PnP.PowerShell' = '2.12' as the required library for the script, and save the file.

Update Requirements

Note - v2.12 was the latest version at the time of creation of this page.

4. Create Function

From the Overview menu, click on Create function under the Functions tab.

Create Function

5. Select Template

Select the HTTP trigger template, and click on Next.

Select Template

6. Create Template

Set the name and click on Create.

Create Template

7. Paste Script

Copy the contents of the script from the releases page. Review the connection to ensure it is configured for your environment. The azureEnv variable has an associated connection that is commented out. If you need to set the environment, make sure to update both lines of code.

Paste Script

8. Get Function API

Click on the Get function URL menu item and note the api url.

Get Function API

9. Create Environment Variables

Click on Environment variables from the Settings menu. Click on Add to create the required environment variables for the script:

  1. CLIENT_ID - The application (client) id we created earlier.
  2. TENANT_ID - The tenant id.
  3. WEBSITE_LOAD_CERTIFICATES - The certificate thumbprint.

Once the variables are created, click on Apply and confirm the changes.

Create Environment Variables

10. Enable CORS

Select CORS under the API menu. Select the checkbox and enter your tenant url (Ex: https://tenant.sharepoint.com). Click on Save to apply the changes.

Enable CORS

11. Add Inbound Network Rule

  1. Select Networking from the left navigation
  2. Click on the Enabled with no access restrictions link

Networking

  1. Select the option to Enabled from select virtual networks and IP addresses
  2. Click on +Add to add a new inbound rule
  3. Set the following properties:
Name Value
Name Allow Inbound Power Automate
Priority 100
Type Service Tag
Service Tag LogicApps
  1. Click on Add rule to save the rule
  2. Click on Save and then confirm it by checking the box and clicking on Confirm to apply them

Inbound Rule

Clone this wiki locally