outlook-web-addinsoffice-store

Outlook add-in office.js not loaded


I have an Outlook add-in that simply adds a command button on Outlook, and once clicked, makes a request to my self hosted API endpoint. The add-in manifest is valid, I can add the add-in, but when I click on the button added by my add-in, Outlook tells me that it's working on my request, but that never completes. See screenshot:

outlook add-on not working

When I look at the developer console, I see that office.js cannot be loaded from my web server where my add-in is hosted. I have already added the domain name in

<AppDomains>
    <AppDomain>domain.com</AppDomain>
</AppDomains>

Any help would be appreciated. Thanks!


Solution

  • The issue was caused by Apache sending a too restrictive Content-Security-Policy header, which blocks the loading of office.js, any styling, and client-side requests to Microsoft resources. To fix this, I modified my Apache configuration's CSP directive to include *.microsoft.com, and 'unsafe-inline' for scripts and styling.