Graph | PowerShell Compatibility | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
This repository contains the code used to make a new SharePoint site using a single API call. This was created for use with TDx web request features to automate workflows.
- Create a new Azure App Registration.
- Make note of the application (Client ID), we will need this value later.
- Make note of the Directory (tenant) ID, we will need this value later.
- Add a new client secret and make note of the value, we will need this value later.
- Add the needed graph permissions and grant admin consent:
Permissions name Type Description Admin Consent Required Group.Create Application Create groups Yes Group.Read.All Application Read all groups Yes Group.ReadWrite.All Application Read and write all groups Yes GroupMember.Read.All Application Read all group memberships Yes GroupMember.ReadWrite.All Application Read and write all group memberships Yes Sites.Manage.All Application Create, edit, delete items and lists in all site collections Yes Sites.Read.All Application Read items in all site collections Yes Sites.ReadWrite.All Application Read and write items in all site collections Yes User.Read.All Application Read all users' full profiles Yes
- Create a new Azure Resource group.
- Create a new function app.
- Add the following application settings:
- ClientID.
- ClientSecret.
- TenantID.
- Configure TLS/SSL settings:
- Enable HTTPS Only.
- Configure Deployment Center:
- Set code source to Manual deployment - External Git
- Specify the repository and branch and wait for sync to complete.
- Set code source to Manual deployment - External Git
- Review the functions section and confirm that the expected functions are listed.
- Review each function and make note of the function URL value, we will need this value later.
- Add the following application settings:
- Create a form.
- Add two new fields, one for the sharepoint site name, one for the sharepoint site description.
- Create a new Web Service Method.
- Set parameters:
Name Data Type Source Source Property owner string from ticket requestor email ticket ID string from ticket id displayName string from ticket sharepoint - name description string from ticket sharepoint - description - Set the body block:
{ "ticketID":"{{ticketID}}", "owner":"{{owner}}", "displayName":"{{displayName}}", "description":"{{description}}" }
- Set parameters:
- Create a service.
- Create and build a workflow that uses the web service method.
NewSharePointSite
Function is triggered via a Post request.
View the readme file within each function's respective folder for more information.
The name is based off of whatever the Azure Function App Service name is:
Host: https://<FUNCTIONAPPNAME>.azurewebsites.net
Port 7071 is currently the default port when using the local azure function apps for testing:
Host: localhost:7071