How to fix a 502 HTTP error when I'm trying to insert one record in Azure cosmos Mongo DB with Python 3.11 App Service client
Hi guys, I'm getting a http 502 error Code when I try to execute a DB.insert_one command with PyMongo. The connection is between an Azure Cosmos DB instance and a Azure App Service with Python 3.11 and Linux. The conectaron is succefull but when I try to ejecute the insert one method, the appication doesn't work.
An example of funtional Code:
usersDB`` = db_azure_connection()
``user_row = {"_id": user.mail, "name":user.name, "mail":user.mail, "password": cryptocode.encrypt(user.password,"qwsadd")}
return success
An example of failed request
usersDB`` = db_azure_connection()
``user_row = {"_id": user.mail, "name":user.name, "mail":user.mail, "password": cryptocode.encrypt(user.password,"qwsadd")}
responseQuery`` = usersDB.insert_one(user_row).inserted_id
Thnks for the help.