Reputation: 345
I have a JS Outlook Add-in that I'd like to be able to deploy to multiple sites, but I'd like to deploy the same code to every site and handle configuration data externally, if possible. Something like process.env (that works for a Node.js server App) for a client App. I see it's possible to define Application Settings in Azure, but how can I access the values in the App?
Upvotes: 3
Views: 1181
Reputation: 603
I want to extend @JohnD's answer for everyone who wants to have an example:
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html?param=myParameter"/>
let queryString = window.location.search;
// ?param=myParameter
let param = new URLSearchParams(queryString);
// param=myParameter
let myParam = param.get("param");
// myParameter
This is an example on how to use it. Hope it helps.
Upvotes: 1
Reputation: 345
Thanks Outlook Add-ins Team, that works fine; for the benefit for any other readers, a few details
Upvotes: 2
Reputation:
If you're able to distribute a different manifest to each customer, you can add a query parameter to any SourceLocation URLs in the manifest to pass information to the add-in on startup.
<bt:Url id="Taskpane.Url" DefaultValue="https://contoso.azurewebsites.net/Taskpane.html?<per-customer query string>" />
Upvotes: 4