1. 程式人生 > >AWS Lambda .NET Core 2.0 Support Released

AWS Lambda .NET Core 2.0 Support Released

Today we’ve released the highly anticipated .NET Core 2.0 AWS Lambda runtime that is available in all Lambda-supported regions. With .NET Core 2.0, it’s easier to move existing .NET Framework code to .NET Core with the much larger API defined in .NET Standard 2.0, which .NET Core 2.0 implements.

Using Visual Studio 2017

The easiest way to get started with .NET Core Lambda is to use Visual Studio 2017 and our AWS Toolkit for Visual Studio. We released version 1.14.0.0 of the toolkit today with updates to support using .NET Core 2.0 on AWS Lambda. The AWS Lambda project templates have been updated to .NET Core 2.0. You can easily deploy to Lambda by right-clicking your Lambda project and selecting Publish to AWS Lambda.

If you haven’t used the toolkit before, these previous blog posts can help you get started:

Deploying from the command line

Although you can create a Lambda package bundle by zipping up the output of the dotnet publish command, we recommend that you use our dotnet CLI extension,

Amazon.Lambda.Tools. Using this tool over dotnet publish enables our tooling to ensure the package bundle has all of the required files. These include the <my-project>.runtimeconfig.json file that the .NET Core 2.0 Lambda runtime requires, but which isn’t always produced by dotnet publish. The tooling also shrinks your package bundle by removing Windows-specific and macOS-specific dependencies that dotnet publish would put in the publish folder.

This tool is set up by default in all of our AWS Lambda project templates because we added the following section in the project file.


<ItemGroup>
  <DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="2.0.0" />
</ItemGroup>

As part of our release today, version 2.0.0 of Amazon.Lambda.Tools was pushed to NuGet.org to add support for .NET Core 2.0.

Depending on the type of project you create, you can use this extension to deploy your Lambda functions from the command line by using the dotnet lambda deploy-function command or the dotnet lambda deploy-serverless command.

If you’re just building your Lambda package bundle as part of your CI system and don’t want the extension to deploy, you can use the dotnet lambda package command to produce the package bundle .zip file to pass along through your CI system.

Creating Lambda projects without Visual Studio

If you’re not using Visual Studio, you can create any of our Lambda projects using the dotnet new command by installing our Amazon.Lambda.Templates package with the following command.

dotnet new -i Amazon.Lambda.Templates::* 

The ::* syntax at the end of the command indicates that the latest version should be installed. This is version 2.0.0, also released today, to update the project templates to support .NET Core 2.0. See this blog post for more details about these templates.

Updating existing functions

Because the programming model hasn’t changed, it’s easy to migrate your existing .NET Core 1.0 Lambda functions to the new runtime. To migrate, you need to update the target framework of your project to netcoreapp2.0 and, optionally, update any of the dependencies for your project to the latest version. Your project probably has an aws-lambda-tools-defaults.json file, which is a JSON file of saved settings from your deployment. Update the framework property to netcoreapp2.0. If the file also contains the field function-runtime, update that to dotnetcore2.0. If you’re deploying a Lambda function as a serverless application using an AWS CloudFormation template (usually named serverless.template), update the Runtime property of any AWS::Serverless::Function or AWS::Lambda::Function AWS CloudFormation resources to dotnetcore2.0.

With these changes, you should be able to simply redeploy using the new .NET Core 2.0 runtime with our AWS Toolkit for Visual Studio or dotnet CLI extension.

Using AWS Tools for Visual Studio Team Services

The AWS Tools for VSTS support two tasks related to performing Lambda deployments from within your VSTS or TFS pipelines. The general-purpose AWS Lambda deployment task, which can deploy prepackaged functions that target any supported AWS Lambda runtime, has been updated in version 1.0.16 of the tools to support selection of the new dotnetcore2.0 runtime. The .NET Core-specific Lambda task, which uses the Lambda dotnet CLI extension, will operate without requiring changes to the task configuration. You just need to update the project files built by this task, as described earlier.

Conclusion

We’re excited to see what you build with our new .NET Core runtime and to expand our .NET Core 2.0 support across AWS. Visit our GitHub repository for our .NET Core tooling and libraries for additional help with .NET Core and Lambda.

相關推薦

AWS Lambda .NET Core 2.0 Support Released

Today we’ve released the highly anticipated .NET Core 2.0 AWS Lambda runtime that is available in all Lambda-supported regions. With .NET Core 2.0

visual studio code調試.net core 2.0程序

vs code 調試控制臺 debuger console datatable 最近在試.net 2.0 Preview時,在VS2017中相對麻煩,現說也怕把生產環境搞壞,於是就想在vs code下試試。首在安裝.net core 2.0的SDK和Runtime,這裏下載https://gi

.NET Core 2.0及.NET Standard 2.0 Description

tar eric xpath andro ace mint tro os x execution NET Core 2.0的發布時間,.NET Core 2.0預覽版及.NET Standard 2.0 Preview大概在5月中旬或下旬發布。 .NET Core 2.0正

ubuntu 跑.net core 2.0

manager mvc code html cati 保存文件 user 服務 target 安裝.net core參考地址:http://www.microsoft.com/net/core/preview#linuxubuntu 服務器版本 UBbuntu

