Deploying a ASP.NET web app to Elastic Beanstalk. Trying to find the proper way to deploy the app from Visual Studio using the AWS extensions. I've read up on the AWS ebextensions config files but I've also seen something on SO that there's quirks with ebextension files and Windows deployments. What I want to do is deploy my web app which relies on many private .NET dlls that need to go in the web site's bin folder. Right now I reference them directly from the project itself and mark them as 'Content' and 'Copy If Newer' in VS. Wondering if the better alternative is to package up these bin files, upload them to S3 and use the ebextensions to get them installed as part of the deployment process for an EB app. I'm struggling with how to properly do the latter idea. Any ideas on best practices for this case?
You cannot. The dependencies required for any application should be included in deployment package.
I'd suggest you to adapt best practices and get rid of the DLL's included in your project folder. You can create packages for your dependencies and reference them from any other project. Take a look here. This way you can prevent duplicate dll's in deployment package.
Related
Our current CI pipleline uses Team City and Octopus deploy but I'm evaluating changing this to Azure Devops doing both the build and deployment.
The solution we have consists of some ASP.NET code stored in GitHub which is compiled by Team City and then that along with some other packages which don't change are all deployed to a server. The directory they deploy to is wiped so that it is a fresh install each time.
So far I've managed to create the build pipleline and am then using the IIS deployment process to deploy the build (haven't got it to wipe the existing site yet).
What do I use for the other parts of the solution which are static though? In Octopus these are stored in the package library and have been manually uploaded. Should I be looking at Azure artifacts for this?
Also how should I go about deploying these? Should I create multiple web app deploy steps, do something different or is there a way to select multiple packages on the one web app deploy step?
As the Package library in Octopus deploy (last time is used it) is setup as a Nuget feed, it's a pretty fair comparison. Azure Artifacts allows you to upload several package types including Nuget, so you should be able to use that the way you did the package library.
As for the cleanup of you site, it depends a bit on the task you use during the release.
If you are using the 'IIS web app deploy' step, checking the 'Remove Additional Files at Destination' box would fit your needs.
As you refer to your target environment as 'a machine' i'm not sure what kind of infra you are you using but in case of some IaaS setup powershell remoting[1] might also be a way to go.
[1] https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/
You can still use Octopus packing and deployment steps in your Azure DevOps pipeline by installing the extension here.
What you can do with your static content is to include it in your code repo in a way that gets compiled and packed by Octopus and the deployed as a whole. However, if moving the static content from Octopus to your code is not allowed, then you could try handling the merging of the compiled solution plus static content via adding different process steps in Octopus.
The equivalent of the package library was Azure Artifacts. I has the functionality to be set up as a NuGet feed however I had issues publishing into it. Potentially due to two factor authentication.
My eventual solution was to set up repos containing the static files each with a pipeline that just copied files and published an artifact at the end.
I am trying to create a web app using ASP.NET core, d3.js and jquery. I hired someone on upwork to create the app. He was able to get it working on my local machine by adding libraries d3, jquery, and others under wwwroot/lib. However, on the remote github repository, these libraries are not included. I have seen others on stackoverflow also not include the libraries when pushing to remote and was wondering why this is the case.
I would like to publish my app using Azure, but when I do this I get an error and I believe it's because the libraries are missing. I know that I can just add the libraries to the remote repository, but I don't think this is the correct method. how are the libraries added with MS Azure?
You can add this to a inside your .csproj file to enforce copying NuGet assemblies to the built output:
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
However, note that the build output (bin/Release/netcoreapp*/*) is not supposed to be portable and distributable, the output of dotnet publish is. As you have said, you get work in local, so copy the assemblies to the build output is probably very useful when the app is upload to azure.
For more details, you could refer to this SO thread.
I'm building a selection of servers with .Net core 1.1 that are grouped together in an environment and I use an ARM template to create the various Azure resources I need. Currently however I have to manually deploy the actual servers, rather than having ARM deploy the artefacts for me as I'd like.
The instructions here don't work for netcore apps, but it feels like with the move to msbuild for netcore 1.1 I should be able to do this.
I've tried searching the quickstart ARM template repository, but can't find anything relevant.
The biggest stumbling block seems to be that "Web Deploy for Web Apps" needs a zip file, but dotnet.exe doesn't produce one.
you can zip the output of "dotnet publish" and use this .zip file for the deployment.
Make sure there is no root folder in the .zip. For example:
publish.zip
- bunch of .dll files
- wwwroot
- Views
...
I hope this will help you,
KirK
I know you can copy a Website intact to the server and have it run normally (security and compilation time aside).
What about the projects that are in the solution? [whose dll's are copied to the bin when built]. Is there a way to copy the projects' code files to the server as well?
My goal is to be able to debug [by modifying code in the project if needed] directly on the server without having to install an IDE [or keep building on dev machine and copying over dlls]. I can debug/modify the website files, but not the projects.
EDIT: to clarify, not just debug, but be able to edit.
So long as you upload both the DLLs and the PDBs, you should be able to debug successfully without the raw projects on the server. It can be augmented if you have open the matching project / solutions locally. There really isn't a requirement to upload solution, project, or raw code files to the server to debug effectively, remotely. It should be noted that breakig while debugging will hang the app domain on the target application, and as such, should be done with caution in a multiuser environment.
You do not need the project files in order to debug files.
You should read about remote debugging.
Update:
What you want to do sounds very dangerous in a production environment. If you want to develop, develop locally.
Regardless - project and solution files are organizational tools in visual studio as well as build files for the MSBuild build tool. If you don't have either visual studio or MSBuild installed on the server, there is little point in having the project and solution files on it.
Why do you need to develop on a production machine?
I am looking for some ideas on how to offer a installation package for my ASP.NET website. Some things I need to be able to do is read/write Registry keys, get the database(s) information and test the connection and I must be able to overwrite the existing website without an uninstall and update the web config on new versions. I do not wish to uninstall the website and re-install it. I would like minimum downtime on upgrades. I think I am going to have to implement a custom solution and if this is true how can i include all the output of my web application into my custom solution?
EDIT: I am not installing this on my own system(s). This is for distribution to other clients who will be installing/upgrading the website. It is important that I be able to upgrade to the latest asp.net website without uninstalling. Ideally it would be overwriting the existing site and updating the web.config file.
Option 1. Create web application installation package
Use Web Setup Project for creating a web application installation package (.msi)
Creating or Adding a Setup Project at MSDN
You can create your installation the way it will offer user an Upgrate option of your application if it's already installed on his or her machine. That's not a problem.
Alternatives to Web Setup Project (all of them can handle upgrade scenarios):
Wise Installation Studio
InstallShield
Nullsoft Scriptable Install System - this one is free and open source
Optoin 2. Deploy web application on the server
You can use NAnt or MSBuild or IIS Web Deployment Tool for these tasks automation.
For example with NAnt of MSBuild you could specify tasks like these:
get project files from source repository
update .config file and maybe some other files if needed
compile you web application
update registry settings on the server
update database schema on the server
synchronize files (x-copy) between you build folder to IIS web folder
Web Deployment Blog
Option 3. Distribute your web applications via Web Plafrom Installer.
http://www.microsoft.com/web/
Have you looked into Web Deployment Projects or the IIS Web Deployment Tool?
I think you can build asp.net application into .msi package and install it. Is that what you are looking for? And then you can build all of your customization into pre-deployment and post-deployment scripts.
I use NAnt and NSIS with some small console apps where they can't easily do some manipulations I require.
Do you tried the new Microsoft Web Platform Installer (new! 2.0 beta)?