OfficeDev / microsoft-teams-apps-requestateam

Power Platform based solution that allows users to request teams and automates team creation. NO LONGER MAINTAINED. Please use 'Provision Assist' - https://github.com/pnp/provision-assist-m365/ instead.
MIT License
234 stars 66 forks source link

Pull request for the deployment page #36

Open jeffangama opened 4 years ago

jeffangama commented 4 years ago

Since we can't pull request a wiki page, i suggest my changes here :

  1. Specify how to install import excel module;
  2. Specify tenant ID in second position
  3. Specify missing tenant ID parameter in deploy.ps1 command sample

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:

The script requires the following parameters:

>.\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.

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).

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:

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.

  1. Open Teams desktop app or open https://teams.microsoft.com/go#

  2. Click on the Teams tab in the left menu bar

  3. Click on Join or create team > click Create team button

  4. Select Build your team from scratch > Select Private

  5. Provide Team name and description > Click Next

  6. 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.

  7. Confirm if a new team is created successfully.

  8. Next to the team name, click on the "..." and select "Get link to team".

    [[Images/Teamid1.png|Create Team]]

  9. Click on "Copy" to copy the link to clipboard.

    [[/Images/Teamid2.png|Copy Team ID]]

  10. 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

  11. Copy the groupId and channelId as it will be used in further steps.

  12. 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

  1. Navigate to Power Apps. Click here

  2. Click on Apps in the left side pane and click on Import canvas app.

    [[/Images/step1.png|Request a team step 1]]

  3. Download the package zip file and click Import.

    [[/Images/step2.png|Request a team step 2]]

  4. 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.

  5. Click on Import button.

    [[Images/step3.png|Request a team set up step 3 for import]]

Configuring Power App

  1. Click on Open app link when zip package is successfully imported. You will be redirected to Power Apps portal.

  2. Click on Open menu at the left side > Power Apps > Request-a-team App which you have imported.

  3. The app will request your permission to use all the listed data connections.

    [[/Images/permission.png|Request a team Permission]]

  4. 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.

  5. Search for SharePoint created during deployment and select.

    [[/Images/edit1.png|Edit SharePoint connection]]

  6. 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]]

  7. Choose 'Teams Requests', 'Teams Templates', 'Team Request Settings' lists and connect it.

    [[/Images/edit3.png|Select Teams Template]]

  8. 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

  1. Navigate to https://flow.microsoft.com using an account with 'Maker' permissions.
  2. Click My Flows > Import.
  3. Browse to the file location of the provided flow package - TeamRequestApproval.zip.
  4. Update the Outlook Office 365, SharePoint and Approvals connection to use an existing connection or create new ones. Under Related resources, you will be required to change the connection. 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.
  5. Click Import.

Configuring Flows

  1. Navigate to My Flows.

  2. Edit the Team Request Approval flow.

  3. Update SharePoint site address for step s“When a team request item is submitted” and “Teams Request Site”.

  4. Replace admin’s email id if there is no admins team for application.

  5. Click Save

  6. Repeat the above process for the Check Team Availability flow. Update the SharePoint site address for steps

    • Check if site exists -SP API and
    • Check site exists response > Check for existing requests matching URL
  7. Open Azure portal and under new resource group, search Logic App (Process team request). Edit Logic App to confirm

    • SharePoint site address:

    [[/Images/LogicAppStep1.PNG|Logic Apps step]]

    [[/Images/LogicAppStep2.PNG|Logic Apps step 2]]

    • You can change the Interval and Frequency in first step When an item is created or modified in order to process team requests at given interval. It will execute to read all Approved team requests to create SharePoint. The default setting is 1 week.

Step 5: Share Power Apps and SharePoint site

  1. Admin needs to share the app to all individuals who will be using the app.

  2. Open https://make.preview.powerapps.com/

  3. 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]]

  4. Click on 3 dots (Options) for your app and click on Share.

  5. 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.

  6. Share the SharePoint site to all members

    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

  1. Open https://make.preview.powerapps.com/

  2. Go to Apps menu in the left menu bar and you will be able to see the app you have imported.

  3. Click on 3 dots (Options) for your app and click on Add to Teams.

    [[/Images/Export1.png|Export application]]

  4. Click on Download App in the popup to download a zip package.

Step 7: Adding app to Teams

  1. Go to Teams > Apps (in the left menu) > Upload a Custom App.

  2. Select the downloaded zip package from the previous step.

  3. Click on Add > Add to a team in the popup.

  4. Select a team or channel name.

  5. Click on Setup a tab.

    [[/Images/install1.png|Set up as a tab]]

  6. The description for the app will be shown in the popup, click on Save.

  7. You will be able to see the app in the tab.

    [[/Images/install2.png|Application in Teams]]

alexc-MSFT commented 4 years ago

Thanks @jeffangama - I will send this to the team who looks after the documentation element.

timmgreen commented 4 years ago

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.