Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request for the deployment page #36

Open
jeffangama opened this issue May 22, 2020 · 2 comments
Open

Pull request for the deployment page #36

jeffangama opened this issue May 22, 2020 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@jeffangama
Copy link

jeffangama commented May 22, 2020

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:

  • Power Apps Studio
  • Power Automate
  • Azure Subscription with Global Administrator access level
  • Service account (used by Logic Apps to post welcome message with Teams user access permission)
  • SharePoint
  • Office 365 Groups connector
  • A copy of the Request-a-team app zip package

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 :

    • In the above-navigated path in PowerShell,run the command "Set-ExecutionPolicy -ExecutionPolicy unrestricted". This command will allow the user to run deploy.ps1 as execution policy is restricted by default. You can change it to restricted again after successful deployment.
    • Install Azure CLI module by running the command below :
      "Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'"
    • Close the PowerShell window and open it again in administrator mode. Go to the path of deploy.ps1 script file.
  • 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 "[email protected]" -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>

  • Click 'Create'

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.

  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

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

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

    • 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

  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
Copy link
Member

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

@timmgreen
Copy link

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.

@alexc-MSFT alexc-MSFT added the documentation Improvements or additions to documentation label Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants