-4

We are making a product. Up until now, it has been only a set of desktop apps. For the first time, we will soon start to build an Asp.Net core web app(asp.net core on the backend, blazor or angular for the front-end).

The web app should be deployable on Azure App Service and on a local server. We have to deliver a bundle or anything for them to install it on their servers. But obviously, we cannot deliver the code, visual studio and they publish where they want it. They should also be able to edit the appsettings.json

I guess that if the installation is on a locals server, they should deploy it on an IIS? Or some docker approach would be a better way(Didn't really test this since visual studio ask me to provide a docker container registry and I'm therefor not able to generate a docker image directly)

So what should I provide them in order to be able to deploy it on the cloud AND locally?

J4N
  • 19,480
  • 39
  • 187
  • 340
  • 2
    1) Your "blazor" markup is also back-end. It *IS* part of ASP.Net Core. It's all processed on the server: only the rendered HTML5/CSS/JS gets sent to the client. 2) Since it's a web app, users shouldn't have to deploy anything to their desktop. Just point them to the correct URL, and have them run it in their browser. 3) Deploying to Azure App Service is documented here: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-apps/ – paulsm4 Apr 09 '21 at 05:32
  • @paulsm4 1) not really, we will be using Blazor webassembly, so every html is computed by the browser. But that's not the question 2) sorry, but you don't understand. We are developing a product, that multiples companies will deploy on their own server, for their users. 3) I know how to deploy to Azure app service, I just don't know how to provide to my customers a way to publish this to their servers without providing the source code. – J4N Apr 09 '21 at 05:34
  • Sorry, I see that I used the term "local" which was probably misleading. By local I was meaning "Local server", not every desktop that will use the web app. I updated the question. – J4N Apr 09 '21 at 05:36
  • Least painful option will be dockerizing your current app https://docs.docker.com/engine/examples/dotnetcore/ – Martheen Apr 09 '21 at 05:49
  • @Martheen Thanks for the recommandation. Does this still allows to edit the config files? – J4N Apr 09 '21 at 06:46
  • https://medium.com/swlh/overriding-aspnetcore-settings-with-environment-variables-in-docker-e8bc4df61f7f – Martheen Apr 09 '21 at 07:02

2 Answers2

1
  1. You have many choices. There's no "one right answer".

  2. Whatever you choose, the "customer" is deploying your "App" to some "Server". The app is NOT deployed directly to users' desktops. It sounds like you already understand this, but it's worth emphasizing.

  3. So what's a "server"?

    • In ASP.Net days, a "server" was "IIS". That's still an excellent choice for ASP.Net Core/.Net 5
    • Azure App Service is another good choice
    • As Martheen suggested, "Dockerizing" your app is yet another possibility.
    • Since your platform is ASP.Net Core/.Net 5, you can choose other HTTP servers besides IIS
    • Since Azure is an option, you have many choices besides Azure App Service or Docker
  4. WHATEVER you choose, it's likely you'll need to give your customers DIFFERENT install instructions if they're deploying to different environments. The procedure for deploying an app to IIS will necessarily be different from the procedure for deploying to Azure App Service, or deploying a Docker image.

  5. Your "package" will necessarily include:

    • Your app
    • Your Angular front-end
    • .Net Core runtime
    • Blazor runtime
    • "Other" (config files, install scripts, etc. etc)
  6. Angular itself needs to be "packaged" for inclusion in your "app". Perhaps you've already built your ASP.Net Core project with an Angular Template. That would simplify things. Or perhaps you're using the Angular CLI; independent of MSVS/MSBuild. In any case, there must be some Angular "build step" in packaging your app.

  7. I would start here:

I hope that helps ... at least a little...

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • I'm not sure I agree about "There's no "one right answer"", in you answer you mention IIS, which is ruled out because that will not work on Azure App Service and except docker, I didn't see another proposition that would work at any server(including Azure app service which supports also docker container). So if there no "one right answer", what other way than docker would allow me to make only one bundle to target azure and a local server? – J4N Apr 11 '21 at 09:13
  • You're confusing a lot of different things. Q1: How can I deploy my app? A: There is absolutely no "one right answer". Rather, there are many, many viable choices you can pick-and-choose from. SEPARATE QUESTION: Q2: Is there a "one size fits all" procedure, such that I give my customer ONE binary package, and ONE written "install procedure" that will be valid for ANY possible platform? A: Probably not. And why bother? The Smart Choice is to target one "preferred" platform (e.g. Docker) and write ONE procedure. Then, if demand warrants, target others. – paulsm4 Apr 11 '21 at 17:23
  • Q1) My question is how to deploy on a local server and on the cloud, it doesn't seems there is a lot of option. Q2) Why docker isn't one fits all? In my company, releasing a software is a pain. You have to have PNR, a procedure, that is documented and signed by a lot of people, certified, and everytime you change anything you have to redo everything. So I'm looking for a way to have at least one way to do it for the cloud and on a local server(no matter how it's done on the local server). – J4N Apr 11 '21 at 18:13
0

Blazor server projects are pre-compiled as you publish them. You will get:

  • a main exe file

  • some dll files

  • whatever you've put into wwwroot (css files, icons, etc.)

  • a few config files, including web.config and appsettings.json

  • NO source code files

I haven't made any WASM projects yet, but I'm quite certain the same is true for those as well.

There are a variety of publishing options-- a folder that can be uploaded via FTP to an IIS server, publication directly to an Azure app service, and so on. My understanding is that WASM doesn't need any server at all-- it can even be served by a cdn.

Bennyboy1973
  • 3,413
  • 2
  • 11
  • 16
  • My question isn't about blazor. The blazor (webassembly) will be provided as static file by the Asp.Net core Server(as well as the API that will be used by the blazor app). The whole question is about what is the correct way to provide to my customer a package/... to deploy it on a local server or on an azure server. Beside, like I mentionned, I expect the answer to be the same no matter if I deploy an ASP.Net Core with a blazor webassembly frontend or with an angular frontend. – J4N Apr 09 '21 at 12:52
  • @J4N - Please clarify: Who exactly is "your customer"? End users (as I originally thought)? Or somebody/some organization that's going to deploy your web app to their own HTTP server (for example, to an IIS server, or to an Azure App Service instance)? For the latter, you need to 1) "Build" and "Publish" your project, 2) Send it to your customer, 3) Provide deploy instructions to your customer. Much depends on the customer's target environment. Look here for more details: https://learn.microsoft.com/en-us/dotnet/core/deploying/ – paulsm4 Apr 09 '21 at 18:32
  • `I expect the answer to be the same no matter if I deploy an ASP.Net Core with a blazor webassembly frontend or with an angular frontend` Except you mentioned Blazor, and it matters for the reason I stated. Blazor is pre-compiled for publishing, whereas other flavors of asp.net are not, so demanding that they be treated the same doesn't really make sense. – Bennyboy1973 Apr 09 '21 at 18:49
  • @paulsm4 it's for some companies that will deploy it for their employees. My question is really about how to provide the software to be deployed on cloud as well on local server. I can put some constraints though – J4N Apr 10 '21 at 05:27
  • @bennyboy1973 read again, I mentionned both. Blazor webassembly is only a set of html, Javascript and compiled dll to be sent over Http by asp.net core. The same as angular(except angular is compiled inside a js file and Blazor inside a dll) – J4N Apr 10 '21 at 05:30
  • Thanks for the lesson on what Blazor is. I guess my experience with actually deploying various flavors of asp.net project, in my own company and online, aren't needed after all. Glad you have it all sorted out, and good luck with your project! :D – Bennyboy1973 Apr 10 '21 at 06:03