Update on our new Amazon .NET Deployment Experience

海外精选
海外精选的内容汇集了全球优质的亚马逊云科技相关技术内容。同时,内容中提到的“AWS” 是 “Amazon Web Services” 的缩写,在此网站不作为商标展示。
22
0
{"value":"Last spring [we announced the preview](https://aws.amazon.com/blogs/developer/reimagining-the-aws-net-deployment-experience/) of our new AWS deployment tooling for .NET. We have been very busy adding new features since then, with new releases about every two weeks. Let’s take a look at some of the features we have shipped since the initial release.\n\n### **Getting Started**\n\nAs a reminder, the new AWS .NET deployment tool integrates with the .NET CLI. We are working on an integration with Visual Studio and hope to have more to share about that soon.\n\nTo get started using the .NET CLI, first install the tooling using the following command.\n\nBash\n\n```\ndotnet tool install -g aws.deploy.tools\n```\n\nThen, to deploy a .NET application to AWS just type ```dotnet aws deploy``` in the project directory. The tooling will walk you through getting your .NET applications deployed to AWS.\n\n### **.NET 6 Support**\n\nThe release date for .NET 6 general availability (GA) is coming soon. Recently, Microsoft released RC2 for .NET 6 with a go-live license. We will be sure that .NET 6 has a good home on AWS and have updated the deployment tool to support .NET 6 today, making it the easiest way to try out .NET 6 on AWS.\n\nIf you run the deploy command on a .NET 6 project it will help you containerize your application. With your application containerized you can easily deploy the .NET 6 application to either [Amazon Elastic Container Service (ECS)](https://aws.amazon.com/ecs/) or [AWS App Runner](https://aws.amazon.com/apprunner/).\n\n\n### **AWS App Runner**\n\n[App Runner](https://aws.amazon.com/apprunner/) is AWS’s newest compute service for containerized web applications. App Runner is a fully managed service that makes it easy to deploy your application with very little infrastructure concerns. All you have to do is provide your image and settings and you are good to go. App Runner takes care of everything else for you, and also provides you an HTTPS endpoint for your application by default.\n\nFor web applications the deployment tool now provides App Runner as a deployment target. This makes it really simple to try out this new AWS compute service.\n\n### **Recommendation Updates**\n\nThe deployment tool provides recommendations that are tailored to the type of .NET application that is being deployed. Since our initial preview launch we have made the recommendations more flexible and powerful, but still kept them simple, to help you get deployed quickly.\n\n#### **ASP.NET Core Applications Deployed to ECS**\n\nThis recommendation helps you containerize your application and deploy it to Amazon Elastic Container Service (ECS). In the latest version of the tool we have added more options to the recommendation to enable you to customize load balancing and autoscaling. With these settings it is easy to deploy multiple applications to the same load balancer, to help when surfacing your multi-app architecture as single endpoint for your users.\n\n![image.png](https://dev-media.amazoncloud.cn/e0f6f24025e1453599b5483ff06a95f6_image.png)\n\n#### **Console Services deployed to ECS**\n\nThis recommendation can be used to deploy your backend services, for example, backend services processing messages from [SQS](https://aws.amazon.com/sqs/) queues. It is common for the load on these services to fluctuate, or just grow over time. With the latest version of the tool you can easily configure CPU and Memory based autoscaling triggers for your service.\n\n![image.png](https://dev-media.amazoncloud.cn/acaeed4f282a49bea1b6c69bb64eb6bc_image.png)\n\n#### **Blazor WebAssembly App**\n\nThe new AWS .NET deployment tooling is the easiest way to get your Blazor WebAssembly applications deployed to AWS. This recommendation now configures an [Amazon CloudFront](https://aws.amazon.com/cloudfront/) distribution to be the front endpoint for your applications. CloudFront provides low latency and high speed transfers, which are critical for Blazor WebAssembly applications, and an HTTPS endpoint by default.\n\n![image.png](https://dev-media.amazoncloud.cn/c81ea512a12840c6b760617e7b2fb79d_image.png)\n\n### **Scripting Deployments**\n\nWhen deploying applications the tooling provides an interactive experience to help you determine the right AWS service to host the application code, and helps configure the deployment to match your needs. This is great for learning how to setup a deployment. The end goal for most developers is to create an automated deployment and the AWS .NET deployment tooling can help with this.\n\nTo turn off the interactive features of the tooling, supply the ```--silent``` switch to the command. This will ensure the tooling never prompts for any questions which could block an automated process.\n\nThe settings for deployment can be supplied in a JSON file, which is specified using the ```--apply``` switch. Storing the settings in a JSON file also allows those settings to be version controlled.\n\nWe are working on providing additional documentation for the settings file, but below is an example. The file uses the IDs of the settings that are specified in the recipe definitions that the deployment tooling uses for generating its recommendations. The recipe definitions are available on [GitHub](https://github.com/aws/aws-dotnet-deploy/tree/main/src/AWS.Deploy.Recipes/RecipeDefinitions).\n\nJSON\n\n```\n\n{\n\t\"AWSRegion\" : \"us-east-1\",\n\t\"StackName\" : \"ZipCodeWebApi\",\n\t\"RecipeId\" : \"AspNetAppEcsFargate\",\n\t\"OptionSettingsConfig\" : {\n\t\t\"ECSCluster\" : {\n\t\t\t\"CreateNew\" : false,\n\t\t\t\"ClusterArn\" : \"arn:aws:ecs:us-east-1:123412341234:cluster/ZipCodeLookup\"\n\t\t},\n\t\t\"ECSServiceName\" : \"ZipCodeWebApi-service\",\n\t\t\"ApplicationIAMRole\" : {\n\t\t\t\"CreateNew\" : true\n\t\t},\n\t\t\"LoadBalancer\" : {\n\t\t\t\"CreateNew\" : false,\n\t\t\t\"ExistingLoadBalancerArn\" : \"arn:aws:elasticloadbalancing:us-east-1:123412341234:loadbalancer/app/ZipCode/f17b16d55f49d3ab\",\n\t\t\t\"HealthCheckPath\" : \"/api/healthcheck\",\n\t\t\t\"ListenerConditionType\" : \"Path\",\n\t\t\t\"ListenerConditionPathPattern\" : \"/api/*\"\n\t\t},\n\t\t\"AutoScaling\" : {\n\t\t\t\"Enabled\" : true,\n\t\t\t\"ScalingType\" : \"Memory\"\n\t\t}\n\t}\n}\n\n```\n\nUsing the ability to turn off interactive deployment prompts, and pass deployment settings in an external file, it is easy to configure any CI/CD system to deploy to AWS using the new tooling. For example, here is a GitHub action that installs the deployment tool from NuGet and then deploys the application to AWS.\n\n\nYAML\n\n```\nname: Deploy to AWS\non: [push]\njobs:\n deploy:\n runs-on: ubuntu-latest\n steps:\n - name: Configure AWS Credentials\n uses: aws-actions/configure-aws-credentials@v1\n with:\n aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n aws-region: us-east-1\n\n - uses: actions/checkout@v2\n - name: Setup .NET 6.0\n uses: actions/setup-dotnet@v1\n with:\n dotnet-version: '6.0.x'\n include-prerelease: true\n\n - name: Install AWS .NET Deployment Tool\n run: dotnet tool install -g AWS.Deploy.Tools\n\n - name: Execute Deployment\n working-directory: ./ZipCodeWebApi\n run: dotnet aws deploy --silent --apply ../deployment-settings.json\n```\n### Closing\n\nThe new tooling is being updated frequently with new features, and we’re really keen to hear your feedback on the tool, what you need, and how it can improve further to help meet your needs. Our aim is to make this tool the easiest way to deploy your .NET applications on AWS. Give it a try and let us know what you think on GitHub, where you can follow all the latest developments.\n\n![image.png](https://dev-media.amazoncloud.cn/ce9db890789b4165beb4d2a46b2a7943_image.png)\n\n### **[Norm Johanson](https://twitter.com/socketnorm)**\n\nNorm Johanson has been a software developer for more than 20 years developing all types of applications. Since 2010 he has been working for AWS focusing on the .NET developer experience at AWS. You can find him on Twitter [@socketnorm](https://twitter.com/socketnorm) and GitHub [@normj](https://github.com/normj).","render":"<p>Last spring <a href=\"https://aws.amazon.com/blogs/developer/reimagining-the-aws-net-deployment-experience/\" target=\"_blank\">we announced the preview</a> of our new AWS deployment tooling for .NET. We have been very busy adding new features since then, with new releases about every two weeks. Let’s take a look at some of the features we have shipped since the initial release.</p>\n<h3><a id=\"Getting_Started_2\"></a><strong>Getting Started</strong></h3>\n<p>As a reminder, the new AWS .NET deployment tool integrates with the .NET CLI. We are working on an integration with Visual Studio and hope to have more to share about that soon.</p>\n<p>To get started using the .NET CLI, first install the tooling using the following command.</p>\n<p>Bash</p>\n<pre><code class=\"lang-\">dotnet tool install -g aws.deploy.tools\n</code></pre>\n<p>Then, to deploy a .NET application to AWS just type <code>dotnet aws deploy</code> in the project directory. The tooling will walk you through getting your .NET applications deployed to AWS.</p>\n<h3><a id=\"NET_6_Support_16\"></a><strong>.NET 6 Support</strong></h3>\n<p>The release date for .NET 6 general availability (GA) is coming soon. Recently, Microsoft released RC2 for .NET 6 with a go-live license. We will be sure that .NET 6 has a good home on AWS and have updated the deployment tool to support .NET 6 today, making it the easiest way to try out .NET 6 on AWS.</p>\n<p>If you run the deploy command on a .NET 6 project it will help you containerize your application. With your application containerized you can easily deploy the .NET 6 application to either <a href=\"https://aws.amazon.com/ecs/\" target=\"_blank\">Amazon Elastic Container Service (ECS)</a> or <a href=\"https://aws.amazon.com/apprunner/\" target=\"_blank\">AWS App Runner</a>.</p>\n<h3><a id=\"AWS_App_Runner_23\"></a><strong>AWS App Runner</strong></h3>\n<p><a href=\"https://aws.amazon.com/apprunner/\" target=\"_blank\">App Runner</a> is AWS’s newest compute service for containerized web applications. App Runner is a fully managed service that makes it easy to deploy your application with very little infrastructure concerns. All you have to do is provide your image and settings and you are good to go. App Runner takes care of everything else for you, and also provides you an HTTPS endpoint for your application by default.</p>\n<p>For web applications the deployment tool now provides App Runner as a deployment target. This makes it really simple to try out this new AWS compute service.</p>\n<h3><a id=\"Recommendation_Updates_29\"></a><strong>Recommendation Updates</strong></h3>\n<p>The deployment tool provides recommendations that are tailored to the type of .NET application that is being deployed. Since our initial preview launch we have made the recommendations more flexible and powerful, but still kept them simple, to help you get deployed quickly.</p>\n<h4><a id=\"ASPNET_Core_Applications_Deployed_to_ECS_33\"></a><strong>ASP.NET Core Applications Deployed to ECS</strong></h4>\n<p>This recommendation helps you containerize your application and deploy it to Amazon Elastic Container Service (ECS). In the latest version of the tool we have added more options to the recommendation to enable you to customize load balancing and autoscaling. With these settings it is easy to deploy multiple applications to the same load balancer, to help when surfacing your multi-app architecture as single endpoint for your users.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/e0f6f24025e1453599b5483ff06a95f6_image.png\" alt=\"image.png\" /></p>\n<h4><a id=\"Console_Services_deployed_to_ECS_39\"></a><strong>Console Services deployed to ECS</strong></h4>\n<p>This recommendation can be used to deploy your backend services, for example, backend services processing messages from <a href=\"https://aws.amazon.com/sqs/\" target=\"_blank\">SQS</a> queues. It is common for the load on these services to fluctuate, or just grow over time. With the latest version of the tool you can easily configure CPU and Memory based autoscaling triggers for your service.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/acaeed4f282a49bea1b6c69bb64eb6bc_image.png\" alt=\"image.png\" /></p>\n<h4><a id=\"Blazor_WebAssembly_App_45\"></a><strong>Blazor WebAssembly App</strong></h4>\n<p>The new AWS .NET deployment tooling is the easiest way to get your Blazor WebAssembly applications deployed to AWS. This recommendation now configures an <a href=\"https://aws.amazon.com/cloudfront/\" target=\"_blank\">Amazon CloudFront</a> distribution to be the front endpoint for your applications. CloudFront provides low latency and high speed transfers, which are critical for Blazor WebAssembly applications, and an HTTPS endpoint by default.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/c81ea512a12840c6b760617e7b2fb79d_image.png\" alt=\"image.png\" /></p>\n<h3><a id=\"Scripting_Deployments_51\"></a><strong>Scripting Deployments</strong></h3>\n<p>When deploying applications the tooling provides an interactive experience to help you determine the right AWS service to host the application code, and helps configure the deployment to match your needs. This is great for learning how to setup a deployment. The end goal for most developers is to create an automated deployment and the AWS .NET deployment tooling can help with this.</p>\n<p>To turn off the interactive features of the tooling, supply the <code>--silent</code> switch to the command. This will ensure the tooling never prompts for any questions which could block an automated process.</p>\n<p>The settings for deployment can be supplied in a JSON file, which is specified using the <code>--apply</code> switch. Storing the settings in a JSON file also allows those settings to be version controlled.</p>\n<p>We are working on providing additional documentation for the settings file, but below is an example. The file uses the IDs of the settings that are specified in the recipe definitions that the deployment tooling uses for generating its recommendations. The recipe definitions are available on <a href=\"https://github.com/aws/aws-dotnet-deploy/tree/main/src/AWS.Deploy.Recipes/RecipeDefinitions\" target=\"_blank\">GitHub</a>.</p>\n<p>JSON</p>\n<pre><code class=\"lang-\">\n{\n\t&quot;AWSRegion&quot; : &quot;us-east-1&quot;,\n\t&quot;StackName&quot; : &quot;ZipCodeWebApi&quot;,\n\t&quot;RecipeId&quot; : &quot;AspNetAppEcsFargate&quot;,\n\t&quot;OptionSettingsConfig&quot; : {\n\t\t&quot;ECSCluster&quot; : {\n\t\t\t&quot;CreateNew&quot; : false,\n\t\t\t&quot;ClusterArn&quot; : &quot;arn:aws:ecs:us-east-1:123412341234:cluster/ZipCodeLookup&quot;\n\t\t},\n\t\t&quot;ECSServiceName&quot; : &quot;ZipCodeWebApi-service&quot;,\n\t\t&quot;ApplicationIAMRole&quot; : {\n\t\t\t&quot;CreateNew&quot; : true\n\t\t},\n\t\t&quot;LoadBalancer&quot; : {\n\t\t\t&quot;CreateNew&quot; : false,\n\t\t\t&quot;ExistingLoadBalancerArn&quot; : &quot;arn:aws:elasticloadbalancing:us-east-1:123412341234:loadbalancer/app/ZipCode/f17b16d55f49d3ab&quot;,\n\t\t\t&quot;HealthCheckPath&quot; : &quot;/api/healthcheck&quot;,\n\t\t\t&quot;ListenerConditionType&quot; : &quot;Path&quot;,\n\t\t\t&quot;ListenerConditionPathPattern&quot; : &quot;/api/*&quot;\n\t\t},\n\t\t&quot;AutoScaling&quot; : {\n\t\t\t&quot;Enabled&quot; : true,\n\t\t\t&quot;ScalingType&quot; : &quot;Memory&quot;\n\t\t}\n\t}\n}\n\n</code></pre>\n<p>Using the ability to turn off interactive deployment prompts, and pass deployment settings in an external file, it is easy to configure any CI/CD system to deploy to AWS using the new tooling. For example, here is a GitHub action that installs the deployment tool from NuGet and then deploys the application to AWS.</p>\n<p>YAML</p>\n<pre><code class=\"lang-\">name: Deploy to AWS\non: [push]\njobs:\n deploy:\n runs-on: ubuntu-latest\n steps:\n - name: Configure AWS Credentials\n uses: aws-actions/configure-aws-credentials@v1\n with:\n aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n aws-region: us-east-1\n\n - uses: actions/checkout@v2\n - name: Setup .NET 6.0\n uses: actions/setup-dotnet@v1\n with:\n dotnet-version: '6.0.x'\n include-prerelease: true\n\n - name: Install AWS .NET Deployment Tool\n run: dotnet tool install -g AWS.Deploy.Tools\n\n - name: Execute Deployment\n working-directory: ./ZipCodeWebApi\n run: dotnet aws deploy --silent --apply ../deployment-settings.json\n</code></pre>\n<h3><a id=\"Closing_127\"></a>Closing</h3>\n<p>The new tooling is being updated frequently with new features, and we’re really keen to hear your feedback on the tool, what you need, and how it can improve further to help meet your needs. Our aim is to make this tool the easiest way to deploy your .NET applications on AWS. Give it a try and let us know what you think on GitHub, where you can follow all the latest developments.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/ce9db890789b4165beb4d2a46b2a7943_image.png\" alt=\"image.png\" /></p>\n<h3><a id=\"Norm_Johansonhttpstwittercomsocketnorm_133\"></a><strong><a href=\"https://twitter.com/socketnorm\" target=\"_blank\">Norm Johanson</a></strong></h3>\n<p>Norm Johanson has been a software developer for more than 20 years developing all types of applications. Since 2010 he has been working for AWS focusing on the .NET developer experience at AWS. You can find him on Twitter <a href=\"https://twitter.com/socketnorm\" target=\"_blank\">@socketnorm</a> and GitHub <a href=\"https://github.com/normj\" target=\"_blank\">@normj</a>.</p>\n"}
目录
亚马逊云科技解决方案 基于行业客户应用场景及技术领域的解决方案
联系亚马逊云科技专家
亚马逊云科技解决方案
基于行业客户应用场景及技术领域的解决方案
联系专家
0
目录
关闭
contact-us