Azure Functions with Java and Eclipse

◆ Live配信スケジュール ◆
サイオステクノロジーでは、Microsoft MVPの武井による「わかりみの深いシリーズ」など、定期的なLive配信を行っています。
⇒ 詳細スケジュールはこちらから
⇒ 見逃してしまった方はYoutubeチャンネルをご覧ください
【5/21開催】Azure OpenAI ServiceによるRAG実装ガイドを公開しました
生成AIを活用したユースケースで最も一番熱いと言われているRAGの実装ガイドを公開しました。そのガイドの紹介をおこなうイベントです!!
https://tech-lab.connpass.com/event/315703/

Azure Functions with Java is generally available.In this post, I’ll show you how to create Azure Functions with Java and Eclipse.This post assumes that you use Mac OS.Of course, you can with Windows.

https://azure.microsoft.com/en-us/blog/announcing-the-general-availability-of-java-support-in-azure-functions/

 At first, you need to install .NET Core. See the following links for details.

https://dotnet.microsoft.com/download

Next, you need to install Azure Functions Core Tools.Execute the following command in Terminal of Mac OS.

# brew tap azure/functions
# brew install azure-functions-core-tools

In Eclipse, select the File menu, then select Project.Screen Shot 2019-02-28 at 20.00.40

 

Open the Maven Project folder and select Maven Project, then select Next.

Screen Shot 2019-02-28 at 20.01.32

 

Select Next.

Screen Shot 2019-02-28 at 21.23.44

 

Click “Add Archetype…”.

Screen Shot 2019-02-28 at 21.24.00

 

Add the entries for the azure-functions-archetype.

  • Archetype Group ID: com.microsoft.azure
  • Archetype Artifact ID: azure-functions-archetype
  • Version: Use latest version from the central repository

Screen Shot 2019-02-28 at 21.24.53

 

Select Next.

Screen Shot 2019-02-28 at 21.25.07

 

Enter the value based on the Maven Rules in the “Group Id” and “Artifact Id” fields and click “Finish”.

Screen Shot 2019-02-28 at 21.26.55

 

Maven creates the project files in a new folder with a name of artifactId. The follwing code is generated.This code is a simple HTTP triggered function that echoes the body of the triggering HTTP request.

Screen Shot 2019-02-28 at 22.28.36

 

Right-click on the generated project, then choose Run As and Maven build.

Screen Shot 2019-02-28 at 21.31.52

 

In the Edit Configuration dialog, Enter package in the Goals and Name fields, then select Run.

Screen Shot 2019-02-28 at 22.30.40

 

Once the build is complete, create another Run configuration to execute Azure Functions built previously.

Screen Shot 2019-02-28 at 22.37.19

 

In the Edit Configuration dialog, Enter “azure-functions:run” in the Goals and Name fields, then select Run.

Screen Shot 2019-02-28 at 22.36.15

 

The following messages get displayed in Console if execution is successful.

Http Functions:
    HttpTrigger-Java: [GET,POST] https://localhost:7071/api/HttpTrigger-Java

Add a query parameter “name” to the end of the URL as above and access the following URL.

https://localhost:7071/api/HttpTrigger-Java?name=noriyuki

You will see “Hello, noriyuki” on your Web Browser.

アバター画像
About 武井 宜行 269 Articles
Microsoft MVP for Azure🌟「最新の技術を楽しくわかりやすく」をモットーにブログtech-lab.sios.jp)で情報を発信🎤得意分野はAzureによるクラウドネイティブな開発(Javaなど)💻「世界一わかりみの深いクラウドネイティブ on Azure」の動画を配信中📹 https://t.co/OMaJYb3pRN
ご覧いただきありがとうございます! この投稿はお役に立ちましたか?

役に立った 役に立たなかった

0人がこの投稿は役に立ったと言っています。


ご覧いただきありがとうございます。
ブログの最新情報はSNSでも発信しております。
ぜひTwitterのフォロー&Facebookページにいいねをお願い致します!



>> 雑誌等の執筆依頼を受付しております。
   ご希望の方はお気軽にお問い合わせください!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


質問はこちら 閉じる