Sitemap
T. T. Software Solution

Web developers with ASP.Net, MSSQL, Azure working in Remote Office 100%

Global Azure 2025 Thailand

Deploy a web API with AI-powered to Linux container in Azure App Service

3 min readMay 10, 2025

--

Press enter or click to view image in full size

มีโอกาสได้กลับมาเป็น Speaker ในงานใหญ่ชื่อ Global Azure 2025 Thailand ครับ โดยผมพูดในหัวข้อ

Deploy a .NET 9 Web API + Azure OpenAI บน Azure App Service ด้วย GitHub Actions ครับ

ซึ่งจะมีหัวข้อคร่าวๆดังนี้

ทำไมต้อง AI ตอนนี้

ในสไลด์ผมเริ่มด้วยคำถาม “Why AI?” เพื่อชี้ให้เห็นว่าการต่อยอด Web API ด้วย Generative AI ช่วยปลดล็อกการสร้างประสบการณ์ผู้ใช้และเวิร์กโฟลว์อัตโนมัติได้มากแค่ไหน

Press enter or click to view image in full size

เทคโนโลยีที่ใช้ร่วมกัน

  • Azure OpenAI Service เป็น LLM provider หลัก (แนะนำเริ่มจาก GPT‑4o mini)
  • .NET 9 Minimal API + Azure SDK สำหรับเรียก OpenAI
  • Semantic Kernel ทำหน้าที่ AI‑orchestration / Function Calling / Plugin system
Press enter or click to view image in full size
Press enter or click to view image in full size

Demo

  • การใช้งานพื้นฐานด้วย hello-ai
  • การใช้งาน Function Calling + Plugins ด้วย semantickernel‑plugins

พร้อม README อธิบายวิธีเพิ่ม end‑point “/chat” ให้เรียก OpenAI ได้สะดวกขึ้นครับ

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

Deploy อัตโนมัติด้วย GitHub Actions

  • สั่ง docker build → push ไปยัง Azure Container Registry
  • Math Log Pathในคอนเทนเนอร์ออกไปที่ Azure File Share เพื่อดู log แบบ persistent
  • Workflow ใช้ Azure/static-web-apps-deploy@v1 (หรือ azure/docker-login + az webapp deploy) เพื่อ
  • ดึงโค้ด → Build image
  • Push เข้า ACR, อัปเดต Azure App Service — Linux Container ให้ดึง tag ล่าสุด
  • ทุก push ไป main
  • จะสร้าง‑ทดสอบ‑ได้อย่างรวดเร็วภายใน ~5 นาที
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

เบื้องหลังการเลือกบริการ

ผมอ้าง decision tree ของ Microsoft ในสไลด์ เพื่ออธิบายว่าทำไมงานนี้เหมาะกับ App Service มากกว่า Functions หรือ Container Apps — ต้องการ zero‑infra, auto‑scale และ workflow CI/CD ที่คุ้นเคย

Press enter or click to view image in full size
Press enter or click to view image in full size

ถ้าคุณอยากลองเอง: Fork Repository, เปลี่ยนค่า AZURE_OPENAI_ENDPOINT & API_KEY, แล้วกด “Deploy to Azure” — แค่ไม่กี่คลิกก็ได้ AI‑powered API พร้อม CI/CD บนคลาวด์ของคุณเอง

Presentation

Video

สรุป

หวังว่าเนื้อหาตรงนี้จะเป็นประโยชน์ให้ท่านที่กำลังสนใจนำ AI มาใช้กับงานและทำการ Deploy ไปยัง Server ได้อย่างสม่ำเสมอและปลอดภัยนะครับ

Press enter or click to view image in full size

Happy Coding,

นายป้องกัน

Press enter or click to view image in full size
เกาพุงผมไหมครับบบ 😻

--

--

T. T. Software Solution
T. T. Software Solution

Published in T. T. Software Solution

Web developers with ASP.Net, MSSQL, Azure working in Remote Office 100%

Ponggun
Ponggun

Written by Ponggun

Development Manager, Web Developer with ASP.Net, ASP.net Core, Azure and Microsoft Technologies

No responses yet