- create a resorce group
- create a Service Principal and generate its secrete Azure Active Directory -> App registration -> New Registration The secrete you can generate by clicking on your new application registry Certificates & Secretes -> New Client Secrete -> copy secrete value
- add the Service Principal as a contributor in the resorce group
- adjust .env file for local testing and create testing.tfvars file for terraform deployment
testing.tfvars:
resource_group = "mk-test"
region = "East US"
client_id = ""
secrete = ""
project = "az"
.env
AZURE_STORAGE_ACCOUNT_KEY=""
AZURE_STORAGE_ACCOUNT_NAME=""
- execute terraform script to create resorces
az login
terraform init
terraform plan -var-file="testing.tfvars"
terraform apply -var-file="testing.tfvars"
If you can't see the docker image in container registry you can build the docker and upload it using the instruction bellow "container registry - deploy docker to Azure container registy" and restart terraform script.
docker build -t tree .
docker run --name tree -d tree
docker run -d --env-file .env --name tree tree
- you need to start docker service
az acr login --name [registyname]
docker tag tree [registyname].azurecr.io/tree
docker push [registyname].azurecr.io/tree
az acr update -n [registyname] --admin-enabled true