Skip to Content
Hands-On Azure for Developers
book

Hands-On Azure for Developers

by Kamil Mrzygłód
November 2018
Intermediate to advanced
606 pages
15h 7m
English
Packt Publishing
Content preview from Hands-On Azure for Developers

Stored procedures

Azure Cosmos DB allows for creating stored procedures that can be executed individually and can hold extra logic, which you do not want to share.

If you go to your collection in Data Explorer, you will see the New Stored Procedure tab and the ability to create one:

Stored procedures are written in JavaScript—this allows you to easily access the document's schema (as they are all JSON). What is more, they are registered per collection. Here you can find an example of the easiest stored procedure:

function sample(prefix) {    var context = getContext();    var response = context.getResponse();    response.setBody("Hello, World");}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Implementing Azure: Putting Modern DevOps to Use

Implementing Azure: Putting Modern DevOps to Use

Florian Klaffenbach, Oliver Michalski, Markus Klein, Mohamed Wali

Publisher Resources

ISBN: 9781789340624Supplemental Content