Go back

Jupyter Notebooks for Azure Administrators

61m 12s

Jupyter Notebooks for Azure Administrators

Piotr introduces an unconventional application of Jupyter Notebooks: managing Azure environments through PowerShell. He explains that Jupyter, traditionally used for data analysis, can be extended via .NET Interactive to run PowerShell, enabling Azure administrators to create interactive, documented scripts. The core advantage is the notebook format, which combines code cells, outputs, and markdown explanations, allowing users to step through tasks, inspect results, and maintain a clear history of actions. This is particularly useful for repetitive tasks, such as onboarding new team members or generating reports on Azure resources, where a runbook-like approach with embedded descriptions can be reused and shared. Piotr demonstrates setting up Jupyter locally, installing .NET Interactive, and running PowerShell commands to connect to Azure, check modules, and query data. He highlights that notebooks can be developed in Visual Studio Code, published to GitHub, and exported to HTML or PDF for documentation. While the underlying file is JSON, he advises against manual editing. The session concludes with a practical example of using a notebook to report on landing zones from a storage table, showcasing how the tool can streamline Azure administration workflows. Overall, Piotr encourages viewing Jupyter as a versatile tool for interactive, transparent, and reusable scripting in cloud operations.

Transcription

7495 Words, 40739 Characters

English
[MUSIC] >> Welcome to another episode of Azure Talks. Today, we're joined by a fellow colleague and team member of mine, Piotr. Piotr, welcome. >> Yeah, welcome. Nice to be with you. >> Thank you. >> So what do you have for us today? >> Yeah, for today I prepared something, I think it's resting at least for me, because I'm using that on my daily basis. In general, I would like to, I prefer to use some tools in not start-up way. And I think that what I would, I prepared for you today, it's using the, let's say, well, no tune in non-traditional way. So, yeah, I prepared some stuff around Jupyter Notebooks and how we can use them for some Azure stuff. >> Azure stuff, nice. >> Yeah. >> Nice, nice. All right, sweet. So, Rolf, how are you doing? >> Good. Looking forward to some Azure stuff, I guess. And it's interesting because when we talk about Jupyter Notebooks and about the topic that Jupyter has prepared, because I know Jupyter Notebooks, but not in the context of what Jupyter has prepared for today. So I'm very eager to learn more about the stuff that you are going to present today, Jupyter. Very glad to have you here today. >> Thanks for kind words. Yeah, I hope that it will be interesting. And I think it's not really, let's say, very sophisticated solution, but it works and it works. Nice, this one. Yeah, I hope. >> Well. >> Okay. >> You know, when I saw a little bit of this before, because we have something where we every other Friday in the team, we share knowledge and web session and things like that. And I think you kicked it off, you uttered all initiative with this. So managing and doing Azure stuff using Jupyter Notebooks, which originally intended for data analytics, data science related tasks, but you gave it a spin and you use it for something else. And I was like, wow, this is very interesting. So. >> Yeah, that's the non-casual way of using tools, because we used to use something in that, let's say, way, which was, with those things were built. But from time to time, it's nice to take those tools and try to fit them in another shape, another, let's say, way, or things which we would like to do. So yeah, that's what I had in my mind with Jupyter Notebooks at hey. I noticed that maybe we can use them with Azure, where we, this is where we finished already. >> Okay. All right, nice. Okay, shall I pull up your screen and just go rolling? >> Yeah. >> All right, let's get the show on the roll. >> There we go. >> Yeah, so maybe again, hello everybody. I'm Pat Vajolets and I'm working as Cloud Architect. And today, I prepared, as I mentioned, Jupyter Notebooks for Azure Administrator stuff. To be honest, I'm not really, or maybe that not only for Azure Administrator stuff is that, but in general, for everybody who is working with Azure, but not only. But yeah, let's quickly move forward. I have only two slides for today. Just to introduce myself a little bit. So yeah, I'm working with Cloud for a couple of years. I don't know if I've ever bought something like that. Behind that, I'm preparing lots of coffee and I'm dancing Bacchata. So if you would like to connect with me somewhere, yeah, always you can find me on my blog. Here you have QR codes and also link, vaholets.me, you can find more about me there. And also you can find me on some socials and there are two. So yeah, as you mentioned, Jupyter is kind of tool for stuff related to the data, data analysis. So as you can see on that page related to Jupyter, we have some data analysis. We have some graphs, some data transformation with nice descriptions and so on and so forth. So it's really well known tool in that area. I have used that during my studies on the university. I also worked with Jupyter also with other languages, languages than only Python, because often when we are thinking about data, we are thinking about Python, but Jupyter is created for handling free languages by design. Means Julia is the language prepared for performing lots of computations. It's also designed for Python and for our language. But yeah, someday I had kind of idea, maybe we can use that in some other way. And I started to Google that if it's possible, because I knew that we can also in that notebook, we can use, we can run other commands than only from this language. For example, we can run some PowerShell, some Bash scripts, and it also worked. So yeah, I started to Google it up and now we are here. So yeah, maybe before we move forward, I would like to quickly introduce for you who are not familiar with Jupyter notebook. Let's say that told itself, so thanks to using Jupyter notebooks, you can prepare a kind of notebook as the name is. So you can put some descriptions. You can put part of codes, you can run those codes and get the output inside that notebook. Thanks to this, you can really nicely play with the outputs, with the data. For example, when you are doing some data analysis, then you can quickly take the output, transform that and try to put this output to another form or file or whatever, what is preferred. So yeah, I know that that's told from this kind of word. Also, it's nice because you can install Jupyter locally on your local host. You can run that on server, so you can collaborate a bit with your colleagues via the server, via access to the notebooks on the server, or you can collaborate via some online services like, for example, Google Collab, which I would like to show you now. And yeah, Google Collab is kind of a cloud host that Jupyter notebooks. And here you can prepare your own notebooks. You can prepare your own kind of research, which we are doing with data in that first case. Just work like with another documents or ways of working with Google stuff like Google Sheet or Quattere. Thanks to using Google Collaboratory, also you can run your computations on CPU, GPU and TPU. So if you are playing with TensorFlow, then you can use Google's TPUs processors to do the computations, which is also good. But yeah, that's about the Jupyter notebook itself. But if you would like to start with Jupyter notebook, it's super easy to start because you need to install Python and most of our computers, the Python already is, you need to install Node.js and then by a package manager, paper, for example, for Python or Brow on Mac, for example, you can install Jupyter Lab. And yeah, that's all basically for starting working with Jupyter. So if I will jump to my console, I can, I have prepared some empty folder for our purposes. And here we can just run command to be Jupyter Lab. And yeah, some server already opened. Let me copy that link to my browser. It opened. but another one. So basically that's it. We have the Jupyter server running on our computer locally. And now we can start playing with the node. So we can create the first one, the maybe enclosed that the first one, the default one I would say, Python notebook. So if you will jump into the notebook, it looks like here and we can add something called cells. And in each cell we can define code. For example, like here, for example, print hello, yeah, and we've control enter. I'm running the cell, yeah, so this is, let's say the output. But behind that, I can add, I can change the type of of my cell and and add some markdown code. So my first notebook, and based on that, you can see that we can create kind of report, kind of research on the data if we are in the data analysis world. But I think that you can imagine that we are doing some analysis from time to time in our Azure environment. We are digging in some issues or in some resources on Azure, yeah, and we are reading some properties, whatever, with PowerShell. So how we can engage that Jupyter notebook to support us on our daily basis during work with Azure. So of course, you need to have PowerShell call and Azure PowerShell, but I think that in our Azure world, they are kind of basics. But if we will go and we will try to find something called dotnet interactive. Dotnet interactive. So dotnet interactive, it's something more or less new from Microsoft, but it's an engine for running dotnet family languages and engage or connect them with Jupyter notebooks. So thanks to dotnet interactive, we can run C#, we can run F#, not writing the whole application, for example, in C#. That's creating the notebook and in that notebook, just switch the type of language we are using. So you can see that dotnet interactive is supporting plenty of languages like C#, F#, PowerShell, which we are mostly interested in our case, SQL, KQL Python of course, R, yeah, and that's it. So to follow or to continue with our exercise, we need to install Jupyter or dotnet interactive with Jupyter. So if I will go back to my console and I will run, I will run dotnet interactive in install Jupyter. Well, of course, this is something needed to happen, but still I have already installed the interactive on my computer. So it's working. But yeah, by installing dotnet interactive, you can leverage your Jupyter notebooks with dotnet stuff, for example, PowerShell. So if I will create the new notebook, and I will create that dotnet powersher notebook, here I can run PowerShell as usual. So for example, right, output, hello world. And here you can see that now in Jupyter notebook, we can run PowerShell as usual, which is great because for example, we can do some computations, let's say test our test, for example, we can, I don't know, write output, I don't have any more sophisticated examples in my head for now. Yeah, so you can see that we can really nicely play with the notebook, we can add the description between. So if we are checking something, if we are doing some research on our environment, because we are not sure that how something is configured, we can use notebook to have kind of hard history what we really done with all outputs. Yeah, so this is my output. Yeah, and step by step, we can run our scripts, we can run our, we can add descriptions. And after that, we can finish with the whole report of our findings. Yeah, for example, in our case, we did some checks around networking stuff. We needed to check a few places. The best way was to use PowerShell, because we needed to take the data from different data sources. And then we transformed the data to have the entry port and based on that report, we did some actions. And basically, we could finish here our, let's say podcast, because yeah, by connecting to the notebook and Azure PowerShell or into our PowerShell, we can do everything. But of course, I have prepared something more for you. So it's not easy. It was already sweating, I thought, oh man, is he done already? (laughing) A filter, I have a question. So all these cells, it seems that they're all in the same execution environment. So you have cell two, where you basically declare a variable. And in cell three, you can use that variable. So yeah, exactly. It's not that every cell is its own execution environment. So you can pass data and things, stuff between different cells. Yeah, yeah, exactly. You are, let's say in kind of session, and in this session, everything is short. So you can do some stuff in one cell, then print output, for example, to check the data. But based on that output, you can do something next and next, next, next. And this is how it works in that data analysis work, yeah, where you are checking the data. You are doing some transformations. You are checking again the data. It's okay, it's not okay, yeah. So we can do something similar. And you know, we can do something similar in console, yeah, because we have those outputs and so on. Yeah, but it's not such, let's say, from my perspective, it's not such user friendly, like in notebooks, because notebooks are designed to work in that way, that you are doing something, you are checking the data, doing something, commenting, and so on and so on. So yeah, from my perspective, it's, that's the powerful, that's the power of this tool, yeah, and that you can, you can work with the data online, I would say. Yeah, and it's, I can basically prepare a notebook with all the commands, the documentation, and then give you the notebook where you can then run that same notebook, et cetera, all right. So of course, it's more of an interactive, modular way of scripting, if you will. Yes, yes, yes, yes, yes, yes, yes, I tried to find a better, better summer, summery, but I think this is it. (laughs) Yeah, I think that's a good summary. So it's more interactive, like in general, the computer notebooks are, and yeah, what you said, I can, you can prepare a notebook, give me, I can rerun the notebook, yeah, for example, here, I can kill or restart my kernel, yeah. So let's say the whole engine will be restarted behind that and I can run all cells and then all cells were run automatically for me. So all instructions were done one by one. So yeah, I think it's powerful, especially if you have, I think two types of tasks, one preparing kind of report based on findings that we need to do something with XYZ for example, or that kind of repetitive tasks, which we should do each time because of something. Yeah, of course, we can build them in script, run automatically in pipeline at some ones of, and so forth. But for example, we are introducing someone to the team, maybe we can add some, I don't know, add that person to some groups, create something for him or her, and we can prepare that kind of run book with all descriptions and just for each new person run the whole run book. It's just an example, but I can imagine those types of tasks, repetitive tasks, or for example, some data, we are preparing that report, which I mentioned before, and after time, we would like to check if everything is okay based on our actions and improvements in the topic, I would say. So yeah. Of course, yeah, so that's the stuff. We can export our run book, for example, to HTML. So yeah, you can just export everything to HTML file and publish. You can also save as a PDF, but for saving as PDF, you need to have two things installed, something called Latek. I don't know if you are familiar, but Latek is kind of scripting language for document preparation. So if you are preparing kind of scientific documents, mostly it's kind of scripting language, which supports you to prepare book, for example, TESIS or PhD TESIS or for example, or something like that in pretty nice way. So for exporting to PTA notebooks to PDF, you need to have installed Latek and you need to have installed NB Convert. NB Convert is another package for Jupyter ecosystem to convert Jupyter notebooks between types. Between types. So yeah. That's the introduction part for the whole environment. Jupyter notebooks with PowerShell/AsOfPowerShell. And yeah, in general notebooks are really nice tool, well known for a long time. So it works in that classic usage. It works really well. And if you will jump into some blog posts, GitHub is for example fully supporting that. So you can publish your notebook on GitHub and it will be properly rendered. For example, here is some example. So yeah, we have some descriptions, some codes. Yeah, again, reporting, reading the data, writing script, date, some comments, scripts, some charts, whatever we need. This is an example in Python, yeah. But of course, we can prepare something similar in PowerShell. It depends on our needs. Of course, probably we will not analyze the data in PowerShell. But for example, some findings from our environment can be visualized in some tables or something like that. Why not? Why not? Just trying to fit that tool in not unusual way. So yeah. GitHub is supporting also probably part of people who are listening us currently. I will know notebooks from other places because I'm sorry, it's switching to the Polish, let me switch to another to English. But yeah, notebooks are used in another places. Of course, we can develop notebooks in visualized to the code. And I will show you that within a second. Also, code spaces are supporting notebooks, notebooks, Azure machine learning also. We can use notebooks to do stuff. So it's not only that kind of administrative jobs around Azure where we are taking PowerShell and doing some scripting, but you are using notebooks to have that really nice, let's say, describe or showed, but also in other places like Azure Lab Services and GitHub, which I already mentioned. So, no, Jupyter notebooks are engaged in different places in Microsoft. So yeah, I mentioned that, and it's mentioned here that it's, it can be engaged and can be used in visualized to the code. So let me jump into visualized to the code. So I already have opened my folder, which we are previously worked with Jupyter notebooks. With Jupyter notebooks, and here we can open, we can open this notebook and run that here. Yeah, I'm using, for now I will use Jupyter kernel that that one later I will explain what happened there, but yeah, for now I can here again, run that from, and develop the whole notebooks from visualized to the code. One thing you need to have installed Jupyter, Jupyter extension, yeah, that's the first one. And then you have full support for developing Jupyter notebooks in PowerShell, sorry, in visualized to the code, which is really nice because, yeah, that's view, it's, we can say that it's okay, it's kind of traditional, but as on daily basis, we are developing Terraform, PowerShell, whatever in visualized to the code. It's good to have everything in one place without, for example, starting manually that's server behind, yeah. Then visualized to the code is doing that. And doing that for us. So, as I mentioned, here you can do some stuff in visualized to the code. And behind that, I don't know if I will be open that, but if I will, just seconds. Yeah, and if we will try to look, what is behind in that file? So, I will try to do cut on one of those files. So, you can see that everything from Jupyter notebook is written in JSON. So, it's simple behind that, you have simple JSON file, but of course, I don't recommend you to play with that JSON manually because it's similar like, similar like ARM templates, yeah, it's kind of huge JSON, which can be easily destroyed, I would say. So, yeah, but yeah, it's nice to know that behind that, it's just, you know, just JSON file. And in Python, in PowerShell to be honest, I haven't checked that by, I haven't found any information, but in Python Jupyter notebooks, you can just export those cells into Python script. So then you can quickly take the scripts into Python script file and just run if you need, yeah. To be honest, I haven't checked that in PowerShell. I'm assuming that in the future, especially based on the next thing, which I would like to show you, this feature will be added, but for now, for now, I think that it's not available yet to export only scripts from Jupyter notebook. But yeah, here I have one, maybe interesting example. So for example, let's assume that we would like to do some reporting about our landing zones. We have, let's say, subscription, but a landing zone and we have some storage table where we keep the data about created landing zones via our automations. So we can quite easily do that. So maybe I can create new Jupyter notebook. I will choose the dotnet PowerShell kernel. And here, of course, you can use Copilot if you want to do something. But I will just write simple script. So yeah, and I'm running ConnectAZAccount. Of course, I need to put my password. Yeah, so I logged into the Azure via PowerShell. And here in the next, sorry. Sorry. In the next cells, we can try, for example, check if we have installed some module, easy table for managing storage tables. Yeah. I typed it very fast. Suddenly, it just appeared. Yeah. It's appeared. It's appeared. It's appeared. It's appeared. GitHub Copilot. So yeah, this kind of example here, I tried to install the module, easy table. And another, sir, I can try to read the data about, read the data from the storage. I can show you the storage. Yeah, for example, here, I have the storage table. I can do some. Yeah. So here, I have partition key like region, row keys, subscription ID, some landings on owner, some reader group, with their own group ID contributor, or group ID. And when it was created, yeah, some kind of basic data about create landings zones for our customers, for example. I would like to take those data and compare or connect them with the data from Azure. So yeah, in the first step, I just will take the, the script. I will just take the data from the storage table. And in another, sir, I just read the storage table and get this storage account. I get, I got the context. I got the table. And in another cell, I can try to, to take the data from, maybe without, from the variable here, you can see that I read the data from the storage table. Yeah. So, another cell, I will just take the data from the storage table. Take the data about subscriptions, which I already have in my environment. So here, you can see that I have two subscriptions, yeah, with some IDs. Yeah, and this ID, row key from the storage table, it's a subscription ID. And here, I can prepare some short fancisk clip for connecting the data taken from Azure, yeah, we've got easy subscription and taken from storage table into one output. So I have prepared that kind of script. So yeah, I'm just connecting those two arrays into one, taking subscription name from the subscriptions. And then I have the extended data about my lending zones. And I have added that name, each lending zone, each subscription into my output. So that's the power, I think, yeah, we are taking step by step. We can play with some parts of code, not we don't need to rerun whole script. We can just rerun the, you know, that part, which would like to rerun. So, for example, I can, again, click run all, yeah, I need to log in into into power. Yeah, again, and all data were refreshed, refreshed, you can see that those numbers changed. Yeah, so it's so powerful from my perspective here. I don't know if you have any comments or you are amazed already. It seems like a very straightforward process of. I can see why you say that it's, it's especially useful for reporting or for repetitive tasks, because it's the process of coming towards your end goal or your reporting needs seems so very logical building up. And just doing part for part in the sequence based, developing your script towards your output, let's say, I was actually knowledgeable about Jupiter notebooks in the context of. Thread hunting in the combination of security. Part on edges, so with edge of Sentinel, threat hunting, et cetera. But I've never even thought about doing stuff with Jupiter notebooks in the context of reporting or finishing repetitive tasks. It's awesome to see that that's that's it, it holds the capability to do that as well. So, am I am a. Yeah, kind of kind of. It's more you're more more inspired by using tools in general, but Jupiter notebooks specifically for other needs than that you already know them for. Yeah, yeah, I've seen it before, but you know, I've seen it in action in an actual, you know, environment, right? So it's not a hypothetical exercise, but I've seen filter using this together with another colleague of trying to find like some inconsistencies in in in the landscape, right? Pretty usually stayed big enterprise, right? We're dealing with a lot of different moving parts and. You know, the guys need to figure out what was going on. And then you know, seen the report, but also the steps and, and you know, the how you eventually got to the result and you can just re run it and refresh it and. So is there right so no copying pasting no, you know, OK export to to CSV go into Excel, right for data to columns. You know, all this stuff that I've done so many times in my life, but then. You know, everything already laid out so no, I, I am amazed. And, and, and, and, but also the, you know, the thinking outside of the box like, OK, this is very handy and and build for a specific use case, but. That should not limit me to use it for something else, right? And especially in the reporting and. Maybe even troubleshooting is on hey, I tried this was the output. I tried that. This is the output right and it's interchangeable. You can very easily export it to PDF as well or whatever. So it's very, you know, the, the. The application purposes are basically limited limitless and one question. Can I combine different languages into one notebook? So can I basically pull up some data, create a table and then have a go at it with KQL, for example. Yes, yes. For some time we have it's pretty something new, I would say. At least I see I saw number of open issues on GitHub. And as we today's morning, we chatted that hey, I faced during preparing that deba for you, I faced some issues and I found them on GitHub open and I was. It's it's not so nice, but yeah, we can. Yeah, let me let me just open some some kind of documentation here here. I have that. So yeah, basically, it's. Maybe that's that's the better post. So yeah, we have some additional extension to visualized to the code to which allows us to use multiple languages in a single notebook because you know we can use in a single notebook one language, which is quite natural. So for example, okay, I took the data with power shelf from the same source level, yeah. And I later I would prefer to do some manipulations with Python or with that net, for example, because why not. So yeah, in general, we can use. We can use different languages, for example, SQL on the on the level of the same notebook. So, yeah, when we will jump back into our visualized to the code. And we'll try for the clouds. Yeah, that's the extension, which you need to install to have the. And then the political note. books. And then when I will try to create new notebook, here I can choose that.net interactive,.net interactive kernel. And based on that, here I can easily change the the cell, the kernel for the cell, but only for the cell, but not for another one. So yeah, I also prepared some kind of easy demo for you about that. So if we will go to the PowerShell, again, we'll start with Con, Con, connect, easy account. Yeah, let's run that. I already logged. Of course, again, a Swarth. Okay. And then I can, for example, I can get my subscription, subscription, yeah, to check subscriptions. I can get my context, get a-e-c-context. Yeah. And for example, I can, I would like to save that context into the variable in PowerShell, yeah, for example. So yeah, I put that context into the variable and here, in variables, I can look at different types of variables within my session. And here, in actions, I can change or move the variable from type to type. So for example, this cloned variable, I would put into the C#, for example, because I'm writing in.net. So yeah, for clarity, I will change the name of the new variable and I will run that. And here, when I will add another, I will close that. Another cell with C# code this time, and you can see that that chain rig of the types also is in C# code, C# kernel. So when I will put the C# code here, and I will run that. Yeah, you can see that it was treated, that data was treated as.net code. So, you know, we can push the data from PowerShell, put that to the Python, to the C# and play with those languages rather than everything in PowerShell. So yeah, we can, of course, as I mentioned, I faced some issues with connecting to, for example, SQL and SQL databases and also with installing Python kernel. But yeah, maybe it's something related to my configuration, to be honest, I don't know, but I have prepared another team was for you. So yeah, we are not finishing here. Because yeah, you can see that we can nicely play with PowerShell and notebooks here, in Visual Studio Code. We can use that polyglot notebooks to prepare notebooks in different languages. But as I mentioned, as I showed you before, also we have notebooks in different places. And if I will go into the, into the Azure Data Studio, I hope you know that too. So in Azure Data Studio, also you can write Jupyter notebooks. Yeah, so for example, here I have, I have some database prepared for you. So yeah, I can create for that database. I can create a new notebook. And I can add the new cell and just let's try to, no, no, just try to run the query. I hope that database will be available. As you know, it's closing after some time. Okay. Let's connect. Live demo, right? Yeah, of course, of course, it should happen. So anyway, so one thing is maybe that the database, yeah, we have already. So here we have notebooks in SQL. I can add another cell. For example, let's add some, let's add some close that, another record. Oh, not copy. Let's hear play. Yeah, with that key, six. Yeah, one or effect that if I will copy that code. Not copy that again. Here, yeah, you can see that we have, we have added 10, 10 euro. Yeah. And for example, this is the table view, but when I will add another code, and I will run that. So here I can automatically create some graph. And yeah, I can use the, you know, maybe let me just take name and age, age. Yeah. And now I can prepare chart, yeah, of ages. We find that to be the notebooks, which is pretty also nice when we are touching some database stuff. Yeah. And I can I can imagine that part of, let's say, people working with cloud architects also can dig from time to time, some SQL stuff on something like that. So you can also use the, they Azure data studio with Jupyter notebooks to play with data with SQL. Yeah, you can just try to change the connection and play with SQL. And also, what is more, I prepared some kind of resource group with different resources. Just database, which we already connected test that with log analytics workspace, which is important. Storage account where I had that table with info about our lending zones, some virtual machine. That's all. And here we can, let's create, yeah, we have another connection with log analytics workspace. And for that connection also, we can, we can make some, some query, for example, here. Let's, for example, Azure metrics project. I'm not, let's say, so familiar with that KQL stuff. So I prepared something for you for the email to show that that we can play with that. So metric name and sort by time generation by metric name. Yeah. And here again, we have Jupyter notebooks with a KQL, with an Azure data studio. So, yeah, we can also connect by adding KQL extension. You can also connect to Azure data, Azure data explorer clusters, which we can deploy on Azure, then to that clusters, we can connect different data sources and we can play with KQL from data studio. Yeah, so it's also kind of powerful. So, yeah. And also I gathered all of that demos, which I prepared for you on my GitHub. Here, Jupyter demo. So we can see how it looks, how our outputs looks on GitHub. So we can commit the notebooks and we can share that with an hour team. Someone can pull to look on the data, can run on its own. So, yeah. Let me check if I already prepared something for you more. I think, yeah, mostly that's all. So, my usage, my usage is mostly Jupyter notebooks with PowerSharp. Maybe when that polyglot notebooks will be more stable, I will switch to PowerSharp Plus C#/Python because why not. But yeah, as you were all mentioned, we can meet Jupyter notebooks in many places in Azure in general. So that security, I think in Sentinel, they are used, yeah, some data stuff, so spark and so on. Also, loop their notebooks. Here we can use a Jupyter Notebook roof power share. So plenty, plenty of usages. And I see that Microsoft is also investing kind of more time and money to really encourage people to use that until to allow people to use Jupyter Notebooks in that non-conventional way, let's say. So yeah, that's it pretty much, which I prepared for you today. - Awesome, I'm very inspired almost about how this actually in the world of troubleshooting, I can imagine that you really build up your case and you don't have to, because most of the time, it's becoming a problem when you want to, you want to actually want to be repetitive about calling up your issue. And now you can just write it out and don't have to look back within the script that you've already made. So I see a very big use case for administrators or engineers there as well, that you can really build up your case from A to C. - Yeah, you have outputs, you have all steps, one by one, not need to scroll through the history, not finding comments, not copying or something, get parts of comments. - Absolutely, and easy to share as well. So yeah, I didn't figure that we would use Jupyter Notebooks for these kind of use cases. So once again, I'm amazed about this, because it seems so simple, right? When you are demoing this, it seems so simple and you have the result is right in your face as soon as you put on a new cell. So it's very powerful, yeah, I like it. - Yeah, it's similar like you are working with some front-end technologists like writing HTML and JavaScript, yeah, you are getting the results immediately, by just refreshing browser or something. So it's kind of similar, yeah? You are just refreshing or re-running commands, you are getting the output almost immediately, because I prepared Runbook, which Robin mentioned before, and that Runbook runs about 40 minutes due to that complications and transformations behind, yeah? But yeah, it's almost online tool for doing some stuff. - You just said something about seeing what you get. It's like what you see is what you get editor, basically. It takes me back to Dreamweaver, where you were writing HTML and you could already see what was happening, right? Or the other way around, and usually I just switched to the full-blown view because I didn't want to write HTML when I was 12 years old, but it was, - No, it's like, but just to check, right? If you run a cell, the output is part of the Jupyter Notebook. So if you commit and push it to a repo, then the script and the output is basically there for someone to analyze. So it would, okay, so what Rob just mentioned about. Yeah, so then if you, of course, pull it, rerun it, push it, commit and push, then you can always update it. You can even automate it, but also in the world of troubleshooting, where you can say, hey, this is the problem statement. These are the steps that I did. This is the output, this led me to this conclusion. And eventually I got stock Microsoft support, please help me. Here you got like the, what I did, right? Or maybe a more senior colleague, like, hey, this is what I did. And you help me out. Or maybe it's already ingrained in the service desk, right? And it's part of the escalation process to another line, right? They're like, hey, this is the requirement. Where are all the steps and the things that you did already? Right? So this whole process can basically be optimized by using Jupyter notebooks, because I know what Rolf does. And I was so ready so I'm writing things. I was like, oh, he's on to something here. Yeah, I need to call my architects and my product managers right now. So I'll be right back. No, jokes aside, I'm really inspired about, I see a lot of use cases to use these notebooks. And I'm already thinking about when will be the next of your time that NTP servers will stop working. And so these are these repetitive tasks that you will have to execute manually all the time, right? So you have some things that you want to monitor. You want to do some automated instant response. But there are always things where you can or won't do that. But you still know that there will be some point in the future. I am going to resolve this issue now. And I know that in the future it will happen again. And I will not be automating it, or I don't want to automate it. But then a Jupyter notebook can be of help as well, right? So if you know that it will happen again in the future, you can just make it a repetitive task. And documentation and execution code is just in one notebook. Yeah, exactly. That's the power that you have everything in one place. Not, you don't need to jump out. This is a documentation on the Chromeflow and this colleague knows something here. I need to log in or whatever. Yeah, that's opening the notebook. Oh, I need to do that, that, that, that, rerun everything. That's all pretty much. Just another use case came up. Rolef and I worked together at one of my previous employers as well. So this is like old colleagues getting together. But, or not old, by the way, colleagues and old colleagues, like, together. Now, what, you know, we had basically this service where once a month or one every two months, we came in at the customer following a certain schedule and then we checked their environment, right? And then we gave recommendations. So for a long time, I checked to main controllers and exchange servers and made a report about, okay, these are the databases. Maybe we need to create a new database. Or, yeah, you can optimize these things or whatever. And I always went into, okay, copy paste. But it was before I started using version control, right? So I had these like these version control, kind of version control folders in my one drive, copy paste, make sure that I had the last version from SharePoint or whatever, you know, difficult things we did from an infra perspective before we all embrace DevOps and started working in a certain way. But could be very interesting. You're just coming, hello customer. You don't tell them of course, right? Because then the whole service is, you know, going to, (laughing) - It's not about that. - It's not about that. But then you just run that notebook, you grab the charts and the things that you wanted, you put it in word or not even, you ask for it to PDF and you just give it to them. I mean, we ran all your checks again. Everything's fine, look at this. Or maybe this needs some attention or whatever. Anyway, I'm stretching it. I think we can go on and on about the use cases and everything and what I really love about what you said a couple of times, we all there is, why? Why not? Because we can basically. So, you know, I really like that attitude. - Yeah, you know, if something is not forbidden, then let's do that. (laughing) (laughing) - Yeah, I'm so straightforward. By the way, I also gathered all of that information and some blog posts, short blog posts, kind of summary with links, yeah, some nice places to check. Also, those links which are already showed. So, yeah, we can link that somewhere near, if you want, I think it will be useful for people who will listen us or watch later. - Yeah, we'll make that happen. We will edit to the video, that's no problem. And just one more thing that I would like to add for our listeners is because Robin, you mentioned shift left. And I know how of a hassle it was in our days where you had to do this report and doing it over and over again. And now you don't have to do it anymore. Not even if you put it in a Jupyter notebook, you can just put it, like you said, to the service desk and they will just run the notebook. Because you can really leverage that shift left movement with using Jupyter notebook. So, thank you for inspiring me as well today, Robin, because obviously you know what job I have. I will definitely use this to empower my employer. Absolutely. Yeah, I like this. - Great, great to hear. It's also a pleasure for me to share something inspiring for another people. So, yeah, I'm also really glad that you enjoyed the time and that stuff. - Awesome. So, with that, shall we wrap it up? If we don't have any questions, right? Because we're recording. I'm still going to use it. So, I'm still using the live streaming. So, I don't know. Let's take that into consideration. But, awesome session. Like we mentioned, inspiring. Yeah. - Piotr Mr. Jupyter notebook. - Thank you, Robin, I won. From now on. - Now on, Mr. Notebook. - No, please don't. Mom, I was using it to the team tomorrow and you will suddenly go through life as Mr. Notebook, yeah. - Oh no. - Stay again. Whatever, thanks guys for the invitation. It was a pleasure for me to share that inspiration with you. So yeah, I'm always open for any kind of discussions and if anybody will have any questions, just try to find me on LinkedIn or whatever, I will be happy to answer and to help if needed. So. - Awesome, great. Want to wrap it up, Robin? - Yeah, let's do it. So thanks for watching. Thanks for listening. Piotr, thanks again, Ralph, always a pleasure. See you guys next time. Later. - Right, bye bye. - Bye. (upbeat music)

