Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add command line arguments to Azure Web App?

Locally we can do dotnet run [args] or dotnet publish followed by dotnet mydll.dll [args].

When deploying that App to an Azure Web App under App Services, how do you make it startup with these command line arguments?

like image 244
Dac0d3r Avatar asked Jan 31 '18 22:01

Dac0d3r


People also ask

How do I add a connection string in Azure app?

Configure connection strings. In the Azure portal, search for and select App Services, and then select your app. In the app's left menu, select Configuration > Application settings. For ASP.NET and ASP.NET Core developers, setting connection strings in App Service are like setting them in <connectionStrings> in Web.


1 Answers

You can use the Kudu API Rest to execute command lines operations.

Documentation: https://github.com/projectkudu/kudu/wiki/REST-API

POST /api/command

Executes an arbitrary command line and return its output

{
"command": 'echo Hello World',
"dir": 'site\\repository'
}

The JSON body of the post should look like this, passing the command and the folder it should run in.

You need to use Basic Auth (Get your credentials in Overview / Get Publish Profile Section) in order to make a POST request.

like image 101
Sebastian Moreno E Avatar answered Oct 29 '22 16:10

Sebastian Moreno E