I have created an office-js addin which is opening a dialog-api which is hosted as an Azure app service. The dialog-api send an AJAX call to an asp.net web api (which is secured using Azure AD).
While calling the web api I am getting thie error :
The code for the Ajax call :
$.ajax({
url:'.../api/DocFile4/GetVersions',
type: 'GET',
crossDomain: true,
async: false,
contentType: 'application/json;charset=utf-8',
}).done(function (data) {
console.log("success");
}).fail(function (status) {
console.log('Error', 'Could not communicate with the server.');
});
The Office-js addin and dialog-api are hosted on the same app sevice while the asp.net web api is hosted on a separate app service, both are the app services are in the same resource group.