Azure App Service notes
Prerequisite: On the Azure dashboard, we must create a new app service and resource group that the app service belongs to.
For simplicity, suppose our app is named beego-way
and the resource group is named jedi-service_group
.
Firstly, we must set deployment user:
az webapp deployment user set --user-name <username> --password <password>
Get git clone url (or deployment url):
az webapp deployment source config-local-git --name beego-way --resource-group
jedi-service_group
Add remote git url and deploy:
git remote add azure <deployment_url>
git push azure master
Get log from our app:
az webapp log tail --name beego-way --resource-group jedi-service_group
ssh to app service
az webapp list-instances --name beego-way--resource-group jedi-service_group -o table # => instance-name
az webapp ssh -n beego-way -g jedi-service_group -i <instance-name>
Note: Postgresql on Azure
For example, we have a postgresql database is named jedi-psql
on the same resource group jedi-service_group
.
az postgres server show --resource-group jedi-service_group --name jedi-psql
psql --host=jedi-psql.postgres.database.azure.com --port=5432 --username=<username>@jedi-psql --dbname=postgres