Troubleshooting

Summary

Issues may occur when using Valo Teamwork. Therefore, we have listed below different ways how to deal with them.

Enable logs in Azure Functions

There is possibility to enable logging inside Teams engine - logs are saved to TeamworkLogs in Azure Table Storage.

Detailed logging during Teams extraction

By default, Teamwork won't output detailed information about the teams extraction.

In order to activate detailed logging, navigate to Home > Function App > tenant-teamwork-functions > Configuration

  • set the app setting TeamworkUseDebugLogging to true
  • AzureWebJobsStorage setting must contain connection string which points to existing Azure storage where Teams engine logs will be saved to

Detailed logging during Teams provisioning

By default, Teamwork won't output detailed information about all the steps during teams provisioning.

In order to activate detailed logging, navigate to Home > App Services > tenant-valo-appservice > Configuration :

  • set the app setting TeamworkUseDebugLogging to true
  • AzureWebJobsStorage setting must contain connection string which points to existing Azure storage where Teams engine logs will be saved to

Note

As default the web job's log history spans to the last 12 hours. This is because the default amount of web job invocations that are kept is 50 and with 5 minutes interval execution it counts up to 12 hours. If you want to keep more web job log history, you can change the value with adding app setting WEBJOBS_HISTORY_SIZE and increase the value from 50. For example value 200 will give you 48 hours of web job log history.

Browsing the logs

Logs can be browsed with Microsoft Azure Storage Explorer

Browsing the logs

Use special query string parameters with browser console

By default Teamwork doesn't writes debug information to browser console in order to avoid its flooding. In order to add debug information to the console several special query string parameters may be used:

Param Description Example
?valodebug=1 Add common debug information to the console log https://{tenant}.sharepoint.com/sites/teamwork?valodebug=1
?ValoDebugGroupsLoading=1 Add debug information related only with groups loading process https://{tenant}.sharepoint.com/sites/teamwork?ValoDebugGroupsLoading=1
?ValoDebugSitesLoading=1 Add debug information related only with sites loading process https://{tenant}.sharepoint.com/sites/teamwork?ValoDebugSitesLoading=1
?ValoDebugCreateOrder=1 Add debug information related with groups and sites ordering process https://{tenant}.sharepoint.com/sites/teamwork?ValoDebugCreateOrder=1

To see the debug information, open browser console and reload the page with one of query string parameters mentioned above. Check errors and information messages there.

Troubleshoot authentication problems

