4

I am trying to host my .Net core MVC 2.1 linux application in azure WebApp. How do i know the Linux flavour, O/S, version running on WebApp? I am selecting 'West US' as region.

I think this is needed while i build my code on my development machine: How to compile .NET Core app for Linux on a windows machine My dev machine is ubuntu and Production server is CentOS

knowdotnet
  • 839
  • 1
  • 15
  • 29

2 Answers2

4

You can get system info from the Kudu environment. Kudu is the central nervous system of a Microsoft Azure Web Site; it handles the Git integration to a Web Site as well as provides an API endpoint for programmatic access to app settings, deployment information, files, active processes, runtime versions, source control information, web hooks and web jobs.

To get to Kudo, navigate to https://<webappname>.scm.azurewebsites.net, from there you can click on Environment to get something like this:

enter image description here

System info

  • System up time: 4.10:36:14.7190000
  • OS version: Unix 4.4.0.128
  • 64 bit system: True
  • 64 bit process: True
Ken W - Zero Networks
  • 3,533
  • 1
  • 13
  • 18
  • I followed the steps you mentioned @Ken but this is what is see https://imgur.com/a/dag4OCT. I still cannot see the linux version etc.. – knowdotnet Feb 11 '19 at 07:17
  • updated my answer with a picture to show where to click. – Ken W - Zero Networks Feb 11 '19 at 12:45
  • so what we mean by Unix 4.**** here. Is it mean Redhat or Ubuntu or CentOS? and what versions of these. Asking further for other comm members help in future – knowdotnet Feb 21 '19 at 19:41
  • I'm not sure it really matters, since this is PaaS, it's the cloud service provider's responsibility for the OS and Runtime. You can't make any modifications and we will update as needed per our SLA. – Ken W - Zero Networks Feb 21 '19 at 20:28
  • @ Ken W MSFT, i thoughts it is needed to build my dotnet core code with correct runtime identfier. – knowdotnet Feb 21 '19 at 20:31
  • @ken-w-msft it matters because some compiled c++ programs don't work on evey linux distribution. I'm currently struggling to run a c++ program on app service built in another linux distro (i.e. azure pipelines!) – Jthorpe Mar 25 '21 at 17:04
  • 1
    Running `cat /etc/os-release` shows that in my case, it's "Debian GNU/Linux 10 (buster)". Now, I'm assuming that running the Debian installation directions for what I want to install, should work. – TechFanDan Nov 29 '21 at 13:54
  • "Unix" is not a Linux distribution. This answer is incorrect. – Tristan Jul 07 '22 at 17:13
2

When you use Web App in Azure, you need to create the Service Plan first, it will need to decide the system type: Linux or Windows. And then when you create the web app, there is also a chance to choose a runtime for your web app in your Linux service plan(in your case, Linux is you need).

Azure provides some Built-in images as the runtime. See Build-in Runtime. If the runtime your application requires is not supported in the built-in images, you also can build your own Docker image as you need for your application. See Use a custom Docker image for Web App.

So you do not need to know what the OS is, you can just create the choose the OS you need. If you really really want to know the OS version, you can create an SSh session to your web app and run shell commands to check what the OS version is. See SSH support for Azure App Service on Linux.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • This is not my query was. However i got this resolved. I am using Ubuntu 16.04 machine to build my .net core 2.1 MVC and deploying on Azure WebApp for Linux with .net core 2.1 . Its working. i used dotnet publish -c Release to build my code. – knowdotnet Feb 21 '19 at 19:39
  • @knowdotnet As I said in the answer, Azure provides the Runtime for you, it means the application running environment. For you, the Linux based service plan and the .net core 2.1 Runtime. So I think my answer give the solution to you. – Charles Xu Mar 08 '19 at 09:34
  • This does not address the question, which was "what is the host OS?", and not "what is the application runtime?" Calling `cat /etc/os-release` in ans SSH session shows that the OS a custom Azure OS, but it's not clear what that is based on (Redhat? Debian? Ubuntu?) This matters for apps with compiled (i.e. c++) components. – Jthorpe Mar 25 '21 at 17:13
  • @Jthorpe What is the reason you vote down the answer?! You didn't understand the App service clearly. You can't connect to the service plan, so you wouldn't know the OS of the plan. And Linux container hosts on Linux Plan, windows hosts on Windows. I said the right things. – Charles Xu Mar 26 '21 at 02:37