Azure Web Jobs Calling it from C# with Parameters

Question!

I am trying to call a webjob from asp.net c# page. When I check the log it shows that it run but nothing is in the log except. It should say "Dan's Phone Number is 5551212"

[01/15/2015 14:29:18 > 898371: SYS INFO] Status changed to Initializing
[01/15/2015 14:29:20 > 898371: SYS INFO] Run script 'EncodeAsset.exe' with script host - 'WindowsScriptHost'
[01/15/2015 14:29:20 > 898371: SYS INFO] Status changed to Running
[01/15/2015 14:29:20 > 898371: SYS INFO] Status changed to Success

Here is my code:

public partial class Test : System.Web.UI.Page
{

    protected void Button1_Click(object sender, EventArgs e)
    {
        Process myProcess = new Process();
        myProcess.StartInfo.FileName = @"D:\home\site\wwwroot\app_data\jobs\triggered\EncodeAsset\EncodeAsset.exe";
        myProcess.Start();
    }
}

class Program
{
    // Please set the following connection strings in app.config for this WebJob to run:
    // AzureWebJobsDashboard and AzureWebJobsStorage
    static void Main()
    {
    }

    public static void Testing([QueueTrigger("queuejobs")]string message)
    {
        Console.WriteLine("Dan's Phone Number is:", message);
    }
}
By : Dan Nick


Answers

Here's a sample on MSDN which is pretty straightforward. Hope that will help you https://code.msdn.microsoft.com/Simple-Azure-Website-with-b4391eeb



This video can help you solving your question :)
By: admin