It seems no c# library for us to use. I find a method in java code which maybe helpful to your question, we can also write java code in azure function to implement your requirements:
/**
* Add a task to a given project
* @param projectID The GUID of the project
* @param feature The text of the task
* @param startDate The start date of the task
* @return true/false on success (see Communications.lastError for details if failed)
* @throws IOException
* @throws UnsupportedEncodingException
* @throws JSONException
*/
public boolean addTask(String projectID, String feature, String startDate) throws IOException, UnsupportedEncodingException, JSONException
{
JSONObject postData = new JSONObject();
JSONObject parms = new JSONObject();
UUID uuid = UUID.randomUUID();
parms.put("Id", uuid.toString());
parms.put("Name", feature);
parms.put("Start", startDate);
postData.put("parameters", parms);
CloseableHttpClient httpclient = buildClient();
String projURL = "/_api/ProjectServer/Projects('" + projectID + "')";
String digest = getFormDigestValue();
String fullurl = baseURL + projURL + "/Draft/Tasks/Add";
HttpPost post = new HttpPost(fullurl);
post.setHeader("Accept", "application/json;odata=verbose");
post.setHeader("Content-Type", "application/json;odata=verbose");
post.setHeader("X-RequestDigest", digest);
post.setEntity(new StringEntity(postData.toString(0)));
CloseableHttpResponse response = httpclient.execute(post);
response.close();
httpclient.close();
if (response.getStatusLine().getStatusCode() == 200)
{
GUID = uuid.toString();
return true;
}
GUID = "";
hasError = true;
lastError = response.getStatusLine().getReasonPhrase();
return false;
}
For more information about the method above, you can refer to this page.