The good, the bad and the ugly
Azure Database for PostgreSQL
Azure Database for MySQL
Azure Database for MariaDB
- Creating is easy :)
- 5-15 minutes :(
- I will cheat a bit
az cosmosdb create \
--name $COSMOS_DB_NAME \
--resource-group $group \
--kind MongoDB
var query = _dbClient.Where<UserDocument>( _collectionUri,
d =>d.User.Email.ToLower() == criteria.SearchString);
SELECT * FROM c
WHERE LOWER(c.User.Email) = "{search}"
------------------------------
var query = _dbClient.Where<UserDocument>( _collectionUri,
d => d.User.Email.Equals(originalSearchString,
StringComparison.OrdinalIgnoreCase));
SELECT * FROM c
WHERE STRINGEQUALS(c.User.Email, "{search}", true)
with Azure CLI
az acr create \
-n $ACR_NAME \
-g $group -l westeurope \
--sku Standard \
--admin-enabled true
with Azure CLI
# build data-api
az acr build \
--registry $ACR_NAME \
-g $group \
--file node/data-api/Dockerfile \
--image smilr/data-api $GIT_URL
# build frontend
az acr build \
--registry $ACR_NAME \
-g $group \
--file node/frontend/Dockerfile \
--image smilr/frontend $GIT_URL
# get logs
az acr task logs \
--registry $ACR_NAME \
-g $group
More:
Something to host apps :)
az appservice plan create \
-n appPlan \
-g $group \
--sku B1 --is-linux
To deploy demo app we need:
- Cosmos (Mongo) connection string
- Azure Container Registry Credentials
export COSMOS_CONN_STR=$(az cosmosdb keys list \
-n $COSMOS_DB_NAME -g $group \
--type connection-strings \
--query 'connectionStrings[0].connectionString' -o tsv)
DOCKER_PASS=$(az acr credential show -n $ACR_NAME -g $group \
--query 'passwords[0].value' -o tsv)
DOCKER_USER=$(az acr credential show -n $ACR_NAME -g $group \
--query 'username' -o tsv)
with CLI
# Create
az webapp create --plan appPlan \
-n $APP_DATA -g $group \
--deployment-container-image-name \
$ACR_NAME.azurecr.io/smilr/data-api \
--docker-registry-server-user \
$DOCKER_USER \
--docker-registry-server-password \
$DOCKER_PASS
# Database connection
az webapp config appsettings set \
-g $group -n $APP_DATA \
--settings \
MONGO_CONNSTR=$COSMOS_CONN_STR
# curl
curl $APP_DATA.azurewebsites.net
# Create
az webapp create --plan appPlan -n $APP_FRONT -g $group \
--deployment-container-image-name \
$ACR_NAME.azurecr.io/smilr/frontend \
--docker-registry-server-user $DOCKER_USER \
--docker-registry-server-password $DOCKER_PASS
# App settings
az webapp config appsettings set -g $group -n $APP_FRONT \
--settings \
API_ENDPOINT=https://$APP_DATA.azurewebsites.net/api
# browser
open https://$APP_FRONT.azurewebsites.net
with Azure CLI
- 10-15 minutes
- machine size is important
az aks create \
-g $group -n $AKS_NAME \
--node-vm-size Standard_DS2_v2 \
--node-count 2 \
--generate-ssh-keys
# Attach ACR
az aks update \
-n $AKS_NAME \
-g $group \
--attach-acr $ACR_NAME
- use it as any other Kubernetes cluster
# Get kubectl credentials
az aks get-credentials \
-n $AKS_NAME \
-g $group --admin
- envsubst is a nice util to substitute env variables in text files
- rest is normal k8s deployment
# deploy ingress
k apply -f ingress/ingress.yaml
k apply -f ingress/ingress-ip.yaml
# deploy data api
envsubst < data-api.yaml | \
kubectl apply -f -
# deploy frontend
envsubst < frontend.yaml | \
kubectl apply -f -
# deploy ingress rules
k apply -f ingress-rules.yaml
Service | Purpose | Type | When to use |
---|---|---|---|
Event Grid | Reactive programming | Event distribution (discrete) | React to status changes |
Event Hubs | Big data pipeline | Event streaming (series) | Telemetry and distributed data streaming |
Service Bus | High-value enterprise messaging | Message | Order processing and financial transactions |
AMPQ 1.0 protocol is supported by:
"Poznaj Azure" next project: