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

Jorge Dominguez Herrera 0 Puntos de reputación
2024-04-08T22:13:17.7033333+00:00

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.

Azure
Azure
Plataforma e infraestructura de informática en la nube para crear, implementar y administrar aplicaciones y servicios a través de una red mundial de centros de datos administrados por Microsoft.
155 preguntas
0 comentarios No hay comentarios
{count} votos