owned this note changed 4 years ago
Linked with GitHub

當 MIS 跟 developer 遇上 Azure DevOp - TonyQ

歡迎來到 MOPCON 2020 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

共筆入口:https://hackmd.io/@mopcon/2020
手機版請點選上方 按鈕展開議程列表。

從這開始

講者投影片
https://slides.com/tonyq/mis-developer-azure-devops

Server DB Where to place code
寫Code

virtual machine、App Service

node.js、PHP、Java、Python

Azure

先講 server

portal.azure.com

聽說最近 k8s 很紅,可是不講
可是 Azure 也有

老工程師老派,所有東西都用 VM 解決

今天議程輕鬆點,不要架 VM
架個 php 站
mapfiddle (php + postgreSQL)

MS 現在全新帳號可以使用 12m $200 USD 免費額度,還有免費使用額度

Azure 介面找不到服務,就找 All Service

  • 主機: compute
  • DB: Database
  • 容器: Container
  • 檔案空間: Storage
  • 其他自己逛

Azure 所有的網址都會帶 azurewebsize postfix,還帶 https 滿划算的
URL get
How to upload?

DB

眾所皆知 SQLServer 是微軟的,但我今天不講
今天要用 PostgreSQL
老派工程師第一個直覺還是架 VM,但是 Azure 有 DB for PostgreSQL

這是 PAAS,不是 VAS

PostgreSQL 好多選項,Single Server 看起來比較便宜,我這個人比較簡單

DB 這樣就好了,還有備份功能,最多可以 35 天的無痛還原(預設 7 天)

no pg_nba conf error
果然要看說明書

Default 不支援 public IP 連線

https://dbeaver.io/
開源的 DB 軟體,支援很多種 DB

BTW Azure 提供多種語言 connection string

再來 Git repo
連到 Azure DevOps
直接打網址比較好找 dev.azure.com

推上去後要 build
建 pipeline
選預設的模板試試看
模板YAML 撰寫

碰到空白的頁面可以怎麼處理?

因為工作在linux+php的環境中,所以可以用SSH連進去
唯一差別是下次重新depoly會被 洗掉
講者

這個專案的路徑在 public/index.html
需要 url rewrite

可是不想因為 server 影響 codebase
在 pipeline 當中加入 powershell 處理 config

再連一次 -> Internal Server Error

忘記改 DB 設定

設定 Trigger,讓服務在 push 時自動 build

但有一天,人變多了
需要設定 branch policy,管控 push 權限

如果到 production
可以設定 auto-scaling
或是手動調可以直接改 instance 數量

tags: MOPCON 2020
Select a repo