none
How to Publish Multiple SharePoint-enabled LightSwitch apps to a single Azure Website or Cloud Service?

    Question

  • Now that we've been forced into the provider-hosted publishing model for our SharePoint-enabled LightSwitch apps, is there a way to publish multiple apps to a single Azure website or Cloud Service?

    Although it wasn't my decision to go this way, we have dozens of small apps, focused on a particular set of tasks, accessed through a SharePoint list of links, instead of a single app to handle everything. But it's looking like a new Azure website (or Cloud Service) needs to be created for each app.

    Has anyone found a way to do this? Or can someone from the team comment on this scenario please?

    I *finally* have a public blog now (A Reluctant Web Developer), so I'll be starting to blog about my experiences as "a reluctant web developer". I have a number of posts that have been added to several different iterations of the blog (DNN, SharePoint etc), so when I get the time, I'll start moving those over to the public blog. To leave a comment on a post, you'll need to register on the website (to prevent link spamming), but I won't be harvesting any email addresses to sell anything to anyone.

    I've already documented the steps I've needed to go through to publish a provider-hosted LightSwitch app, but I'd just like to solve this aspect of it before putting it in a blog post.


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Monday, June 30, 2014 3:00 AM
    Moderator

Answers

All replies

  • Anyone?

    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Tuesday, July 1, 2014 9:02 AM
    Moderator
  • Thanks for the link (which I'd actually already seen), but how does it address the problem of publishing multiple apps to the same website or cloud service?

    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Tuesday, July 1, 2014 11:27 PM
    Moderator
  • My understanding is that if you have an .app file (I assume this is what you mean when you are saying "app") it has to have a single Client ID and Client secret, so you would need to have separate apps.

    That is why I thought you wanted a link that would allow a single app to respond to multiple clients.

    The only other thing I can think of is to use the Deep Linking to allow a person to pass in a parameter and your app would behave differently.

    However, you wouldn't want the person to have to make those links themselves.

    My next article was going to try to make a Cloud Business App not show full screen:

    This should allow a person to:

    1) Install the APP

    2) See links for each "part" (as you describe)

    3) Use Deep Linking to provide the functionality


    Unleash the Power - Get the LightSwitch HTML Client book

    http://LightSwitchHelpWebsite.com

    • Edited by ADefwebserver Tuesday, July 1, 2014 11:56 PM added more links
    Tuesday, July 1, 2014 11:43 PM
  • I appreciate your help Michael, however none of what you're suggesting seems to have anything to do with what I need to accomplish. Maybe I'm just not explaining it well enough, although it seems obvious enough to me.

    I'm wanting to be able to publish *multiple* individual LightSwitch apps to a *single* Azure website (or Cloud Service). These apps can then be installed in various SharePoint sites.

    If you reread my original text, you'll see that I've inherited these LightSwitch apps, which all perform small chunks of different functionality (but all use the same database hosted in Azure), which are currently (auto) hosted on various business's SharePoint sites/subsites, instead of one bigger app that has all the functionality in it. It's not really the way I would have designed the architecture of the product had I been creating it myself, but it's what I have to deal with, & what I have to make work.

    Now that we've been forced into using the provider-hosted model for new apps (& we're still creating new apps), instead of the auto-hosted model, my client isn't very happy about having to create a new website for each different app. We have one "product" that consists of almost a dozen "modules", all used by different people in the business who have different roles, so they don't all need to use the same functionality. Think of factory workers vs office workers etc.

    We already handle multiple tenants in the apps themselves (with the one external Azure database, so we weren't affected by that part of the provider model change), & have been doing so for a while now.

    While there are multiple articles out there that address different aspects of using the provider-hosted publishing model for SharePoint apps, there's absolutely nothing specifically written for SharePoint-enabled LightSwitch apps (aka Cloud Business apps), nor is there anything that explains how to (if it's possible) to host more than one LightSwitch app per Azure website. That's why I posted this question.

    Does that help explain what I'm asking?


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Wednesday, July 2, 2014 8:55 AM
    Moderator
  • Hi Yann,

    You may not be able to auto publish from with LS, but could you not just FTP deploy each LS App to a sub-folder on the same website? This works under IIS so I cannot see why it would not work under an Azure website, although I've not experimented with an Azure website before (although I will in the near future do so), so you would have something like the following:

    • root/AppOne/
    • root/AppTwo/
    • root/AppThree/
    • Etc

    Each of the sub-folders would have the entire App, including it's web.config and Web/bin/HTML sub-folders. You could put a default.aspx/html page in the root folder that automatically redirects to the default App in the default sub-folder.

    Any reason why that will not work?


    Regards, Xander. My Blog

    Wednesday, July 2, 2014 10:29 AM
  • Hi Yann,

    You may not be able to auto publish from with LS, but could you not just FTP deploy each LS App to a sub-folder on the same website? This works under IIS so I cannot see why it would not work under an Azure website, although I've not experimented with an Azure website before (although I will in the near future do so), so you would have something like the following:

    • root/AppOne/
    • root/AppTwo/
    • root/AppThree/
    • Etc

    Each of the sub-folders would have the entire App, including it's web.config and Web/bin/HTML sub-folders. You could put a default.aspx/html page in the root folder that automatically redirects to the default App in the default sub-folder.

    Any reason why that will not work?


    Regards, Xander. My Blog


    If that does not work with the Azure Websites, you can use an Azure VM (costs about $60 a month) and implement this.

    Unleash the Power - Get the LightSwitch HTML Client book

    http://LightSwitchHelpWebsite.com

    Wednesday, July 2, 2014 12:03 PM

  • I'm wanting to be able to publish *multiple* individual LightSwitch apps to a *single* Azure website (or Cloud Service). These apps can then be installed in various SharePoint sites.

    If you reread my original text, you'll see that I've inherited these LightSwitch apps, which all perform small chunks of different functionality (but all use the same database hosted in Azure), which are currently (auto) hosted on various business's SharePoint sites/subsites, instead of one bigger app that has all the functionality in it. It's not really the way I would have designed the architecture of the product had I been creating it myself, but it's what I have to deal with, & what I have to make work.

    Now that we've been forced into using the provider-hosted model for new apps (& we're still creating new apps), instead of the auto-hosted model, my client isn't very happy about having to create a new website for each different app. We have one "product" that consists of almost a dozen "modules", all used by different people in the business who have different roles, so they don't all need to use the same functionality. Think of factory workers vs office workers etc.






    You might also check out BlogOfAnITGuy's LightSwitch 2013 – Multi-HTMLClient Project.  The blog post isn't specifically SharePoint enabled, and that will need to be tested by you, but it does have some other things you seem to be looking for:

    "In this post we will show you how to create a LightSwitch 2013 project that contains multiple HTMLClients. It’s a pretty exciting development, as we can now create apps for specific areas, Admin vs. Worker, and all share the same data source within a single solution. We have tested deployment to Windows Server with IIS and Azure with no issues or workarounds.

    A side benefit is app payload. We can break up large enterprise grade apps into multiple clients thus keeping the individual downloads to a reasonable size."

    Thursday, July 3, 2014 3:12 PM
  • @Xander

    Thanks for the suggestion. I'll have a look into what you've outlined, but I have serious doubts that the client will go for such a process. Their clients' businesses depend on their solutions, all based on O365, SharePoint, Azure, & LightSwitch apps. They chose LightSwitch apps because, as presented, they appeared to solved their business need.

    @Michael

    These guys already spend well over $600/month on Azure services (so they're already "on board" in a big way with Azure already), plus O365 subscriptions everywhere, but they're not happy that simply because Microsoft have decided to "change their minds" (& so suddenly) & then announce that the method we've been urged to use by them for the last couple of years was actually a "preview" which they're now discontinuing, without any viable alternative. And I for one don't really blame them.

    @Allen

    Unfortunately, unless things have now changed, multiple clients is not possible once you SharePoint-enable a LightSwitch app. I was already excited about that approach, until I tried it out a while back & found that it didn't work for SharePoint-hosted apps. A pity, because that might have been a viable possibility. Buy there would have been other problems with that approach as well, so I don't know if I would have been able to persuade the client to go that way anyway.

    @everyone

    Thanks for the suggestions guys, I really appreciate the attempts to help. The client doesn't want to have to change their deployment processes, and they don't mind spending money when it's required. As I've already stated a couple of times, I wouldn't have gone the multiple small app route personally, but these guys have valid business reasons for wanting to go that way. This is the kind of thing that has always made me dubious about people about putting their businesses "in the cloud", in that whoever owns & controls the cloud services being provided can simply change what they offer at any time. The more invested their business is in "the cloud", the more helpless they are in the face of such changes.

    @The LS Team

    Can I please get an answer to what I've asked? My client's probably not going to like it if the answer's "no", but at the moment I feel like a parent in a LONG car trip, with kids in the back seat asking "have they answered yet?""have they answered yet?""have they answered yet?", so any "answer" would be helpful right now.


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Friday, July 4, 2014 12:17 AM
    Moderator
  • A side benefit is app payload. We can break up large enterprise grade apps into multiple clients thus keeping the individual downloads to a reasonable size."

    That was a big part of their reasoning for using multiple LightSwitch apps in the first place. But they have a big investment in SharePoint solutions, & have integrated LS apps into various SharePoint sites, & they use SharePoint permissions, not LS permissions, to control who can access what.


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Friday, July 4, 2014 12:22 AM
    Moderator
  • The publishing of the multiple apps only happens when you initially deploy the apps and when you update those apps. It does not seem to me to be a big bother if you have to do those deployments via FTP instead of auto publishing from VS. And that process is totally transparent to the client.

    Regards, Xander. My Blog

    Friday, July 4, 2014 12:26 AM
  • Being curious, I attempted to publish from VS to a Azure website virtual directory as Xander suggested, and cannot get the pub wiz to do it.

    This is true for vanilla html app also.

    Then I tried to FTP the published app into the virtual dir which is easy but still doesn't work.

    I think some step is missing on the azure service definition or something(?)

    I did not try an Azure cloud service.

    This used to work from pub wiz to IIS so Michael's suggestion of using an Azure VM might be the ticket.

    Kinda silly this doesn't work...more troubling is that there has been no answer from, say, Dave Kidder on this thread.

    Josh

    • Edited by joshbooker Friday, July 4, 2014 2:35 PM iphone can't post
    Friday, July 4, 2014 11:43 AM
  • Sorry guys, been swamped the last week and didn't get out here, I will take a look at this today.

    David Kidder | Senior SDET | Microsoft | LightSwitch

    Monday, July 14, 2014 5:55 PM
    Moderator
  • Just wanted to let you guys now that I have been working on this and will blog about it, hopefully Monday.

    David Kidder | Senior SDET | Microsoft | LightSwitch

    Friday, July 25, 2014 9:04 PM
    Moderator
  • Dave Kidder is the man. Have nice weekend
    Friday, July 25, 2014 9:16 PM
  • How to Host Multiple Cloud Business Apps on the Same Azure Web Site

    David Kidder | Senior SDET | Microsoft | LightSwitch

    Monday, July 28, 2014 8:00 PM
    Moderator
  • This doesn't work on several Azure websites.  It publishes fine but I get 500 error in the browser.

    I think the prob is I've published once to the root of this site prior to publishing to a virtual directory.

    Any idea how to clear out the root of an azure website?

    TIA,

    Josh

    Monday, July 28, 2014 9:10 PM
  • Yes, you can't have stuff in the root, my post assumes that you started from scratch.  There are a couple of ways to clear out your website.

    1. Delete it and add it back
    2. Use your favorite FTP tool and delete everything (WebMatrix might be the easiest one to use as it has support for logging in with your Azure credentials and then it finds all your sites).

    David Kidder | Senior SDET | Microsoft | LightSwitch

    Monday, July 28, 2014 9:18 PM
    Moderator
  • Thanks Dave.

    I have deleted everything using FTP, but something remains cuz it's presenting the 'you don't have permission to access this site' - same as when you browse a SP enabled app without going through sharepoint redirect.

    I'll try to delete and add back, hope it's quick and I can get the same name.(?)

    Monday, July 28, 2014 9:26 PM
  • Yeah, we've had SO much trouble with this whole provider-hosted mess that we've had to come up with a way that bypasses using SharePoint-enabled LightSwitch apps all together. We've also raised an MS Partner support case.

    And guess what? You can't un-SharePoint-enable a LightSwitch app any more like you used to be able to do. And even bypassing SharePoint itself still results in the same permissions error if the app is SharePoint-enabled. So we're having to recreate all of our LightSwitch apps from scratch.

     

    I really wish that the Office team would stop screwing around (sorry, "improving") with LightSwitch, which used to be a solid product that I loved using. Now there's so many things that have become so complicated (& that can go wrong) that using LightSwitch is actually costing us money in wasted development time spent trying to figure out what's going wrong, & even worse, now having to recreate every app, just to get them all working again.

     

    Microsoft really should have made absolutely sure that this all worked properly before cutting us off.

     

    Sometimes the "Register an App" wizard fails with the dreaded (useless) SharePoint error message that is apparently well-known by SharePoint developers. Other times, if you're lucky you'll make it through the registration process, only to get the same error when you try to install the app on a site. And I've tried both the site's registration wizard & the SP Seller Dashboard, the result has been the same. And if you're even luckier, you'll manage to install it, only to get the "you don't have permission to access this site" error message.

     

    I'm pretty confident that I've got the steps required all sorted out, I have actually got this working a couple of times. But the whole process seems to be so "flakey", it's hit or miss all the time. Eventually we gave up & went looking for a way around using SharePoint other than as a link repository.

    If I sound annoyed, that's because I am. My name is mud at the moment, because I'm "the LightSwitch guy", who can't get the process to work consistently.


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Monday, July 28, 2014 11:52 PM
    Moderator
  • I've marked Dave's post as the answer to my question, but I'm not actually in a position to be able to test it out at the moment.

    I look forward to hearing about how anyone who tries his method gets on, if maybe not to the inevitable "it's great, it's so simple, it works" blog post that's sure to follow (& that's not directed at you Dave - I really do appreciate you taking the time to investigate this).


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Tuesday, July 29, 2014 12:08 AM
    Moderator
  • Eventually we gave up & went looking for a way around using SharePoint other than as a link repository.

    @Yann - do you mind elaborating a bit on the above please? Are you still hosting in Azure but but not as ar SharePoint app? How are you still using Sharepoint as a "link repository"?

    Thanks


    Regards, Xander. My Blog

    Tuesday, July 29, 2014 10:13 AM