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.)

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 you 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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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