Build Tasks via API calls from objects

Category: azure batch


Jason Strate on Fri, 17 Apr 2020 23:47:11

Anyone know of any sample Azure Batch code that demonstrates how to pass an instatiated .NET object from the calling application directly to a Task without first storing the state of that object as a file?

We talked with an azure architect that said this was possible and that we could retrieve the results directly from the Azure Batch Task.  But the Azure Batch code samples provided don't seem to support doing this as a direct call to Azure Batch.

From what I can tell, we would need to store the object in the storage container, potentially as JSON, and then have the task retrieve that, do it's processing, and then store those results to be retreived at that point.

If someone can confirm this, it would be greatly appreciated.

Jason Strate | |


VikasPullagura-MSFT on Mon, 20 Apr 2020 12:35:35

Hello Jason Strate,

Apologies for delay in responding on this.

I have reached out to internal team to check on the approach you mentioned in your query.

I will replay back once I hear back on this from the team.


VikasPullagura-MSFT on Mon, 20 Apr 2020 14:24:52

Hello Jason Strate,

Please find below response from the team:

Your standard options would be to:

  • Include the data as part of the task command line
  • Include the data as task environment settings
  • Write data to cloud storage (such as Azure storage)

Which option you use would largely depend on the expected size of the data

For task output retrieval options, you are best to have the task send the output somewhere (Storage, Queue, CosmosDB, Azure Function, EventHub etc). While you can retrieve local files from a node (such as stdout) these are not guaranteed to be persistent. If using storage, then you can use OutputFiles to upload the files for you.



If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.