TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Venkat Kumar
NA
503
143.1k
Retrieve the Status of the webjob after immediate run
Feb 27 2018 1:00 AM
I have written a code to run the Azure Webjob and the job ran successful. But I want to retrieve the
Status(Success/Failed)
of the webjob after immediate run.
Webjob takes 5 mints to change the status from running to succees/fail.
Here is my code
//App Service Publish Profile Credentials
string userName = ConfigurationManager.AppSettings[envName + "UserName"];
string userPassword = ConfigurationManager.AppSettings[envName + "Password"];
var unEncodedString = String.Format($"{userName}:{userPassword}");
var encodedString = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(unEncodedString));
string URL = UrlToRunWebJob;
System.Net.WebRequest request = System.Net.WebRequest.Create(URL);
request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = 0;
request.Headers["Authorization"] = "Basic " + encodedString;
System.Net.WebResponse response = request.GetResponse(); //This line will execute the webjob
//
Here I have to wait for 5 mints to get the status but It is stepping into the next line immediately.
//
var responsetext = new StreamReader(response.GetResponseStream()).ReadToEnd();
Here responsetext is showing null. But I want the details of current executed webjob status.
Can someone help me on this issue?
Reply
Answers (
1
)
I need help for bind html table using datatable?
Update perticular row data into database using Linq To SQl.