20200425 GlobalAzure-Azure API Management-協助邁向Open API及Micro Service架構的好用服務

Alan Tsai
Alan Tsaia Microsoft MVP, MCT, Blogger, Youtuber and ASP .NET Developer at Wishing-Soft
Azure API Management
(Azure APIM)
By Alan Tsai
協助邁向Open API及Micro Service架構的好用服務
@Alan Tsai 的學習筆記
簡單自我介紹
• Alan Tsai
• 蔡孟玹
• 後端工程師
• .NET 技術爲主
• 喜歡學習不同東西
• Azure
• Data Science、Chatbot
• Container
• DevOps
• 架構、加强開發的Tools
• 看小說 2
@Alan Tsai 的學習筆記
教就是最好的學習方式 -喜歡考證驗證所學
3
@Alan Tsai 的學習筆記
喜歡技術分享
▰台灣智慧自動化與機器人協會
機器學習基礎理論課程及人工智慧 – ML.NET
▰Microsoft Insider DevTour Taipei
Future proof your desktop apps
with .NET core
▰.NET Conf 2019
用 Bot Framework 開發 Chatbot =
支援多平臺 + 包含平臺客制功能 - 以Line爲例
▰中華電信學院
使用Azure AI打造有人工智能的Line聊天機器人
DevOps與CI/CD實務研習班
▰聖森内部教育訓練
Azure DevOps CI/CD 應用
4
@Alan Tsai 的學習筆記
歡迎訂閲、按贊 + 分享
5
@Alan Tsai 的學習筆記
contact@alantsai.net
@alantsai2007Line@
• Alan Tsai 的學習筆記
• https://blog.alantsai.net
• FB粉絲頁
• http://fb.alantsai.net
• Youtube
• http://yt.alantsai.net
@Alan Tsai 的學習筆記
Agenda
6
▰什麼是API?為什麼可能會想做Open API
▰API Management能做到什麼?
▰邁向Micro Service
@Alan Tsai 的學習筆記
什麼是 API
7
應用程式介面(Application Programming Interface)
是軟體系統不同組成部分銜接的約定
-- From Wikipedia
@Alan Tsai 的學習筆記
connected
8
@Alan Tsai 的學習筆記
什麼是 Open API
9
▰Open API
▻通常指的是開放的RESTFul Api
▰Closed API
▻內部使用
@Alan Tsai 的學習筆記
敗口罩
10
@Alan Tsai 的學習筆記
連銀行都要開始開發API
11
@Alan Tsai 的學習筆記
進行開發
12
▰怎麼讓別人知道API有什麼?
▰怎麼樣控制誰能夠打什麼?
▰怎麼樣限制允許打多少次?
▰怎麼樣能夠讓返回的東西更快?
▰怎麼樣能夠修改API?
▰怎麼樣讓服務不會被打爆?
▰怎麼樣監控使用情況?
@Alan Tsai 的學習筆記
做不到哇
13
@Alan Tsai 的學習筆記
API 管理沒有那麼簡單
14
APIs
APIs
15
Developers
(use APIs)
Discover
Learn
Get access
Try
SDKs/samples
Get help
Publishers
(provide APIs)
Abstract
Secure and protect
Manage lifecycle
Monitor and measure
Onboard developers
Monetize
Consume PublishMediate
Azure
portal
GatewayDeveloper
portal
Azure API Management
是什麼?
Azure APIM
16
@Alan Tsai 的學習筆記
API Management
17
Consume PublishMediate
Azure portalGatewayDeveloper portal
@Alan Tsai 的學習筆記
幾個Component
18
▰APIs – 邏輯層代表有提供哪些API服務
▻Operation – 定義每一個的動作
▻Frontend – Façade 代表從前端可以呼叫
▻Backend – 實際後端的API的位置
▻Process - policy
▰Products – 用來把API Group在一起 – 用來給User訂閱
@Alan Tsai 的學習筆記
幾個Component
19
▰Users – 代表會進來連使用API的開發者
▰Subscription – 可以用來記錄讓User註冊的記錄
▰Access Policy – 用來控制是否要對API做什麼調整
API
Azure API Management 是什麼?
20
@Alan Tsai 的學習筆記
加入 API
21
@Alan Tsai 的學習筆記
單獨編輯某一筆
22
Developer Portal
Azure API Management 是什麼?
23
@Alan Tsai 的學習筆記
進入到 Developer Portal
24
▰https://{APIM Name}.developer.azure-api.net/
@Alan Tsai 的學習筆記
進入到 Developer Portal (Legacy)
25
▰https://{APIM Name}.portal.azure-api.net/
@Alan Tsai 的學習筆記
User
26
▰可以註冊帳號
▰可以自己申請Product Subscription
▻自己管理Key
▰可以看到自己的使用情況
Policy
Azure API Management 是什麼?
27
@Alan Tsai 的學習筆記
Policy是什麼
28
▰對Request進行處理
▰常見的有
▻限制使用量
▻做cache
▻調整request/response
@Alan Tsai 的學習筆記
Policy 的層級
29
@Alan Tsai 的學習筆記
Policy 的層級應用
30
Lifecyle Management
Azure API Management 是什麼?
31
@Alan Tsai 的學習筆記
Version vs Revision
32
▰Revision
▻由Provider來決定什麼時候要上
▰Version
▻由Consumer來決定什麼時候要切換
@Alan Tsai 的學習筆記
建立一個Mock API
33
▰apiary – 建立 mock api好用的工具
▻https://blog.alantsai.net/tags/apiary
@Alan Tsai 的學習筆記
全部解決
34
▰怎麼讓別人知道API有什麼?
▰怎麼樣控制誰能夠打什麼?
▰怎麼樣限制允許打多少次?
▰怎麼樣能夠讓返回的東西更快?
▰怎麼樣能夠修改API?
▰怎麼樣讓服務不會被打爆?
▰怎麼樣監控使用情況?
邁向 Micro Service
35
@Alan Tsai 的學習筆記
從MVP開始
36
產品
訂單
API
Developer
@Alan Tsai 的學習筆記
開始賣錢了之後
37
產品
訂單
API
Developer
More Developer
@Alan Tsai 的學習筆記
解決管理問題
38
產品
訂單
Developer
API
APIM
Product
API
產品
訂單
@Alan Tsai 的學習筆記
微服務架構(Microservices) v.s. 單體式架構(Monolithic)
39
@Alan Tsai 的學習筆記
建立邏輯分割API
40
Developer
API
APIM
Product
API
產品
訂單
@Alan Tsai 的學習筆記
嘗試微服務架構
41
Developer
舊的API
APIM
Product
API
產品
訂單
產品 API
訂單 API
Monolithic
Micro Service
結語
42
@Alan Tsai 的學習筆記
API Management
43
▰做好API管理不是一件容易的事情
▰Azure API Management 讓我們只要focus在重要的地方
▰還有更多功能
▻Auto-Scale
▻分析
▻整合
@Alan Tsai 的學習筆記
不要想一步到位
44
https://www.martinfowler.com/bliki/MonolithFirst.html
@Alan Tsai 的學習筆記
參考資料
45
▰API Management – Tutorial
▻https://docs.microsoft.com/en-us/azure/api-management/import-
and-publish
▰微服務架構 #1, WHY Microservices?
▻https://columns.chicken-house.net/2016/09/15/microservice-
case-study-01
▰apiary – 建立 mock api好用的工具
▻https://blog.alantsai.net/tags/apiary
@Alan Tsai 的學習筆記
參考資料
46
▰Microsoft Ignite 2019 - API management for
microservices in a hybrid and multi-cloud world
▻https://www.slideshare.net/TomKerkhove/microsoft-ignite-
2019-api-management-for-microservices-in-a-hybrid-and-
multicloud-world
▰部落格文章介紹
▻https://blog.alantsai.net/posts/2020/04/review-event-2020-
global-azure-api-management-helps-create-open-api-and-
towards-micro-service-architecture
@Alan Tsai 的學習筆記
歡迎訂閲、按讚 + 分享
• FB 粉絲頁
• http://fb.alantsai.net
• Youtube 頻道
• http://yt.alantsai.net
• Alan Tsai 的學習筆記
• https://blog.alantsai.net
@alantsai2007Line@
47
48
Q&A
感謝大家
CREDITS
Special thanks to all the people who made
and released these awesome resources for
free:
▰ Presentation template by SlidesCarnival
▰ Photographs by Startup Stock Photos
49
1 of 49

More Related Content

Similar to 20200425 GlobalAzure-Azure API Management-協助邁向Open API及Micro Service架構的好用服務(20)

More from Alan Tsai(20)

20200425 GlobalAzure-Azure API Management-協助邁向Open API及Micro Service架構的好用服務

Editor's Notes

  1. Ignite 2018:Expose APIs with peace of mind when using Azure API Management - BRK2200-vxGErjuZtXo
  2. Demo 註冊賬號並且申請product
  3. Admin 可以修改
  4. 兩個問題: 越來越多人使用怎麼管理? 單一功能使用的人比較多 – 怎麼scale?