Has anyone ACTUALLY made this work?
- Cloud Business App (HTML)
- Provider Hosted - Azure
- SharePoint 2013 online version
When I launch my app in production, at best I am getting kicked to the browser search screen, or I am told I don't have permissions. I have had little glimpses of hope where it appears to work, but as soon as I upgrade I end up with the above again.
Am I performing the impossible?
Thanking you in advance
Thanks for your reply Josh...by extension do you imply that any provider hosted solution using Azure on Office 365 wont work?
I have tried all combinations - Cloud Business App, Lightswitch HTML App, Lightswitch Desktop App, VS2013, VS2012
I do not doubt what you say but surely they would have disabled the provider hosted function in the Cloud Business App if it was unavailable?
I have largely relied on this post...http://www.looselytyped.net/2012/10/24/build-a-sharepoint-provider-hosted-app-in-5-mins/ which isnt lightswitch but is similar. Has anyone made it work?
Provider-hosted on O365 is supported. You need to 'Enable SharePoint' in LS and set the AppID & Secret etc. as in this article:
I haven't seen any LS specific articles which step through manually provisioning your azure site, but I assume that part is similar to your article.
>"surely they would have disabled the provider hosted function in the Cloud Business App if it was unavailable"
You would think so, but I wouldn't be so sure. LS team could be doing a better job documenting the options and implications of the O365 hosting options. Between the restrictiveness of the SharePoint app model, the complexity of O365 Auth and the looseness of LS design tooling, the potential road blocks are many.
Hopefully the team will sort this all out so LS can become THE RAD tool for SharePoint apps. That's 'aways away', I'm afraid.
I'd try using the steps in the above article and if you have trouble, post again with specific errors, etc.
- Edited by joshbooker Monday, October 07, 2013 9:45 PM
I got it to work using the steps in the following article:
Since the example isn't 'sharepoint enabled' I had to incorporate the steps seen in this article to register the app on the sharepoint site.
My specs are these:
LS HTML App, SharePoint enabled, Provider Hosted, SharePoint Data Source (no database)
Published to Azure Website
Aside from being extra careful to copy the secret values from sharepoint appregnew.aspx into the LS publish wizard and doing the same for the azure web address, the main thing I took away is that the site collections specified on the enable sharepoint window and in update datasourse window had to be the same (that is, if you're using SPO lists as your datasource).
Getting it installed on my SharePoint Online Developer Site wasn't a problem, but installing in the App Catalog for use on other sites was difficult. This is not a LS problem per-se it's par for the course using sharepoint app model.
It would be nice if someone could do step-by step blog specifically about publishing a sharepoint- enabled, provider-hosted LS app to Azure (including what changes need to be made if the same app is later published to a different SP site via app catalog, having SPO lists as datasource)
As I said, we're 'aways away' from a friendly deployment experience for sharepoint apps. The fault is not entirely on LS team since SP2103 app model is unfriendly too.
Tell us your specs and we'll see if we can help further. For example, are you using SPO lists for your datasource? Are the lists on the same site on which you're registering and installing the app?
PS> I got a white page with 'you don't have permission...' a few times in my trials. It seemed to happen when I wasn't logged into the Sharepoint site, or when the SP site on 'Enable SharePoint' page differed from that which I was logged into. Take away: you cannot simply register and upload the .app package to many sites even if your same o365 credentials are valid on those sites. You need to do the appregnew.aspx then change secrets in LS pub wiz as well as change the sp url on enable sharepoint window every time you publish to make a new .app file for each site.
I'm about to contradict myself, but I found something interesting today...which simplifies deployment a bit...
1) Let's say you have a SharePoint-Enabled, Provider-Hosted app that you want to install on several SPO site collections in the same O365 tenancy...this means you have to go to each site and use appregnew.aspx to get the ClientID and Secret then put those in LS pub wiz then publish, upload, deploy the .app file...the whole process has to be repeated for each site you want to install the same app since the secret is different.
Solution: Use Seller Dashboard to get the secret like so:
Now you can skip the appregnew.aspx, publish from LS only once and upload the .app to you AppCatalog once then deploy to many sites in a batch!!! (I believe the same .app file can be uploaded to AppCatalog of other tenancies as well, as long as you don't use SP datasource) Big win!
2) Now say the app has SharePoint Online Datasource (same tenancy) and you want to deploy the app to a site collection other than the one that was specified in LS pub wiz...You can do that and the app will launch, but permissions to the lists on the other site collection will fail so LS will display an error.
Solution: Alter AppManifest.xml in SharePoint Project to request tenant permissions like so:
Voila! Now the app can be deployed anywhere in the tenancy and the sharepoint lists will be accessible. In this case the datasource URL used in LS pub wiz specifies the lists that all instances of the app will use.
Now if only LS team would allow changing the datasource url at runtime, we'd have full control!
You can vote for that bit here:
- Edited by joshbooker Tuesday, October 08, 2013 6:35 PM UV link
Thank you for your assistance in this Josh. I am in the middle of a new sample now the same as your with no external data (inc sharepoint lists). Can you advise...
What did you use as the start page in the app manifest? Did you leave it as the default sharepointlaunch.aspx?
Did you update the code in the app manifest and web config with the client ID and Secret or did you leave it "as is"?
All of those AppManifest settings are made by LS from values you enter in the LS Publish Wizard. The only thing I changed manually in the AppManifest was changing the permission from Web to Tenant.
In LS Pub Wiz I left the default sharepointlaunch.aspx and entered ClientID & Secret from Seller Dashboard.
PS.. Seller Dashboard required a 'redirect URL' which is not required by LS. I used the following:
Well at least I can rule out fiddling around with that. So I can see that I am doing everything the same as you but I am getting my client ID from appregnew in my production site not the seller dashboard. (though I think you may have been doing that earlier and it still worked - please confirm).
I am using a simple one table, 2 screen app with no external connections (or SP lists), and my website has a database.
I am using the production site in enable SP, and I am sure I am logged in.
This error still persists for me....
You do not have permission to view this directory or page.
The url it is trying to open is...
No joy I'm afraid...(same result)
It was step included in the original tut I specified. Anyway removing the id's from Azure didn't make any difference:(
The reason I want to use provider hosted is to keep my data safe, and to capitalise on the "created by" and "person" etc field facilities. If I use an external data source such as azure or access I wont have these options. I don't want to use SharePoint LIsts as the data set is too large.
How exactly are you installing and launching the app in your SPO environment? Something like the following?
thanks again for your interest Josh. Unfortunately I am installing it exactly like that.
I think my issues may be azure related. I just attempted a stand alone Azure web app with forms authentication (which I have done successfully many times before in VS2012) and I am getting Server Error in '/' Application. on the web site after deployment.
Investigating this now.
I ran into this same “permission” issue the first time I attempted my first provider hosted sharepoint to an azure website. Publishing as a Sharepoint hosted app worked fined as did the Sharepoint Dev site.
As others hint above, my solution was to follow this process…
First a brief description of my app…
Hosted on an Azure Website and only references oData feeds back to my Enterprise (no local data on Azure). I wanted to create a provider hosted sharepoint app (manifest) that redirects to the app published to the Azure site.
Enterprise oData >>> Azure Website HTML Sharepoint Enabled >>>> Sharepoint Catalog
1. Create the VS 2013 LightSwitch HTML app and enable for Sharepoint
2. Create your account in the Sharepoint Seller Portal located at:
Create a client oauth ID for your app and save the client ID and secret key. No need to wait to be authorized for app publication
Note: When defining the redirect URL, you only need to root URL of the Azure website:
No need to include "/htmlclient…" as one might consider since it’s a LightSwitch HTMLClient App
3. Publish the App from LightSwitch 2913 (VS 2013)
Here are the screen steps described verbally>>>
SharePoint Options: Provider Hosted
Application Server Configuration: Windows Azure
Subscription: Sign in and select your subscription – I was using a Partner Network Subscription
Service Type: in my case I was using a website
Service Configuration: I select the domain prefix for my Azure WebSite
Security Settings: Yes for HTTPS
Data Connections: Confirmed my local oData feed sources
Sharepoint Authentication: Use client secret key (ACS connected): past in your secret key from the seller portal
Sharepoint Client ID: Past in your client ID key from the seller portal
Worked first time out of the gate !!!
This is still soooo not working for me. I have tried all recommended strategies. My only workaround is to publish the app to Azure directly, then create a second autohosted app using the data from the first app as external data. This is a pain however as you have to write code into the modified/created fields.
Why doesnt it JUST WORK?
Is anyone else still experiencing this as an issue?
Sorry this is still troubling you.
I'd suggest a new LS project, new Azure Website and use the seller dashboard to get client id and secret. That should eliminate all issues with your LS solution, existing Azure site and sharepoint app registration respectively. I'll bet the prob is with app reg and seller dashboard is the fix.
If that works then reintroduce appregnew.aspx should you not want to use the seller dashboard. Then reintroduce your existing azure site should you want to. Lastly try to make it work on your existing LS project if that a requirement.
If that doesn't work then perhaps it's time for drastic measures...you could start a new trial azure account and new trial O365 account until you eliminate and thus identify the problem area.