Publish Project to AWS

From MgmtWiki
Revision as of 21:07, 19 July 2020 by Tom (talk | contribs) (Deploying MSSQL on AWS)

Jump to: navigation, search

Full Title or Meme

Build and zip a Visual Studio dot net core 2.1+ Project for publication to Amazon Web Services.



  • Even though AWS is running almost standard Microsoft Widows images, there are some differences.
  • A certificate with key can be loaded into the cert store on Windows for the single instance (Windows Virtual Machine) only.
  • If an AWS load balance is used the cert can be obtained from AWS, but cannot be used with a EC2 instance.


From the website Deploying an ASP.NET core application with Elastic Beanstalk.

  1. Prepare a project with all dependencies marked.
  2. Ensure that the main project to be deployed by Visual Studio to AWS elasticbeanstalk has a folder in the root of that main project.
  3. Add a deployment file (see section below)
  4. from Powershell type "dotnet publish" (this and future commands are typed in the project directory)
  5. Now the deployment manifest file and a directory of all the files to be loaded up to the AWS elasticbeanstalk a ready for creating the deployment bundle.
  6. Run the Powershell script that creates the zip file of the code to install the soltuion and the zip that up with the deployment manifest.
  7. Upload the deployment bundle to the S3 instance for the app in AWS
  8. Open the AWS Explorer in Visual Studio (fro the View tab at the top ribbon)
  9. Navigate to the S3 file just uploaded and right click on the file, then click on "Create Pre-signed URL"
  10. Pick a time for the URL to expire that will allow the completion of the process and click "Generate", copy the URL so you don't lose it and click ok
  11. Go back to the project in Visual Studio to the .ebextenstion folder and the RunRegistry.config file of the main project that is being deployed
  12. Note that Visual studio thinks that .config files are xml, so don't open it in Visual Studio, but in Notepad (rt-click open with)
  13. Add the code single to that shown below to this file

Deployment File

 "manifestVersion": 1,
 "deployments": {
   "aspNetCoreWeb": [
       "name": "my-dotnet-core-app",
       "parameters": {
         "archive": ""
-- aws-windows-deployment-manifest.json
PS C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer> dotnet publish
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  SimpleService -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\SimpleService\bin\Debug\netcoreapp3.1\SimpleService.dll
  CredStore -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\CredStore\bin\Debug\netcoreapp3.1\CredStore.dll
  MonitorService -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\MonitorService\bin\Debug\netcoreapp3.1\MonitorService.dll
  RegistryServer -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer\bin\Debug\netcoreapp3.1\RegistryServer.dll
  RegistryServer -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer\bin\Debug\netcoreapp3.1\publish\
PS C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer>

Deploying MSSQL on AWS

The security consideration is that the SQL db should not be present on a publically accessible front-end server. As with a file system, front-end could read some tables and write different tables, but not be directly involved in updates or getting executable code from any writable memory. See the wiki page Web Site Security for more details.