Deploy the ASP.Net Framework Application to ECS

Navigate to the Amazon Elastic Container Registry service in the console. Create a new Amazon ECR repository named ecsaspnet for your image:



Click the ‘View push commands’ button at the top of the screen. publish-ecr-push-commands

Open a PowerShell as an Administrator command prompt and execute the commands listed in the above dialog from the ECS-ASPNET project’s folder. Unless changed, it should be C:\Users\Administrators\source\repos\ECS-ASPNET\ECS-ASPNET.

cd C:\Users\Administrator\source\repos\ECS-ASPNET\ECS-ASPNET

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin <ACCOUNT ID>

docker build -t ecsaspnet .

docker tag ecsaspnet:latest <ACCOUNT ID>

docker push <ACCOUNT ID>

You should see output similar output to:


Record the ECR tag from the docker push command above (Similar to <ACCOUNT ID> so that you reference it when deploying the CloudFormation template below.

Let’s deploy the ASP.Net application to the ECS Cluster with the CloudFormation template that we downloaded earlier

Navigate to the CloudFormation Console and create a new stack


Select the previously downloaded ecs.yaml file.


The required CloudFormation Parameters include the following:

Parameter Value
AppName ecswinservice (or any name of your choosing)
ECSCluster retrieve from recorded values (It should be ECS-ASPNET-Framework unless you changed it)
ECSImageName retrieve from recorded values (Similar to <ACCOUNT ID>
EcsClusterSecurityGroup retrieve from recorded values
SubnetID retrieve from recorded values
VpcId retrieve from recorded values


Click Next on Step 3 of the Create Stack Wizard


In Step 4, acknowledge that IAM resources will be created and click Create Stack


Once the Stack has successfully completed, switch the output tabs, and click on the URL for the ALB


Congratulations! You have successfully deployed the .NET Framework 4.8 application to ECS.