If Teamwork shows errors related with authentication, please check the following:

  • {tenant}-valo-tokens AAD app

    1. check that client id stored in ValoAadClientId tenant property.
    2. Ensure that client id is the same as app id of {tenant}-valo-tokens AAD app on this tenant.
    3. Ensure that same {tenant}-valo-tokens AAD app id stored in TeamworkAppId app setting for Teamwork app service and Azure functions
    4. Double check that permissions of {tenant}-valo-tokens AAD app are configured like described here: and ensure that admin consent is granted
    5. Ensure that "Treat application as a public client" property for Valo Tokens app is set to yes: https://docs.valointranet.com/teamwork/install/manual/manual-install/#set-defaul-client-app-to-public
    6. Ensure that reply urls for Valo Tokens app are configured properly: https://docs.valointranet.com/teamwork/install/manual/manual-install/#reply-uris-to-tenant-valo-tokens-aad-app
    7. Check manifest of Valo Tokens app: oauth2AllowIdTokenImplicitFlow and oauth2AllowImplicitFlow should be set to true and oauth2Permissions should not be empty
    "oauth2AllowIdTokenImplicitFlow": true,
    "oauth2AllowImplicitFlow": true,
    "oauth2Permissions": [
    ...
    ]
    
  • [tenant]-teamwork-functions AAD app

    1. ensure that permissions for [tenant]-teamwork-functions app are configured properly from here:
    2. navigate to [tenant]-teamwork-functions AAD app > Overview and ensure that Application ID URI is set to api://[clientId] where clientId is client id of [tenant]-teamwork-functions AAD app
    3. navigate to [tenant]-teamwork-functions AAD app > Branding and ensure that Home page URL is set to https://{tenant}-teamwork-functions.azurewebsites.net
    4. navigate to [tenant]-teamwork-functions AAD app > Authentication and ensure that Reply URI for Web platform is set to https://{tenant}-teamwork-functions.azurewebsites.net/.auth/login/aad/callback
  • [tenant]-teamwork-functions Azure function app

    1. navigate to [tenant]-teamwork-functions Function app > Authentication and ensure that authentication settings contain correct values:
      1. App Service authentication = Enabled
      2. Restrict access = Require authentication
      3. Unauthenticated requests = Return HTTP 302 Found (Redirect to identity provider)
      4. Redirect to = Microsoft
      5. Token store = Enabled
      6. Identity provider - should contain one Microsoft identity provider with App (client) ID set to client id of [tenant]-teamwork-functions AAD app App settings
    2. click Edit icon for Microsoft identity provider. It should have the following properties:
      1. Identity provider = Microsoft
      2. Application (client) ID - should contain app id of [tenant]-teamwork-functions AAD app (NOT app id of Valo Tokens app)
      3. Client secret setting name = MICROSOFT_PROVIDER_AUTHENTICATION_SECRET
      4. Issuer Url - should contain https://sts.windows.net/{tenantId}
      5. Allowed token audiences - should contain api://[clientId] where clientId is client id of [tenant]-teamwork-functions AAD app App settings
    3. navigate to [tenant]-teamwork-functions Function app > Configuration > Application settings
      1. it should contain MICROSOFT_PROVIDER_AUTHENTICATION_SECRET app setting
      2. MICROSOFT_PROVIDER_AUTHENTICATION_SECRET - should contain client secret of [tenant]-teamwork-functions AAD app (NOT client secret of Valo Tokens app)

You may also compare API permissions of Valo tokens app for the tenant which has authentication problems with the app which is installed on tenant where everything is working.

Troubleshoot Azure functions

Open developer console, switch to Network tab and reload the page. If there are red requests to Azure functions (400 Bad request or 500 Internal server error) you may check what happens inside failing Azure function using the following steps:

  1. Navigate to Azure portal > TW Functions app > Functions > click function which fails
  2. Click Code + Test > Logs (below the page) > Expand. Don't close this tab
  3. Open TW in the new browser tab and reload the page
  4. After page load will be completed switch back to the tab with AF log and check the log there. It should contain log of what happens inside AF

If logs are missing or there is one of the following errors in the log:

  • Function started and then immediately "Function completed (Failure, Id =...)"
  • The type initializer for TeamworkAzureFunctions.* threw exception

please check that BindingRedirects app setting is specified in Configuration > App settings. It is also good idea to check that all following app settings exist in Configuration > App settings of Azure function app (all app settings should not be empty except TeamworkGroupSchemaExtensionName which should be empty):

Function App Settings

Please note that BindingRedirects app setting contains value which may be different in each release. The following table shows BindingRedirects for previous releases:

Troubleshoot Valo Teamwork Installer

Valo Teamwork Installer installation information can be found here:

Troubleshoot Certificate based authentication

How to configure Configure the Certificate based authentication can be found here:

