0

I have a problem with my Azure Functions App on Linux. I create a simple .NET function for Azure Function Linux. In that function I try to run a simple compiled app created in C++. I saw in this Stack Overflow question that someone could run a .exe file on Azure Function Windows. I tried it and it works.

My Function ran a .exe file and returned content from them. So I try to do the same thing, but on Azure Functions Linux. When I'm trying to run a compiled file, the Function returns an exception with message "Permission denied".

I used the same code as in the link and I created a function in VS 2019 because I can't do it from the Azure Portal.

rickvdbosch
  • 14,105
  • 2
  • 40
  • 53
  • Hi and welcome to Stack Overflow. In its current form, this question is no fit for SO. Could you explain a bit better what you're trying to do, what you tried and where you failed? Please refer to [ask]. On-topic: Azure Functions run on a sandbox, so running executable-like will not be a simple feat. – rickvdbosch Oct 27 '21 at 11:48
  • Hello and sorry, I updated the post with new information. – Bartek Górski Oct 27 '21 at 12:18
  • There could be a couple of things causing this. For one: what type of compiled app is it? Does it try to access (system) resources it doesn't have access to? Is the error thrown in the Function code or in the compiled app? – rickvdbosch Oct 27 '21 at 12:28
  • The compiled application is very simple, it adds the two received numbers. The error was reported in the function code. – Bartek Górski Oct 27 '21 at 12:37
  • By any chance have you gone through this https://learn.microsoft.com/en-us/azure/azure-functions/create-function-app-linux-app-service-plan – SaiSakethGuduru Oct 28 '21 at 06:24

1 Answers1

0

Created the timer trigger function in the function app and After that, I uploaded .exe file in the Code+Test Environment of Timer Trigger Function.

function.json

{  
"bindings": [  
{  
"name": "myTimer",  
"type": "timerTrigger",  
"direction": "in",  
"schedule": "0 */1 * * * *"  
}  
],  
"disabled": false  
}  

I have followed this SO thread to insert the code in run.csx file for running .exe file in function application and the execution is succeeded.

![enter image description here](https://imgur.com/jiwnWdW)

After installing the .exe file open the Kudo console and type the below command so that you can read the elf files from there you can check the required attributes

readelf

enter image description here

if you want to get the version of elf file use readelf -v enter image description here

SaiSakethGuduru
  • 2,218
  • 1
  • 5
  • 15