Open jeffangama opened 4 years ago
Thanks @jeffangama - I will send this to the team who looks after the documentation element.
Working through deploying this. Suggest removing the recommendation to delete the Sharepoint site if the deploy.ps1 fails and instead just allow the script to overwrite on the next run. If you delete the site, it goes into Deleted Sites and at least in my tenant, I cannot permanently delete the site. Because it is "deleted" but not permanently the site alias is still reserved by Sharepoint. If you run deploy.ps1 again the script cannot re-use the same site alias and you end up with something like .../sites/requestateam2.
Since we can't pull request a wiki page, i suggest my changes here :
Deployment Page below
Prerequisites
To begin, you will need:
Step 1: Set up SharePoint and Azure resources
Please follow below steps to create new SharePoint site and lists:
Download the whole solution folder from GitHub
Open the PowerShell in administrator mode and navigate to deploy.ps1 in your local machine.
Before running the script, some installations are needed for the user who is running the script for the first time. Please find the steps below :
Execute the following script (make sure to replace tenant name and site name with actual values)
Install ImportExcel module (it imports excel data to lists) : "Find-Module -Name ImportExcel | Install-Module"
The script requires the following parameters:
TenantName - Name of the tenant to deploy to (excluding onmicrosoft.com) e.g. contoso
TenantId : This will be asked as a parameter when you run the script. (If you are not sure how to get Tenant ID, please check Azure Active Directory in Azure Portal. Under Manage, click Properties. The tenant ID is shown in the Directory ID box.)
RequestsSiteName - Name of the SharePoint site to store the requests, can include spaces (URL/Alias automatically generated). If the site exists, it will prompt to overwrite and will apply the provisioning template.
RequestsSiteDesc - Description of the site that will be created above.
ManagedPath - Managed path configured in the tenant e.g. 'sites' or 'teams' (no forward slash).
SubscriptionId - Azure subscription to deploy the solution to (MUST be associated with the Azure AD of the Office 365 tenant that you wish to deploy this solution to.)
Location - Azure region in which to create the resources. The internal name should be used e.g. uksouth. See Valid Azure Locations.
ResourceGroupName - Name for a new resource group to deploy the solution to - the script will create this resource group.
AppName - Name for the Azure AD app that will be created e.g. Request-a-team.
ServiceAccountUPN - UPN of Service Account to be used for the solution - used to connect the Logic App API connections. Service account is nothing but an Office 365 user who has Teams licenses enabled. Refer Assign a Teams license to know more details.
UseMSGraphBeta - Deploys a version of the provisioning logic app which uses solely the beta endpoint for the Microsoft Graph (provides the ability to create private channels when cloning teams and creating teams from your own defined templates). Otherwise the 1.0 endpoint will be used. Defaults to FALSE.
IsEdu - Specifies whether the current tenant is an Education tenant. If set to true, the Education Teams Templates will be deployed. These will be skipped if set to false or left blank.
>.\deploy.ps1 -TenantName "M365x023142" -TenantID "xxxxxxxx-xxxx-xxx-xxxxxxxxxxx" -RequestsSiteName "Request a team app" -RequestsSiteDesc "Used to store Teams Requests" -ManagedPath "sites" -SubscriptionId 7ed1653b-228c-4d26-a0c0-2cd164xxxxxx -Location "westus" -ResourceGroupName "teamsgovernanceapp-rg" -AppName "Requestateamapp" -ServiceAccountUPN "serviceaccount@M365x023142.onmicrosoft.com" -UseMSGraphBeta $false -IsEdu $false
The script will prompt for authentication during execution. Please login using a Global Administrator account except for the prompts below.
When the script asks for the Service Account password, please enter the password for your Service Account created earlier.
When the message "LOGIC APP CONNECTIONS AUTHORIZATION" is displayed, login to any authentication prompts using the Service Account specified above.
When the script has completed a "DEPLOYMENT COMPLETED SUCCESSFULLY" message will be displayed.
After running the script, SharePoint site, Logic Apps, Azure AD app and required API connections will get created.
Navigate to newly created SharePoint site and click on Site Content located at the left menu bar and confirm if there are 3 SharePoint lists created successfully (Teams Requests, Teams Templates and Team Request Settings).
Register Azure AD app as a SharePoint add-in (this is required for the solution to check if the requested Team exists before creation) -
Register Azure AD app as a SharePoint add-in
App Id: Application ID of the Azure AD app (Locate the Azure AD app created by the deployment script in Azure Active Directory and copy the Application ID).
Click 'Lookup'
In the 'App Domain' text box, enter a suitable domain.
In the App's Permissions Request XML text box, enter the following XML -
<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" /> </AppPermissionRequests>
Note:
If PowerShell script breaks during deployment, check if the resource group and SharePoint site is created. If created, please consider deleting them before running the script again.
Please make sure to click on each SharePoint list to see all columns are created, as the same will be linked with Power Apps.
Please copy the name of the site as it will be used in further steps.
Please share the SharePoint site to all Request-a-team application users by adding them as members a group or individually.
Step 2: Create Admin group
Please ignore this step from 1-7 if you already have a team of admins(who have the privilege to manage approval and rejection of team creation requests) and continue with #8.
Open Teams desktop app or open https://teams.microsoft.com/go#
Click on the Teams tab in the left menu bar
Click on Join or create team > click Create team button
Select Build your team from scratch > Select Private
Provide Team name and description > Click Next
After that a popup will open where you need to add members in your created team. Add all the members and then close the popup.
Confirm if a new team is created successfully.
Next to the team name, click on the "..." and select "Get link to team".
[[Images/Teamid1.png|Create Team]]
Click on "Copy" to copy the link to clipboard.
[[/Images/Teamid2.png|Copy Team ID]]
Get the groupID and channelID query string value as shown below:
[[/Images/ChangeChannelId.png|Get Channel ID from query string]]
tip: you can try online decoder to decode channel ID
Copy the groupId and channelId as it will be used in further steps.
Navigate to Team Request Settings list and edit TeamsTeamID and TeamsChannelID rows and In the 'value' column of these rows, add the copied groupID and channelID under TeamsTeamID and TeamsChannelID respectively.
[[/Images/TeamIdChannelId.png|Set Team ID and Channel ID in settings]]
Step 3: Set up Power Apps
Navigate to Power Apps. Click here
Click on Apps in the left side pane and click on Import canvas app.
[[/Images/step1.png|Request a team step 1]]
Download the package zip file and click Import.
[[/Images/step2.png|Request a team step 2]]
Under Related resources, you will be required to change the SharePoint connections. Click on wrench icon for SharePoint connection > Create new (you will be redirected to a new tab) > Click on SharePoint > switch back to main tab > click Refresh list > select name > Save.
Click on Import button.
[[Images/step3.png|Request a team set up step 3 for import]]
Configuring Power App
Click on Open app link when zip package is successfully imported. You will be redirected to Power Apps portal.
Click on Open menu at the left side > Power Apps > Request-a-team App which you have imported.
The app will request your permission to use all the listed data connections.
[[/Images/permission.png|Request a team Permission]]
Once the app opens, in the horizontal menu, click on View and select Data sources. Remove the three existing demo SharePoint connections by clicking on "..." and remove . This ensure that the dummy SharePoint connections are removed and the app is ready to connect with the SharePoint site.
Search for SharePoint created during deployment and select.
[[/Images/edit1.png|Edit SharePoint connection]]
Enter the newly created SharePoint URL in pop-up window (it is same as provided for -RequestsSiteName parameter in deployment script)
[[/Images/edit2.png|Enter SharePoint site URL]]
Choose 'Teams Requests', 'Teams Templates', 'Team Request Settings' lists and connect it.
[[/Images/edit3.png|Select Teams Template]]
On app 'OnStart' function, paste the groupId of the admin group which you have created and saved the id before.
[[/Images/AppStart.png|Power Apps OnStart]]
Step 4: Set up Power Automate
Configuring Flows
Navigate to My Flows.
Edit the Team Request Approval flow.
Update SharePoint site address for step s“When a team request item is submitted” and “Teams Request Site”.
Replace admin’s email id if there is no admins team for application.
Click Save
Repeat the above process for the Check Team Availability flow. Update the SharePoint site address for steps
Open Azure portal and under new resource group, search Logic App (Process team request). Edit Logic App to confirm
[[/Images/LogicAppStep1.PNG|Logic Apps step]]
[[/Images/LogicAppStep2.PNG|Logic Apps step 2]]
Step 5: Share Power Apps and SharePoint site
Admin needs to share the app to all individuals who will be using the app.
Open https://make.preview.powerapps.com/
Go to Apps menu in the left menu bar and you will be able to see the app you have imported.
[[/Images/Share11.png|Power Apps menu bar]]
Click on 3 dots (Options) for your app and click on Share.
Enter the group name meant for users in the popup and click on Share. You can also add additional members if needed. This is required to allow members to access Request-a-team App.
Share the SharePoint site to all members
Admin also needs to share the SharePoint site to all individuals who will be using the app. For giving access of SharePoint site, please follow below steps:
Go to SharePoint site created during deployment > click on Settings icon at top right corner > click on the "Site permission":
[[https://github.com/OfficeDev/microsoft-teams-apps-associateinsights/wiki/Images/sharesharepointsite-part1.png|Share SharePoint Site]]
Click on "Advanced Permissions settings".
Click on the Grant Permission option from top menu bar and search the user name or type the email address of the user to whom you want to share the site.
[[https://github.com/OfficeDev/microsoft-teams-apps-associateinsights/wiki/Images/sharesharepointsite-part2.png|Share SharePoint Site]]
Note: Every user accessing the app for the first time will be prompted to provide permissions to the App to access the SharePoint source. User should click on 'Allow' to proceed ahead.
Step 6: Install Teams Package
Open https://make.preview.powerapps.com/
Go to Apps menu in the left menu bar and you will be able to see the app you have imported.
Click on 3 dots (Options) for your app and click on Add to Teams.
[[/Images/Export1.png|Export application]]
Click on Download App in the popup to download a zip package.
Step 7: Adding app to Teams
Go to Teams > Apps (in the left menu) > Upload a Custom App.
Select the downloaded zip package from the previous step.
Click on Add > Add to a team in the popup.
Select a team or channel name.
Click on Setup a tab.
[[/Images/install1.png|Set up as a tab]]
The description for the app will be shown in the popup, click on Save.
You will be able to see the app in the tab.
[[/Images/install2.png|Application in Teams]]