In today post I would like to present to you the “new” azure functionality which have been made available for us on December 1 this year. It’s about creating notes in the Azure Notebooks in F#. What does it mean and what is it?
Visually, it looks very much like a word/excel online, except that it gives us the opportunity to write/run/show the code, to others by sharing the link. It sounds very intriguing.
Therefore, let’s try this functionality! I decided to use code, which I created before. Thanks to that I will be able to easily compare the results and see if everything works nicely!
So let’s get started!
First, we enter the azure notebook web site and log into our azure account. We create a new library.
We go to the newly created library by clicking on its name.
At this point, we create a new “notebook”. Click “Open In Jupyter.”
In the right corner, select “New” and select F#.
At this point, we have created a blank notebook in F#, where we can enter pieces of code, or text. I think the best thing will be moving step by step after each of the steps that I made to create final script.
We start by adding, a brief description of Markdown.
Well, we have a brief description of what will be in our notebook, let thus loading the nuget packages that will be needed later. We start by adding fields in which we can write in F#. We add cell the same as before, but this time we also set it’s type:
First we want to initialize the packet for our notebook, which shows the following command
Ok, we have added the command. The question is what is it doing? Earlier I mentioned that the code can be executed, so to “perform” that line, press “run” in the menu at the top
Since we’ve added packet at this point, let’s get to downloading and installing the nuget packages we need, which is realized in a particular way:
If everything went okay, you should see an empty field “out”
if you commit a mistake in a field out should be a stacktrace of an error.
Since we download packages we could load them to our script by this command:
At this point, we can go to our script. As I mentioned at the beginning, I assumed that we are using already “ready” code. However, when writing/rewriting we could seen a few cool features, among other things:
- Intellisense, showing return types and accepted by the function.
- Highlighting errors in syntax
- Well, let’s say that our note is ready, we can still do with it?
We can save it and share with someone in the form of a link like this is done with files on onedrive
- Insert/embed our notebook as a widget:
- Download it on the computer in a multitude of different formats:
In conclusion, thanks to the azure notebooks we have the opportunity to create notes, together with fragments of code that can be co-created by people with whom we share links. Most importantly, the code is executed, so we can immediately see what the results generates a block of code, also intellisense and highlighting errors in syntax, are a very big plus. The last advantage is the ability to create presentations. I highly recommend you try this functionality :)
Thank you for reading!
You can check my azure notebook in F# here