I am running Powershell commands in a node.js script to connect to Microsoft-Exchange with a certificate thumbprint.I am using the node-powershell npm package. All works as expected locally. When deploying to Azure the Powershell commands dont seem to run. Has anyone else had success deploying a similar script?
let ps = new shell({
executionPolicy: "Bypass",
noProfile: true
});
ps.addCommand('Connect-ExchangeOnline -CertificateThumbPrint "thumbprintString" -AppId "APP_ID"
-Organization "example.onmicrosoft.com"');
ps.invoke()
.then((output) => {
console.log(output);
resolve();
})
.catch((err) => {
console.log(err);
reject(err);
});