Given the following C#/.NET console application running on my Azure Batch Pool/Task:
class Program
{
static async Task Main(string[] args)
{
try
{
Console.WriteLine(args[0]);
Console.WriteLine(args[1]);
}
catch
{
Console.WriteLine($"Could not parse arguments");
}
}
}
How can I pass the args when adding a command line to my tasks in a Linux/Ubuntu VM. I have tried the following with no success:
/bin/sh -c $AZ_BATCH_APP_PACKAGE_Program_1_0/Program -args ‘arg1’ ‘arg2’
/bin/sh -c $AZ_BATCH_APP_PACKAGE_Program_1_0/Program -args ‘arg1’, ‘arg2’
/bin/sh -c $AZ_BATCH_APP_PACKAGE_Program_1_0/Program ‘arg1’ ‘arg2’
/bin/sh -c $AZ_BATCH_APP_PACKAGE_Program_1_0/Program ‘arg1’, ‘arg2’
/bin/sh -c $AZ_BATCH_APP_PACKAGE_Program_1_0/Program -i ‘arg1’ ‘arg2’
/bin/sh -c $AZ_BATCH_APP_PACKAGE_Program_1_0/Program -i ‘arg1’, ‘arg2’
I am able to run the application but the arguments are not passed in and I only get to the “Could not parse arguments” output…