Can I deploy a docker container to Azure Webapp - azure

I found a lot of resources online on using docker with Azure virtual machines. But didn't find any on using docker with Azure Webapps. Is this possible?

Things are changing fast in the cloud. Since November 2016, it is now possible on linux web apps to run docker containers. You can read about it here. https://buildazure.com/2016/11/18/deploy-docker-containers-to-azure-web-apps-on-linux

No. Web Apps are a Platform-as-a-Service from Azure which use a bespoke packaging and runtime, you can't just create a Web App, point it to a Docker image and run it as a container.
If you want to run Docker on Azure, you can spin up a VM to use as a single host - you can use an Ubuntu image for Linux containers or a Windows Server 2016 image for Windows containers (currently in preview).
To create a Docker Swarm running on Azure you can use Azure Container Service or Docker for Azure.

No, because a webapp is a PaaS that Azure provides, that allows you to push a website with there settings (to simplify it) with ease.
But, you can push a website onto docker using Azure.

Web Apps, running under App Service, is Webapp-as-a-Service. Nothing to do with Docker. It has its specific methods of code deployment built-in, and does not support Docker images.
That's not to say you cannot have Web Apps and Docker images communicate between each other - you can certainly have, say, your database in a Docker container, being called by your Web App.

Related

How many different ways are there to deploy a website under azure portal?

Good day dear community,
i have a smaller project where i need to search for different possibilities to deploy a website under azure portal.
Personally i found 4 different ways how to do it.
App services
App functions Serverless (which i dont understand how to deploy there a website)
Install a VM and then deploy a website
Use docker to deploy your code
Question:
Are there any more ways to deploy a website under azure and can somebody explain the deployment of websites with serverless as i dont understand how to publish a website there. i just managed to get the httptriggers and i am confused with that.
Thanks in advance
sorry for any spelling mistakes.
You can deploy to a website to a VM. But first you will have to setup the VM to be a web server. There are many different pre-configured images with either Linux or Windows OS. This will require you manage the OS of the VM.
An Azure App Service will abstract the OS and VM away from you. The OS will be managed for you and you can configure many settings through the Azure Portal. There are different plans that allow you to use more compute and/or memory. You can also setup Authentication through the portal. You can also elect to deploy you website inside a container to an App Service.
There are also Azure Function Apps which can be used. Azure Function Apps are not intended to serve as the backend to a website, but it can be. These are meant to serve only one purpose, not many like the backend of a whole website ( for example, you might use a different function app to serve content each page of a website instead of just one app service having multiple endpoints serving all pages of a website). With Azure function apps, you can deploy in a container or not in a container.
I am not sure what you mean by number 4, Container over docker. You can deploy a docker container an App Service or a Function App. You can deploy the container to docker hub or azure container registry (to name a couple), but that will not deploy your website so that it is accessible.

Azure windows self-hosted agent with docker installed

We are trying to develop Azure windows self-hosted to run Azure pipelines.
However, these agents are deployed on kubernetes. And we want these agents to be able to use docker for build/push operations. meaning we need docker inside docker.
Is it possible to install docker on these windows self-hosted agents ?
You need to set up a self-hosted agent in Azure Pipelines to run inside a Windows Server Core (for Windows hosts), or Ubuntu container (for Linux hosts) with Docker. Detailed steps you may refer to the following link:
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops

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.

Do I need SSH tunnel to deploy Docker containers from Windows Server 2016 using Full CI/CD pipeline

Thank you very much for your help with the previous questions
Deploying Windows Containers (created with Docker) into Azure Container Service
Windows Container vs Docker Container and Azure Container Services/Kubernetes cluster with Linux OS
I am continuing my research and somewhat at a standstill as I try to follow the instructions of the following article that explains how to create CI/CD pipeline to deploy a multi-container application.
https://learn.microsoft.com/en-us/azure/container-service/dcos-swarm/container-service-docker-swarm-setup-ci-cd
The code sample that is referenced here is built for the Linux application, and I am not able to run it or create Docker container out of it.
Thus, I have following questions (those questions could be all over the place, my apologies for that)
When I create a .Net Core Web API on Windows 2016 server, is there any possibility for me to create an application that I could deploy to a Linux environment? (portable .NET Core Web API application)
When I would like to take advantage of CI/CD pipeline using Visual Studio Team Services, do I really need to create Azure Container Service with Docker Swarm? As far as I understand ACS is a Linux based environment whereas I would create Windows based docker containers on Windows Server 2016
Do I really need to be concerned with ACS and SSH tunnel when dealing with Windows Server 2016 based docker containers if I could easily deploy those containers to a Kubernetes cluster with Windows nodes
Is there an alternative way for me to deploy docker containers created on Windows Server 2016 using Full CI/CD pipeline to Visual Studio Team Services without using the Linux based SSH tunnel/ACS
Thank you very much for your generous input
Mikhail
1.When I create a .Net Core Web API on Windows 2016 server, is there any
possibility for me to create an application that I could deploy to a
Linux environment?
Yes, .Net core is a general purpose development platform maintained by Microsoft and the .NET community on GitHub. It is cross-platform, supporting Windows, macOS and Linux, and can be used in device, cloud, and embedded/IoT scenarios. So we can deploy .net core web api app on Linux environment.
Maybe we can refer to this link.
2.When I would like to take advantage of CI/CD pipeline using Visual
Studio Team Services, do I really need to create Azure Container
Service with Docker Swarm?
No, creating a CI/CD pipeline on Azure Container service with kubernetes and visual studio team services is available. More information about VSTS and ACS k8s, please refer to this link.
3.Do I really need to be concerned with ACS and SSH tunnel when dealing with Windows Server 2016 based docker containers if I could
easily deploy those containers to a Kubernetes cluster with Windows
nodes
If you want to use VSTS to deploy your .net core container, I think we should connect to ACS cluster.
If you want to use ACS k8s, we should add kubernetes connection:
4.Is there an alternative way for me to deploy docker containers created on Windows Server 2016 using Full CI/CD pipeline to Visual
Studio Team Services without using the Linux based SSH tunnel/ACS
Do you mean you want to use ACS, but don't want to connect Linux based SSH tunnel? If I am right, we can deploy a site-to-site VPN between your on-prem network and Azure Vnet, in this way, we can connect k8s like local.

Resources