Podcast Summary

Key Points:

  1. Piotr, a Cloud Architect, demonstrates using Jupyter Notebooks for Azure administration tasks, a non-traditional use beyond data science.
  2. Jupyter Notebooks allow combining code, outputs, and markdown descriptions, creating interactive, modular scripts that can be shared and rerun.
  3. The .NET Interactive extension enables running PowerShell within Jupyter, integrating with Azure PowerShell for tasks like reporting and environment checks.
  4. Notebooks support multiple languages (e.g., C#, F#, PowerShell, Python) and can be used locally, on servers, or via services like Google Colab.
  5. Integration with Visual Studio Code and GitHub enhances usability, with options to export notebooks to HTML or PDF.
  6. Use cases include preparing reports on Azure findings, onboarding runbooks for repetitive tasks, and documenting troubleshooting steps.

Summary:

Piotr introduces an unconventional application of Jupyter Notebooks: managing Azure environments through PowerShell. NET Interactive to run PowerShell, enabling Azure administrators to create interactive, documented scripts. The core advantage is the notebook format, which combines code cells, outputs, and markdown explanations, allowing users to step through tasks, inspect results, and maintain a clear history of actions.

This is particularly useful for repetitive tasks, such as onboarding new team members or generating reports on Azure resources, where a runbook-like approach with embedded descriptions can be reused and shared. NET Interactive, and running PowerShell commands to connect to Azure, check modules, and query data. He highlights that notebooks can be developed in Visual Studio Code, published to GitHub, and exported to HTML or PDF for documentation.

While the underlying file is JSON, he advises against manual editing. The session concludes with a practical example of using a notebook to report on landing zones from a storage table, showcasing how the tool can streamline Azure administration workflows. Overall, Piotr encourages viewing Jupyter as a versatile tool for interactive, transparent, and reusable scripting in cloud operations.

FAQs

The episode discusses using Jupyter Notebooks for Azure administration tasks, such as running PowerShell scripts and managing Azure resources.

Dotnet interactive is a Microsoft engine that allows Jupyter Notebooks to run .NET family languages, including PowerShell, C#, F#, SQL, and Python.

You need to install Python and Node.js, then use a package manager like pip or brew to install Jupyter Lab.

Yes, they are useful for repetitive tasks like onboarding new team members, where you can create a runbook with descriptions and run it each time.

All cells share the same execution environment, so variables defined in one cell can be used in subsequent cells, allowing for interactive and modular scripting.

Yes, they can be exported to HTML or PDF. For PDF, you need to install LaTeX and NB Convert.

Chat with AI

Loading...

Pro features

Go deeper with this episode

Unlock creator-grade tools that turn any transcript into show notes and subtitle files.