Found the issue, the code wasnt able to correctly create the pool/job/task due the batch account subscription restrictions. I asked to increase the quota, then I created manually the pool and the job, then I created the task programmatically, it worked fine!