Azure Container Instance Pricing - azure

I am trying to deploy a ASP net core web application in Azure Container Instance. Since it is having a microservice pattern I had to create 3 container groups for 2 API's and 1 for the web application. Each container group is having one application container and an nginx side cart to act as a reverse proxy. But I have getting around 120$ bill for these container instances alone. Each container is allocated 0.2GB Ram and 0.2GB CPU.
I am pretty new to Container instances and I am not sure if my approach is correct? Can any one suggest is it the right approach for hosting the application and also am I missing or misconfiguring some configurations while creating the container instances?

Related

Scale out Windows container in Azure App Service

We are running our application using Azure App Service. It is based in .NET FW 4.7 with Webforms and API Rest. We are using PC3 App Service Plan (16GB RAM). The application is stateless and it supports the Application Service scale out without a problem.
In a first step to modernize our infrastructure, the application was packaged in a Windows Container and it is executed in an App Service. The image is based on mcr.microsoft.com/dotnet/framework/aspnet:4.8 and uploaded to ACR. The problem occurs when trying to scale out the application. At the time of scale-out, the new container is added to the balancer and some requests are answered with "The Web App's container is starting up!"
Is there a way to add the new container to the balancer only when it is fully functional?
Note: I don't know if this is related to the problem but it appears in the log:
CONTAINER_HEALTH_CHECK_MODE app setting is set to ReportOnly. Container will not be recycled. For container to be recycled when it becomes unhealthy set it to Repair

Difference between Azure App Services and Web App for Containers

I was looking to use Azure App Services and noticed Azure now offers Web App for Containers, now I wonder what's the difference between them? And couple more questions come to my mind
Assuming I choose Web App for Containers, who is going to manage the container updates?
Is the deployment differs from App Services to Web App for Containers, from application perspective?
Web App for Containers is one of the offerings in Azure App Service. It allows you to deploy containerized applications on Linux and Windows (the latter is in preview).
The platform automatically takes care of OS patching, capacity provisioning, and load balancing. But, the container updates are up to you.
The deployment differs in that you will be deploying your application inside a Docker container instead of deploying directly like you do in a Web App.

Difference between Azure Container Service and Web App for Containers

What is the difference between Azure Container Service and Web App for Containers?
They both seem to offer a fully managed platform on which we can deploy containers. I feel that Web App for Containers must be offering something more, but I don't see it. I've read the Azure Container Service FAQ and the Web App for Containers intro page, but the difference is not obvious to me.
Web App for Containers lets you run your custom Docker container which hosts your Web Application. By default the Web App Service with Linux OS provides built-in Docker images like PHP 7.0 and Node.js 4.5. But by following the instructions from this webpage you can also host your custom docker images which allows you to define your own SW-Stack. The limitation is that you can only deploy one docker image to an App Service. You can scale the App Service to use multiple instances, but each instance will have the same docker image deployed. So this allows you to use Docker as a Service, but isn't intended for deploying Microservices.
Container Services (ACS), Kubernetes Service (AKS) and Service Fabric allow you to deploy and manage multiple (different) Docker containers which might also need to communicate with each other. Let's say you implement a shopping website and want to build your web application based on a Microservices architecture. You end up having one Service (= container) which is used for registration & login of users and another Service which is used for the visitors' shopping carts and purchasing items. Additionally you have many further small services for all the other needed tasks. Because the purchasing service is used more frequently than the sign-up/sign-in service, you will need, for example, 6 instances of the sign-up/sign-in service and 12 instances of the cart service. Basically, ACS, AKS and Service Fabric let you deploy and manage all those different Microservices.
If you want to know the difference between ACS/AKS and Service Fabric you might want to have a look here.

Azure Web aps- When scale out on Web Apps happens does it put load balancer

Sorry guys if my question does not make sense. Let us say I have a website running in cloud. It is running under one instance.
I have a Scale out app service plan such that when CPU usage is more than 80% it creates one more instance. On day 3 let us say CPU usage gets to 85% and one more instance is created. My question is
1) Is it going to put a load balancer in front of these two instances.
2) Are these two Virtual machines going to be in different fault domain?
3) when I have two instances and I deploy from Visual studio, is it going to deploy to both instances?
1) Is it going to put a load balancer in front of these two
instances.
The answer is yes, after you enable autoscale settings, when your service receives additional traffic, you will get more instances without doing anything.
2) Are these two Virtual machines going to be in different fault
domain?
When multiple Cloud Service role instances are deployed, Azure deploys these instances to different fault domains.
More information about cloud service instances and fault domains, please refer to this blob.
3) when I have two instances and I deploy from Visual studio, is it
going to deploy to both instances?
No, after we deploy a new package, it will be applied in all instances of your WebApp.
More information about how to deploy APP to Azure app service, please refer to the link.
1-) Yes
2-) Probably, however I can't say this with 100% sure, because WebApps are PaaS, you delegate the management to Microsoft.
3-) When you deploy a new package it will be applied in all instances of your WebApp.

Azure Docker Container Service Multiple Instances

I'm using Azure for the first time to deploy a web app. More specifically, I'm using the Docker Container Service to do this. I already have one instance of it deployed. But, I want to also deploy 2 more instances of the same web app. I want each instance to have a different URL. What is the best way of doing this? Do I have to add a new container service for each new instance and repeat the steps I did for deploying the first instance?
As in case of Azure Container Service (ACS),
You choose a container orchestrator i.e. Swarm, DC\OS and Kubernetes (Because creating replicas works differently in each of them).
In case of Swarm then either create a separate application container for the same application with a different end point and use automatic discovery feature for different URL(s) or choose a reverse-proxy load-balancer such as Nginx which will work on the same URL but on a different port (My blog here might help you).
Creating replicas across a cluster are used for Load Balancing, Routing Mesh, Scaling and Rolling updates etc.

Resources