In the AppPart Elements.xml we add

<Content Type="html" Src="<URL to app>?{StandardTokens}" />

Is there a way to configure this URL to change based on the environment? Either get it from a list or the web.config? If not we need to change the URL each time we want to publish the app to a different environment.


I also met with the same requirement. But actually we could not modify the SRC attribute. Then, I found a work around for this. Let the AppPart renders on the page. It gets rendered as a iFrame. By using a Javascript, let us modify the SRC attribute of the iFrame dynamically.

The sample script would be,

$(document).ready(function () {

    IFrameSRC = $('iframe').get(0).src;
    alert("IframeeSRC : " + IFrameSRC);

    if (IFrameSRC != "") {

        $('iframe').get(0).src = "NEW URL";

  • There is another way? And what about Reverse Proxy?
    – user31587
    Jul 16 '14 at 2:05

I do not understand your question ~remoteAppUrl is the Token you insert for and the matching will be done in SharePoint with the information you provide on /_layouts/15/appregnew.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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