I have been working with docker for some days and since I am trying the possibilities of docker, recently faced a problem about how to deploy an ASP.NET core app in a webserver inside Docker container. Deploying an ASP.NET 4.5 app is successful using IIS and WindowsServerCore but can anybody suggest how exactly to containerize a webserver running asp.net core app.
PS. I don't want the app to run in debug mode so I do not want "dotnet run" answers please. I want the built version of the app to be deployed in the webserver, any suggestions as to how?
Related
I am stuck from 3 days on deploying asp.net web application on Linux sever
Please help me for this solution
This tutorial - Deploy a Docker based ASP.NET Core app to Azure will help you. Also refer this youtube video on deployment to docker on linux server.
I have a droplet in Digital Ocean with Ubuntu 20.04 and a .NET Core web application that connects to Mongo.
My deployment workflow is the following:
I work locally with Visual Studio and release my app to a folder.
Then I connect to my server through FTP and drag the content of my folder to /var/www/myapp
Secrets are managed by Azure (it took me a lot of time to set this up).
A service runs the app and restarts it if needed.
The web server is Nginx
Everything works fine, nothing new so far. However, I'd like to automate each deployment and I found GitLab can run a pipeline to help me achieve that. The problem is I don't understand how to set this up correctly since I've seen there are more partes involved, such as Docker and Kubernetes, and I feel a bit overwhelmed.
Do I need to "dockerize" my application, database, etc.? If I want to add Angular as the client side, do I need to dockerize it as well or it goes in the same container as the .NET Core app?
Do I need Kubernetes? If so, why?
What would be the most straightforward and recommended way of achieving a CI/CD for my app?
It took me a lot of effort to deploy to my Linux server and I'm afraid I can destroy something in production.
I would really appreciate any help.
I am deploying 2 different projects in an azure web app service. The service is configured to be running dotnet 5. I am using virtual directory to deploy 3 applications in this app service. The default app, a dotnet 5 app, runs fine. On the first subsites if I deploy a dotnet 2.1 app, that works perfectly. But when I try to deploy a dotnet 5 app on the second subsite it shows the mentioned error in question - added an image of it
As far as I understood this is probably happening because they share same application pool. I tried the following stuffs:
Deployed as a self-contained app
Added AspNetCoreModuleV2 and out of process tags in csproj files of all projects as per this answer (and a few more answers from that link)
Frankly speaking I couldnt find much help in the net and not really sure how to proceed with this.
How can I deploy a .NET Core app with Angular? I don't want to use Azure.
The question is rather wide, but ye, there is no requirement for using Azure. (Of course, there are a lot of teams using .net core but running on AWS or GCP)
So first of all, you need to decide the running environment: Linux (NGINX/Apache), or Windows (IIS/Window Service). Then you need to config the app to point to correct folder.
Then you have the option to build and publish the code (either automatic by git or manual)
Also refer to https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/?view=aspnetcore-2.2
I've got an ASP.NET 5 project that I'd like to deploy to a remote server. I don't have remote desktop access to this machine, otherwise I could follow the same method most people use when deploying to IIS.
I'm able to deploy to my IIS 8.5 just fine on the same machine as my development. First I package my project to get the approot and wwwroot directories. Then, I point IIS to my wwwroot, and all works fine.
The problem is trying to deploy remotely. Normally I would zip up my MVC 5 project and use the IIS gui to 'import' an application.
That doesn't work for my MVC 6 project. Either I'm zipping it up incorrectly or MVC 6 projects can't be deployed this way.
How do you publish a vNext application to a remote IIS server?
Edit:
Just FYI, I am using Microsoft's Web Deploy Remote Agent to deploy this to the server. http://www.asp.net/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-(remote-agent)
It works perfectly for MVC 5 apps, because developers can easily deploy web apps and IT can restrict access to the machines, but the problem is trying to deploy MVC 6 apps using this agent.
I'm not questioning how to deploy MVC 6 projects to IIS, because that's already answered Here, this is concerning how to remotely deploy to IIS.
I solved this by updating to Web Deploy 3.6. The newest version includes a specialized provider for deploying ASP.NET 5 applications.
Details on how to use it can be found with this blog post:
http://azure.microsoft.com/blog/2014/08/11/web-deploy-3-6-beta-released/
The download link is as follows:
http://www.microsoft.com/en-us/download/details.aspx?id=43717
Use the contentPathLib provider or enable contentlibextension.
Example usage:
C:\Program Files (x86)\IIS\Microsoft Web Deploy V3> msdeploy
-verb:sync -source:iisapp=C:\release\Publish\wwwroot -dest:iisapp="Default Web Site/ExampleApp",computerName=machinename -enablelink:contentlibextension
To my knowledge, there isn't a GUI supporting these deployment methods yet. I assume this is because vNext is in Beta, and is expected to have breaking changes.