การปรับปรุงแอปในสภาพแวดล้อม Production

Azure App Services

Florin Angelescu

Azure Cloud Architect

วิธี Deploy ที่ดีกว่าเดิม

Deployment Slots

การใช้ Slot:

  • ทดสอบการเปลี่ยนแปลงใน Staging Environment
  • ก่อนนำขึ้น Production
Azure App Services

Deployment Slots ทำงานอย่างไร

Deployment Slots

  • Deployment Slot คือสำเนาของ Web App
  • มี Hostname และการตั้งค่าเป็นของตัวเอง
Azure App Services

Deployment Slots ทำงานอย่างไร

Deployment Slots

  • Deploy การเปลี่ยนแปลงไปยัง Slot
  • ทดสอบอย่างปลอดภัย
  • Swap Slot เข้าสู่ Production
Azure App Services

การ Deploy การเปลี่ยนแปลง UI

Deployment Slots

  • สร้าง Staging Slot สำหรับ Web App
  • Deploy ฟอร์มสั่งซื้อที่อัปเดตแล้วไปยัง Slot
  • แอป Production ยังคงทำงานตามปกติ
Azure App Services

การทดสอบใน Staging

Deployment Slots

  • ฟอร์มแสดงผลถูกต้อง
  • ส่งคำสั่งซื้อได้อย่างถูกต้อง
  • เรียกใช้ Function Back-end ได้ตามที่คาดไว้
Azure App Services

การทดสอบใน Staging

Deployment Slots

  • Slot ใช้การตั้งค่าส่วนใหญ่ร่วมกับแอป Production
  • สภาพแวดล้อมทดสอบสะท้อนการใช้งานจริงได้อย่างใกล้เคียง
Azure App Services

การ Swap ขึ้น Production

Deployment Slots

  • Swap Staging Slot เข้าสู่ Production
  • Azure จัดการเปลี่ยนเส้นทาง Traffic อย่างราบรื่น
  • สามารถ Rollback ได้โดย Swap กลับอีกครั้ง
Azure App Services

ประโยชน์ของแนวทางนี้

Deployment Slots

  • Deployment Slots ช่วยให้ทีมพัฒนาได้อย่างปลอดภัย
  • แยก Testing ออกจาก Live Traffic ลดความเสี่ยง และรองรับการ Rollout แบบควบคุมได้
Azure App Services

มาฝึกกันเถอะ!

Azure App Services

Preparing Video For Download...