Migrate data from azure mongodb to azure search - mongodb

I'm using Microsodt azure cloud provider in my project,where i have a mongodb installed on a VM on azure and also I have azure cognitive search instance . what I want to do is to migrate the data which i have on mongodb to azure search in order to create indexes and then use the restful apis on the client application.
my question is, is there a way to move data from mongodb to azure search please ?

Unfortunately there is not a built in Mongo DB connector for Azure Search as of now. However you have two options.
Migrate from Mongodb to Azure Cosmos DB (Mongo API) and then create an Azure Search Indexer for the Azure Cosmos DB in question, see https://learn.microsoft.com/en-us/azure/dms/tutorial-mongodb-cosmos-db-online
Write a custom code application that pulls data from Mongo and then send it to Azure Search indexes, you can do this by using the push API, take a look at https://learn.microsoft.com/en-us/azure/search/tutorial-optimize-indexing-push-api

Related

How to async between Mongodb and azure search

I'm using Mongodb on azure (not Mongodb Atlas), I installed manually Mongodb on three VMs on Azure, what I'm looking for is, everytime a new record is inserted or updated or delete on Mongodb I want this change to be refletcted on Azure Search, do you have any idea How van I do that ?
There is no built in Azure Search Indexer for Mongo, one option is to migrate your existing Mongo DBs to Azure Cosmos with the Mongo API. See this doc.
Another option is to use the Azure Search push API, for which you need to watch for changes in the Mongo DB, see this and based on those newly added or deleted docs then use the Push API the make changes to the index, see this tutorial using the .NET Azure search sdk https://learn.microsoft.com/en-us/azure/search/tutorial-optimize-indexing-push-api
If you migrate your current MongoDB to Azure Cosmos DB API for MongoDB as suggested in this thread, Azure Cognitive Search has a Cosmos DB Mongo DB indexer in Public Preview and you can opt to have it enabled according to that documentation and give it a try.

How can I transfer DevOps data to any BI tool?

I have data on Azure DevOps which gets updated every 5 minutes. Using this data I want to create a dashboard in some BI tool which will provide a consolidated view of the data. I am currently using MicroStrategy which does not support DevOps. Using Power Bi is not an option.
I want an indirect way through which I can pull the data in DevOps into MicroStrategy maybe through Azure Cosmos DB. So can I transfer data in devops to cosmos db??
You can create a simple application to get the data from Devops with Azure Devops REST API link and using Azure Cosmos DB API link to store these data in Cosmos DB.
This is sample project provided by Microsoft, introducing how to store and access data from an ASP.NET MVC application hosted on Azure Websites using Azure Cosmos DB service
https://github.com/Azure-Samples/documentdb-dotnet-todo-app
You can check the tutorial provided by Microsoft
https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/cosmos-db?view=azure-devops

How to fetch auzre cosmos db data from azure pipeline task plugin and use it in further pipeline task

Is any plugin available in azure VSTS market place to fetch cosmos db data and use it in further VSTS pipeline task.
Currently, you can use Task for Cosmos DB which can do the features like
Delete/Create/Update collections
Import/Export data to/from Azure Cosmos DB
Some other similar extension can be found here
Azure Cosmos DB Emulator (which is still in public preview) - Docs

Connecting springDataMongo app to Cosmos Db instead of MongoDb

I have an existing java springboot application that uses springDataMongo api to connect to an underlying Mongodb instance.
I need to use the existing springDataMongo api classes but instead of Mongodb, I need to connect Cosmos Db.
I have looked it up on documentation for azure Cosmos db api for Mongodb but didn't get hold of what I am trying to do.
Can someone let me know if what I am doing is possible and if yes, point me to a relevant documentation for the same.
Yes, it is possible to connect to Azure Cosmos DB MongoDB API using springDataMongo.
What you need to do is copy the Cosmos DB connection string from the Azure portal and then put it into spring.data.mongodb.uri in application.properties file of your spring boot project.
application.properties
#mongodb
spring.data.mongodb.uri=mongodb://[username]:[passowrd]#[cosmosdbName].documents.azure.com:10255/?ssl=true
spring.data.mongodb.database=[dababaseName]
After that done, you can check this guide out: Accessing Data with MongoDB.

Delete a row from mongodb database in azure

I am an azure newbie who has a mongodb database on Azure cloud storage. I am trying to delete a row with a specific value from the Query explorer in Azure, but I keep getting this error. Am I missing something?
delete from users where _id='...' doesnt work
neither does delete * from users where _id='' work
this works perfectly even if am doing SQL on a mongodb database while querying
I think you are using Microsoft DocumentDB (not mongoDB). DocumentDB is available on Azure and supports SQL-like queries.
I suggest taking a look at the documentation: https://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/
According to the docs INSERT, UPDATE, and DELETE are only available through the REST API and not in the query language.