Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In our scenario we are developing a provider-hosted app for SharePoint 2013. For each on-premise SharePoint installation there will be a separate (remote) web application with a different URL. Hence, the the URL of the provider-hosted app including the App Parts of the app, cannot be a fixed URL.

Are there any ways to let the SharePoint Admin configure the URL prefix for a provider-hosted app? (e.g. through Power Shell or a SharePoint setting).

If possible, I would like to specify a placeholder as part of the URL, e.g. in the App Part such as "~remoteUrl/myReleativeWebAppUrl/service" and let the placeholder be replaced during runtime through a SharePoint setting (the admin specified before).

I know there is the "~remoteAppUrl" parameter, but this only works for testing and is replaced during building the app.

At the moment I can only think about one workaround which is to change the URL before deploying the App manually or through a PowerShell scripts. But this would make the app impossible to be deployed to the store.

So to sum up, what is the best way to let the SharePoint admin configure the URL prefix / Domain of the provider-hosted app?

(I also asked the question here.)

share|improve this question

2 Answers 2

You can modify app file before send to sharepoint.

Here is steps:

  • List item
  • build app file with remoteUrl
  • unzip it
  • replace in all files remoteUrl to your needs
  • zip it
  • send to sharepoint

If youy need to do same with app that already in Sharepoint, then you should do same with some app file on server and than send update to app using powershell

share|improve this answer

Alternative Approach: The landing page of your (fixed URL) Provider Hosted App redirects to a dynamic URL based on the Host Site URL you get in the query string.

That way you stick within normal "Provider Hosted App" mechanics but still provide a unique URL for each of your clients.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.