Forum Discussion
Office-js addin with webapi in Api management. Failed to fetch
Hello. My application contains one office-js addin (typescript) project + one Webapi core (c#) project, both communicating through a fetch function when cors is enabled.It works together properly on my local computer.
I published :
- the webapi on azure api management (https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-rest-api). Test gaves a 200 OK.
- the Office addin on azure. It works properly (as long the fetch function is not involved).
However when used, fetch function raises errors (message = "failed to fetch").The issue may be about proper ssl certificates as described in : https://docs.microsoft.com/en-us/office/dev/add-ins/concepts/requirements-for-running-office-add-ins.
Is it a possible solution ?
I tried with self signed certificate with no success so far. Is there any tutorial explaining how to implement it ?
Any help would be appreciated
1 Reply
The “failed to fetch” error commonly encountered in Office.js add-ins deployed to Azure is typically caused by issues with HTTPS configuration or CORS policies.
Self-signed certificates are not supported in this context. Office add-ins require a trusted SSL certificate issued by a recognized Certificate Authority (CA). In addition, CORS must be correctly configured within Azure API Management, not just at the WebAPI level.
Requirements for running Office Add-ins - Office Add-ins | Microsoft Learn