Answered by:
Build Tasks via API calls from objects

Question
-
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 | http://jasonstrate.com | http://www.twitter.com/stratesql
Friday, April 17, 2020 11:47 PM
Answers
-
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.
Thanks.
------------------------------------------------------------------------------------------------------------------------
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.
- Proposed as answer by VikasPullagura-MSFTMicrosoft employee Monday, April 20, 2020 2:24 PM
- Edited by VikasPullagura-MSFTMicrosoft employee Monday, April 20, 2020 2:25 PM
- Marked as answer by Jason Strate Monday, April 20, 2020 4:30 PM
Monday, April 20, 2020 2:24 PM
All replies
-
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.
Thanks.
Monday, April 20, 2020 12:35 PM -
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.
Thanks.
------------------------------------------------------------------------------------------------------------------------
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.
- Proposed as answer by VikasPullagura-MSFTMicrosoft employee Monday, April 20, 2020 2:24 PM
- Edited by VikasPullagura-MSFTMicrosoft employee Monday, April 20, 2020 2:25 PM
- Marked as answer by Jason Strate Monday, April 20, 2020 4:30 PM
Monday, April 20, 2020 2:24 PM