Deploying a Flogo App to a Microsoft Azure Container Instance
Before you begin
- Create a Microsoft Azure account.
- Download and install Microsoft Azure CLI.
- Create a docker image of the Flogo app that needs to be deployed to the Microsoft Azure Container Instance.
- For information on Microsoft Azure commands, refer to the Microsoft Azure documentation.
- Procedure
- Create a new resource group using the following command:
az group create -l <location> -n <name-of-group>
- If you have not created an Azure Container Registry, create one using the following command. This Azure Container Registry stores all the images that are pushed to the registry.
az acr create -n <name-of-registry> -g <name-of-group> --sku <pricing-tier-plan> --admin-enabled true
Note: You must set--admin-enabled
totrue
. - Log in to Azure Container Registry using the following command:
az acr login -n <name-of-registry>
- Tag and push the Flogo app docker image to Azure Container Registry using the following commands:
docker tag <app-tag> <CONTAINER_REGISTRY_URI>/<app-tag> docker push <CONTAINER_REGISTRY_URI>/<app-tag>
- Create an Azure Container instance using the following command:
az container create -g <name-of-resource-group> --name <name-of-container> --image <name-of-image> --environment-variables <name=value name=value FLOGO_APP_PROPS_ENV=auto> --dns-name-label <dns-name-label-for-container-group> --ip-address Public --ports <port-to-open> --registry-login-server <name-of-container-image-registry-login-server> --registry-username <username> --registry-password <password> #NOTE: If--environment-variables FLOGO_APP_PROPS_ENV=auto is not set, the environment variables are not detected at Flogo runtime. #NOTE: IP Address must be explicitly set to Public.
For example:
az container create -g flogodemo --name flogoapp --image flogoacr.azurecr.io/acs_flogo:latest --environment-variables prop_str=azure FLOGO_APP_PROPS_ENV=auto --dns-name-label flogoappazure --ip-address Public --ports 9999 --registry-login-server flogoacr.azurecr.io --registry-username <username> --registry-password <password> #where prop_str is the app property defined in the flogo app which is being overridden from this command
- Get container logs using the following commands:
az container logs --resource-group <name-of-resource-group> --name <name-of-container>