Azure offers a Kubernetes solution, which we looked at in the post Running and deploying to Azure Kubernetes and also a solution called simply Azure Container Apps.
In fact Container apps are built upon Kubernetes, just think of them as a simplification layer on top of k8s.
The main difference between the Kubernetes offering and container apps is exactly that – simplicity. You don’t get the managed infrastructure with container apps. Container apps are essentially a “serverless” solution. Container apps. also have the ability to scale, not just on CPU or memory usage but also on HTTP requests and events, such as those from the Azure Service Bus. So for example, if there are no items in the service bus queue then containers apps can scale down.
Let’s create our Container App…
- Either search for Container App in the Azure dashboard or Create a resource then from the Containers category select Container App
- As usual select or create a resource group
- Give you container app a name, mine’s test-container
- Set the region etc.
- Select the Container tab and uncheck the Use quickstart image as we’re use the Azure registry where we pushed our images to in the previous post Running and deploying to Azure Kubernetes
- Set the Registry to your Azure registry OR the Docker registry. If you get Cannot access ACR XXX because admin credentials on the ACR are disabled. then goto to your Azure registry and select Access Keys where you can enable Admin user – if you have to do this step you’ll probably have to start the creation process over again.
- Now select an image from your registry and the image tag
- To expose our service we’ll now select the Ingress tab and tick Enabled, leave as Limited to Container Apps Environment checked OR if you want to expose your app to the world then endure Accepting traffic from anywhere is checked. Now set Target port to whatever you want, I’m going with the standard port 80
Now click Review + create then when you’re happy with the review, click the Create button.
When completed an Application Url should be created. We set the Ingress as Limited to Container App Environment, so this will not be available to the outside world.
If you have more services to add, then add another container app, search the Dashboard for Container Apps Environments select the environment that was created by Azure then select the Apps | Apps option from the left hand navigation bar. From here we can go through the same process as above and add further apps.
Once created, select the Application Url for the container and this should now be accessible internally or via the web depending on what ingress traffic option you chose.