How to run Pymongo script in ADF

Priyanka P 21 Reputation points
2022-02-15T14:01:03.533+00:00

Hi,

We are trying to run pymongo code from ADF which will delete the data of a collection in Azure cosmosDB API for MongoDB.

please help with any documentation.

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
374 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,902 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

Accepted answer
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2022-02-16T13:10:09.787+00:00

    Hello @Priyanka P ,

    Thanks for the ask and using Microsoft Q&A platform .

    PyMongo is a Python distribution containing tools for working with MongoDB, and is the recommended way to work with MongoDB from Python. So basically you are willing to run Python script from Azure data factory.

    You can leverage custom activity in Azure data factory to perform this task. Using Azure batch services customer activity can run your script.

    You can also deploy your python code to Azure functions and run Azure function using Azure Function activity.

    As requirement is to run python from ADF, custom activity running in ADF will be better option.

    Below documentation has detailed steps to Run Python Scripts through Azure data factory using Azure batch. Kindly go through same.
    https://learn.microsoft.com/en-us/azure/batch/tutorial-run-python-batch-azure-data-factory

    Please do let me know how it goes.

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.