Release BindingRedirects
1.21 [{ "ShortName": "Newtonsoft.Json", "RedirectToVersion": "12.0.0.0", "PublicKeyToken": "30ad4fe6b2a6aeed" }, { "ShortName": "Microsoft.Graph.Core", "RedirectToVersion": "1.18.0.0", "PublicKeyToken": "31bf3856ad364e35" }, { "ShortName": "Microsoft.Graph", "RedirectToVersion": "1.20.0.0", "PublicKeyToken": "31bf3856ad364e35" }]
1.22 [{ "ShortName": "Newtonsoft.Json", "RedirectToVersion": "12.0.0.0", "PublicKeyToken": "30ad4fe6b2a6aeed" }, { "ShortName": "Microsoft.Graph.Core", "RedirectToVersion": "1.20.1.0", "PublicKeyToken": "31bf3856ad364e35" }, { "ShortName": "Microsoft.Graph", "RedirectToVersion": "3.3.0.0", "PublicKeyToken": "31bf3856ad364e35" }]
1.23 [{ "ShortName": "Newtonsoft.Json", "RedirectToVersion": "12.0.0.0", "PublicKeyToken": "30ad4fe6b2a6aeed" }, { "ShortName": "Microsoft.Graph.Core", "RedirectToVersion": "1.21.0.0", "PublicKeyToken": "31bf3856ad364e35" }, { "ShortName": "Microsoft.Graph", "RedirectToVersion": "3.14.0.0", "PublicKeyToken": "31bf3856ad364e35" }]
3.0 [ { "ShortName": "Newtonsoft.Json", "RedirectToVersion": "12.0.0.0", "PublicKeyToken": "30ad4fe6b2a6aeed" }, { "ShortName": "Microsoft.Graph.Core", "RedirectToVersion": "1.23.0.0", "PublicKeyToken": "31bf3856ad364e35" }, { "ShortName": "Microsoft.Graph", "RedirectToVersion": "3.21.0.0", "PublicKeyToken": "31bf3856ad364e35" }]
4.0 [ { "ShortName": "Newtonsoft.Json", "RedirectToVersion": "12.0.0.0", "PublicKeyToken": "30ad4fe6b2a6aeed" }, { "ShortName": "Microsoft.Graph.Core", "RedirectToVersion": "2.0.3.0", "PublicKeyToken": "31bf3856ad364e35" }, { "ShortName": "Microsoft.Graph", "RedirectToVersion": "4.3.0.0", "PublicKeyToken": "31bf3856ad364e35" }]
5.0 [ { "ShortName": "Newtonsoft.Json", "RedirectToVersion": "12.0.0.0", "PublicKeyToken": "30ad4fe6b2a6aeed" }, { "ShortName": "Microsoft.Graph.Core", "RedirectToVersion": "2.0.7.0", "PublicKeyToken": "31bf3856ad364e35" }, { "ShortName": "Microsoft.Graph", "RedirectToVersion": "4.13.0.0", "PublicKeyToken": "31bf3856ad364e35" }]

Troubleshoot web jobs

Currently there are three web jobs in teamwork. Valo Teamwork Creator runs continuously. Groups sync and Autoarchiving run in background by schedule:

Web job Default schedule Description
ValoTeamworkContinuous Continuous Creates sites, groups and teams ordered from TW dashboard
ValoTeamworkGroupsSync each 15 minutes Synchronizes groups from Azure AD to Azure storage
ValoTeamworkAutoArchiver once per day Archives group or team after configured amount of days

The main tool for troubleshooting web jobs are logs. Before to check logs it is highly recommended to enable debug logging. It can be done from App service > Configuration > App settings - set TeamworkUseDebugLogging property to true and click Save after that:

TeamworkUseDebugLogging: true

Also it is good idea to check that all the following app settings exist and have non-empty values:

App settings

Warning

Please note that BindingRedirects app setting contains value which may be different in each release. See table above which contains values of BindingRedirects setting for each release)

So if sites/groups are not created or if TW dashboard is empty - check logs of web jobs. They can be found in Azure portal > TW app service > Web jobs. It is also possible to run web job from there manually without waiting when it will run by schedule.

Starting with Teamwork 5 continuous web job with web hook is used for provisioning. Each team/group/site is provisioned in own thread. Logs of particular group's provisioning may be found under Function Invocations section. Each invocation contains integer order id in it's name which identifies list item from Teamwork orders list with order details. There may be duplicates with the same order id due to the multithread architecture - but only one invocation contains actual provisioning log (usually it has bigger execution time comparing with other invocations with the same order id).

How to check Valo Teamwork version

If customer have Valo Intranet installed, the Debug panel from Valo Toolbox can be used to check the version of the TW SPFx package.

Go to your Valo Intranet page, click on Valo Toolbox and select Debug

App settings

Version of valo-teamwork.sppkg indicates Valo Teamwork version.

App settings