Question regarding .net core publishing option on AWS

0

I don’t want to publish my (asp.net core app) all source code on aws, only the locally published / compiled dll files i want to push to aws.

Means, I want to publish my app locally first (.net core 7) and then I want to move the “published-app1” directory to AWS environment.

Will it work if I manually move the “published-app1-zip” zip file to S3, like I publish application from my visual studio console to AWS directly using “AWS Elastic Beanstalk” to S3 server ?

Or can I move the same way, the locally published files to AWS ?

profile picture
已提问 2 个月前142 查看次数
2 回答
2
已接受的回答

Theoretically [1], you can do it. Once the zip file is uploaded to an S3 bucket, you can create a new Elastic Beanstalk environment or update an existing one by pointing it to this S3 location.

ℹ️ For more information, you can refer to the section about the contents of the Elastic Beanstalk Amazon S3 bucket in the AWS documentation here.

Similarly, you can move your locally published files to AWS by manually uploading them to S3 and then deploying through Elastic Beanstalk. After packaging your application into a zip file post-local publication, uploading this file to S3 allows you to maintain control over the deployment process and versioning of your application.


[1] ⚠️ I haven't tried it myself, but the process is well-detailed in the AWS documentation on creating an application source bundle.

profile picture
专家
已回答 2 个月前
profile picture
专家
已审核 16 天前
profile picture
专家
已审核 2 个月前
0

Just so you know, if you use the AWS Toolkit for Visual Studio (which is an extension), you can publish directly from Visual Studio to Elastic Beanstalk. This does not copy your source code, it actually does a local publish first, then zips the files for you into a .zip file, uploads them to the Elastic Beanstalk service, configures the Elastic Beanstalk environment, and launches it, all automatically. The publishing wizard actually shows you all the commands it is using, so you can see what it's doing.

If your ASP.NET Core application does not have any Windows OS dependencies, I would encourage you to also consider publishing it as a Linux container to Amazon ECS (Elastic Container Service). The toolkit will create the Dockerfile for you automatically (if you haven't already added one using Visual Studio), build the container locally on your computer, and deploy it for you. And the AWS AppRunner service is even easier - you can just give it the location of your source code (in GitHub, or AWS CodeCommit), and it will build the container in the AWS cloud, and deploy for you, without even needing Docker on your own computer.

profile pictureAWS
Kirk_D
已回答 2 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则