Search code examples
microsoft-teamsmulti-tenantteams-toolkitmicrosoft-teams-js

Error after changing my Application ID URI to CDN endpoint


I'm trying to deploy my application built on the team toolkit scaffolding for multi-tenant. I created a CDN endpoint and updated my state JSON object to reflect the new front-end endpoint. After provisioning, deploying and making the account setting change to multi-tenant. I uploaded my app to our company tenant and I'm getting the following error in my tab configuration where the user is supposed to be able to log in.

OutOfRangeInputOne of the request inputs is out of range. RequestId:47fca9cc-f01e-004a-7a11-e434e9000000 Time:2022-10-19T23:24:05.3740757Z

Is there any workaround to get a team's toolkit app to be multi-tenant supported? I am trying to get this app validated for the teams store.


Solution

  • You can follow the steps here to enable multi-tenant in Teams Toolkit:

    1. Provision your Tab project.
    2. Open .fx\states\state.{envName}.json and note the value ofdomain under fx-resource-front-hosting.
    3. Create Azure CDN and CDN endpoint and point to frontend storage. Note you need to choose endpoint type as Storage static website when creating your CDN.
    4. Open templates\azure\provision\azureStorageTab.bicep file, and find the following two lines:
      output endpoint string = 'https://${siteDomain}'
      output domain string = siteDomain
      
      and replace with:
      output endpoint string = 'https://sample.azureedge.net'
      output domain string = 'sample.azureedge.net'
      
    5. Open templates/appPackage/aad.manifest.json, find signInAudience and set value as AzureADMultipleOrgs
    6. Open .fx/configs/azure.parameter.${env}.json and find the following line:
      "m365TenantId": "{{state.fx-resource-aad-app-for-teams.tenantId}}",
      
      and replace with:
      "m365TenantId": "common",
      
    7. Run Provision and Deploy in your project.