You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
az account list
az account list –-output table
az account list –o table
Select subscription.
az account set --subscription [subscription-id]
Create a Linux VM
Create a new resource group and Linux VM.
az group create --location southeastasia --name MyRG
az vm create -n [myVM] -g [MyRG] --image UbuntuLTS --generate-ssh-keys
az vm list-ip-addresses –n [myVM] –g [MyRG]
ssh [your-ip-address]
List available images on Azure
az vm image list -o table
Cleaning up
az group delete -n [MyRG]
Deploy a PHP App to App Service
# Create a resource group
az group create --name [myResourceGroup] --location [southeastasia]
# Create an Azure App Service plan
az appservice plan create --name [myAppServicePlan] --resource-group [myResourceGroup] --sku S1
# Create a web app
az webapp create --name [app name] --resource-group [myResourceGroup] --plan [myAppServicePlan]
# Deploy code from a public GitHub repository.
az webapp deployment source config --name [app name] --resource-group [myResourceGroup] --repo-url https://github.com/Azure-Samples/php-docs-hello-world --branch master --manual-integration
# Browse the app
curl http://[app name].azurewebsites.net/
# Cleaning up
az group delete --name [myResourceGroup]
Deploy a PHP App to App Service on Linux
# Create a resource group
az group create --name [myResourceGroup] --location [southeastasia]
# Create an Azure App Service plan
az appservice plan create --name [myAppServicePlan] --resource-group [myResourceGroup] --sku S1 --is-linux
# Create a web app
az webapp create --name [app name] --resource-group [myResourceGroup] --plan [myAppServicePlan] --runtime "php|7.2"# Deploy code from a public GitHub repository.
az webapp deployment source config --name [app name] --resource-group [myResourceGroup] --repo-url https://github.com/Azure-Samples/php-docs-hello-world --branch master --manual-integration
# Browse the app
curl http://[app name].azurewebsites.net/
# Cleaning up
az group delete --name [myResourceGroup]
Deploy a Custom image to Web App for Containers
# Create a resource group
az group create --name [myResourceGroup] --location [southeastasia]
# Create an Azure App Service plan
az appservice plan create --name [myAppServicePlan] --resource-group [myResourceGroup] --sku S1 --is-linux
# Create a web app
az webapp create --resource-group [myResourceGroup] --plan [myAppServicePlan] --name [app name] --deployment-container-image-name microsoft/azure-appservices-go-quickstart
# Browse the app
curl http://[app name].azurewebsites.net/hello
# Cleaning up
az group delete --name [myResourceGroup]
List available location
az account list-locations -o table
az appservice list-locations --linux-workers-enabled --sku B1 -o table
# Create k8s definition yaml
vi azure-vote.yaml
# Create a resource group
az group create --name [myResourceGroup] --location eastus
# Create AKS cluster
az aks create --resource-group [myResourceGroup] --name [myAKSCluster] --node-count 1 --generate-ssh-keys
# Connect to the cluster
az aks install-cli
az aks get-credentials --resource-group [myResourceGroup] --name [myAKSCluster]
kubectl get nodes
# Run the application
kubectl create -f azure-vote.yaml
kubectl get service azure-vote-front --watch
# Cleaning up
az group delete -n [myResourceGroup]
# Create a resource group
az group create --name [myResourceGroup] --location [eastus]
# Create a Container
az container create --resource-group [myResourceGroup] --name [mycontainer] --image microsoft/aci-helloworld --dns-name-label [aci-demo] --ports 80
# Show provisioning status
watch -n 1 az container show --resource-group [myResourceGroup] --name [mycontainer] --query "{FQDN:ipAddress.fqdn,ProvisioningState:provisioningState}" --out table
# Once the container moves to the Succeeded state, you can reach it in your browser by navigating to its FQDN# Cleaning up
az group delete -n [myResourceGroup]
Azure Database for MySQL
# Create a resource group
az group create --name [myresourcegroup] --location [southeastasia]
# Create an Azure Database for MySQL server# “--sku-name” is “tier + family + cores” e.g. B_Gen4_1, GP_Gen5_8
az mysql server create --location [southeastasia] --resource-group [myresourcegroup] --name [myservername] --admin-user [myadmin] --admin-password [server_admin_password] --sku-name GP_Gen4_2 --version 5.7
# Configure firewall rule
az mysql server firewall-rule create --resource-group [myresourcegroup] --server [myservername] --name AllowYourIP --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0
# Get the connection information# Make a note of the FQDN and administratorLogin.
az mysql server show --resource-group [myresourcegroup] --name [myservername]
# Connect to the server using the mysql.exe command
mysql -h [myservername].mysql.database.azure.com -u myadmin@ <myservername> -p
mysql> status
# Cleaning up
az group delete -n [myResourceGroup]
Azure Database for PostgreSQL
# Create a resource group
az group create --name [myresourcegroup] --location [southeastasia]
# Create an Azure Database for PostgreSQL server# “--sku-name” is “tier + family + cores” e.g. B_Gen4_1, GP_Gen5_8
az postgres server create --location [southeastasia] --resource-group [myresourcegroup] --name [myservername] --admin-user [myadmin] --admin-password [server_admin_password] --sku-name GP_Gen5_2 --version 9.6
# Configure firewall rule
az postgres server firewall-rule create --resource-group [myresourcegroup] --server [myservername] --name AllowYourIP --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0
# Get the connection information# Make a note of the FQDN and administratorLogin.
az postgres server show --resource-group [myresourcegroup] --name [myservername]
# Connect to the server using the psql command
psql --host=[myservername].postgres.database.azure.com --port=5432 --username=[user@myservername] --dbname=postgres
# Cleaning up
az group delete -n [myResourceGroup]