appweburl or SPAppWebUrl is undefined error in SharePoint 2013 Auto Hosted Apps


I was getting the “appweburl” is undefined error while developing a SharePoint Auto Hosted App.

// Initialize the RequestExecutor with the app web URL.

executor = new SP.RequestExecutor(appweburl);

//Get the URI decoded URLs.

hostweburl =




appweburl =





The value of hostweburl was getting passed in the querystring properly, but the value for appweburl was not getting passed.

The way to resolve this issue was to add an empty element to the App.

By default the Autohosted or Provider-hosted template have an empty app web. If the app web is empty SharePoint doesn’t create the app web for you.

That’s how simply adding an empty element fixes the issue.

The post that came to rescue.

Hope it helps.

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Please share your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.