I am working with Azure Cosmos DB, I am programming the client side in C# (web service) and I'm writing some server side Stored Procedures with java-script.
How can I debug my stored procedure's code?
Thanks,
MAK
I am working with Azure Cosmos DB, I am programming the client side in C# (web service) and I'm writing some server side Stored Procedures with java-script.
How can I debug my stored procedure's code?
Thanks,
MAK
Azure Cosmos DB stored procedure is JS script running on the server, you can not debug it on your side.
However , you can use console.log ()
to log some key steps in your stored procedure as below.
Then use getScriptLog to get the output from stored procedure console.log()
statements.
Please note that EnableScriptLogging = true
is necessary to print console.log:
var response = await client.ExecuteStoredProcedureAsync(
document.SelfLink,
new RequestOptions { EnableScriptLogging = true } );
Console.WriteLine(response.ScriptLog);
You could refer to this official doc.
Hope it helps you.