Azure things

Anh-Thi Dinh
draft
⚠️
This is a quick & dirty draft, for me only!

References

Bash / SSH to current App Service

  • In the current app service → Development Tools → Advanced Tools → “Go →” → (KUDU console opens) → There is a menu on the top bar!
Click “SSH”. Please note the line “Note: Any data outside ‘/home’ is not persisted
  • Using CLI to ssh to App Service container
    • 1az webapp ssh -n MyUniqueAppName -g MyResourceGroup

Check quota

Azure Portal → Subscriptions → (choose a subscription) → Usage + quotas

Install custom packages / dependencies into current App Service

  • Enter App Service container and using SSH ← not persisted
    • ☝️
      We can install new package inside App Service container via apt install ffmpeg but after re-deploy, everything installed isn’t persisted. Inside this SSH, it also says that “Any data outside /home is not persisted”! ← one SO.

Push local image to ACR

ACR = Azure Container Registry.
1# list all local images
2docker images -a
3
4# login
5az login
6
7# create an acr
8az acr create --resource-group web-app-simple-rg --name idetafastapiacr --sku Basic
9
10# login to this acr
11az acr login --name idetafastapiacr
12
13# push local "fastapi-demo" image
14docker login
15# username and password in Container registries -> Settings -> Access keys
16docker tag fastapi-demo idetafastapiacr.azurecr.io/samples/fastapi-demo
17docker push idetafastapiacr.azurecr.io/samples/fastapi-demo

Health check

Azure sẽ gởi pingpong đến 1 endpoint tạo trên server để check status của nó. Thường app service sẽ chạy trên nhiều instances khác nhau, instance nào die thì cái health check này sẽ hiển thị. Official doc.
Location: Home → App Services → <service name> → Monitoring → Health check
Trong đây có chỗ “Health probe path” để điền endpoint cần vào.
Home → App Services → <service name> → Monitoring → Health check
 
Còn cái này là coi xem giai đoạn nào server trục trặc (timestamp). Nó nằm trong Metrics (Azure Monitoring).

Some useful Azure CLI commands

1# List all slots of a given App Service
2az webapp deployment slot list --name <webAppName> --resource-group <resourceGroupName>

Troubleshooting