.NET Core 2.0 官方下載地址及中文教程

nbsp -c 開發 style docs otn ria 2.0 官方下載 開發.net core 應用需要安裝.NET Core 2.0 SDK http://www.microsoft.com/net/download/core#/sdk 電腦上運行 .net c

Asp.net Core 2.0連接mysql數據庫一系列錯誤問題

alt sql mysql mysql數據庫 work image sql數據庫 報錯 entity mysql:最新版 一定是最新版,不然各種報錯 Install-Package Pomelo.EntityFrameworkCore.MySql 2.0.0-rtm-100

.net core 2.0學習筆記(四):遷移.net framework 工程到.net core

編譯 its evel hashtable ref 學習筆記 inline null 創建 在遷移.net core的過程中,第一步就是要把.net framework 工程的目標框架改為.net core2.0,但是官網卻沒有提供轉換工具,需要我們自己動手完成了

03、手工創建Asp.Net Core 2.0 web應用程序(探索最小架構)

log bho 啟動 oid img gif method nuget ica 03、手工創建Asp.Net Core 2.0 web應用程序(探索最小架構) 一、創建一個幹凈的控制臺程序 這裏我們使用的開發工具是VS2017 項目只有一個Program.cs類。

Linux上安裝Docker,並成功部署NET Core 2.0

ble otn 重要 命中 mode 管理 sql img 內容 概述 容器,顧名思義是用來存放並容納東西的器皿; 而容器技術伴著Docker的興起也漸漸的映入大家的眼簾,它是一個抽象的概念,同時也是默默存在世上多年的技術,不僅能使應用程序間完全的隔離,而且還能在共享底層系

Net Core 2.0生態1

spn get xamarin 程序 doc shtml -a 讓我 andro Net Core 2.0生態 閱讀目錄 前言:答讀者問(time by:2017.8.19) 項目升級到ASP.NET Core 2.0 新增功能:Razor Pages介紹 模板更新

VS Code開發調試.NET Core 2.0

lin res blog ram sco img vscode 不用 store VS Code開發調試.NET Core 2.0 使用VS Code 從零開始開發調試.NET Core 2.0。無需安裝VS 2017 15.3+即可開發調試.NET Core 2.0應用。

.NET Core 2.0遷移技巧之MemoryCache問題修復

命名空間 ram ons ret http option ext obj mar 對於傳統的.NET Framework項目而言,System.Runtime.Caching命名空間是常用的工具了,其中MemoryCache類則常被用於實現內存緩存。 .NET Core

一起學ASP.NET Core 2.0學習筆記(一): CentOS下 .net core2 sdk nginx、supervisor、mysql環境搭建

image dev 預覽 def star fig brush rest aspnet 作為.neter,看到.net core 2.0的正式發布,心裏是有點小激動的,迫不及待的體驗了一把,發現速度確實是快了很多,其中也遇到一些小問題,所以整理了一些學習筆記: 閱讀目

.net core 2.0學習筆記(六):Remoting核心類庫RealProxy遷移

ride dispatch 包含 void reflect 既然 splay creat (六) 在學習.net core的過程中,我們已經明確被告知,Remoting將不會被支持。官方的解釋是,.net framework 類型包含了太多的Runtime的內容,是

一起學ASP.NET Core 2.0學習筆記(二): ef core2.0 及mysql provider 、Fluent API相關配置及遷移

upd order rac option 包管理 rtl code create .net core 不得不說微軟的技術叠代還是很快的,上了微軟的船就得跟著她走下去,前文一起學ASP.NET Core 2.0學習筆記(一): CentOS下 .net core2 s

NET Core 2.0使用Cookie認證實現SSO單點登錄

訪問 mvc side mes all add set 1.0 png NET Core 2.0使用Cookie認證實現SSO單點登錄 之前寫了一個使用ASP.NET MVC實現SSO登錄的Demo,https://github.com/bidianqing/SSO.Sam

.NET Core 2.0 問題雜記

https dev install cor www 微軟 get 地址 安裝 一. Ubuntu 14.04 安裝   1.安裝之前請先刪除之前的.net core 版本 命令如下:     1.1 獲取安裝的.net core 版本 sudo apt --installe

史坑:.Net core 2.0 體驗

core images .cn nbsp 錯誤 ges 一個 logs http Net core 2.0 生成的包文件更少,大小也更小了。同一個項目 1.1 是約21M;2.0是 2.4M. 愉快地使用一天之後。VS2017 突然識別不到 .NET core 2.0

.net core 2.0 Code First Fluent API配置

asp 完成 eating cte word his text -1 src A.net core 2.0新特性支持通過IEntityTypeConfiguration<>添加Code First配置到一個封裝類。 新建目標框架為.NET Core類庫 新建完

NET Core 2.0 使用支付寶

ckey fun viewdata rsa算法 行集 eno 驗收 sub 裏的 ASP.NET Core 2.0 使用支付寶PC網站支付 前言 最近在使用ASP.NET Core來進行開發,剛好有個接入支付寶支付的需求,百度了一下沒找到相關的資料,看了官方的SDK