Is there any way to pass configuration parameters to an Outlook Addin

天涯浪子 提交于 2021-01-01 09:39:28

问题


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?


回答1:


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>" />



回答2:


Thanks Outlook Add-ins Team, that works fine; for the benefit for any other readers, a few details

  1. Extracting the parameter value in the target JS is made easy by using URLSearchParams()
  2. This solution concentrates the customer variance in the Manifest, leaving the bulk of the solution in JS that is the same for all deployments, a key objective
  3. As an aside: the customer variances to the Manifest can be reduced to minimum by using ~remoteAppUrl


来源:https://stackoverflow.com/questions/64965093/is-there-any-way-to-pass-configuration-parameters-to-an-outlook-addin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!