How to debug Azure Cosmos database stored procedures?

I work with Azure Cosmos DB, I program the client part in C # (web service), and I write some stored procedures on the server side using java-script.

How can I debug my stored procedure code?

Thanks,

MAK

+5
source share
1 answer

Azure Cosmos DB stored procedure is a JS script running on the server, you cannot debug it on your side.

However, you can use console.log () to register some key steps in your stored procedure, as shown below.

enter image description here

Then use getScriptLog to get the output from the console.log() stored procedures.

Note that EnableScriptLogging = true must print console.log:

 var response = await client.ExecuteStoredProcedureAsync( document.SelfLink, new RequestOptions { EnableScriptLogging = true } ); Console.WriteLine(response.ScriptLog); 

You can refer to the official document.

Hope this helps you.

+5
source

Source: https://habr.com/ru/post/1274127/


All Articles