Installing Azure IoT Operations with GitHub CodeSpaces (Part 1)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey folks uh so today I'm going to try running through uh the guide um on the Microsoft docs and learn site to install Azure iot operations so before I get going a little about what Azure iot operations actually is so this is a preview service for a data plane at the edge essentially so whereas in the past we we were using things like iot Hub and Azure iot Edge uh iot operations is based on a kubernetes design uh so we are leveraging more powerful Hardware here we can see in this diagram here that um we've got uh a few different sections right in the middle we have our Azure iot operations section so this section just here relates to uh the device side so the edge side of azot operations and within that we have several Services if you will that um form part of azure iot operations so we've got an acre agent as it's called now acre is a way for Azure iot operations to go out and discover the assets that are connected to our Edge device and we'll talk about assets shortly uh We've also got the Azure iot data processor section here uh and that allows us to be able to create data pipelines to be able to process data in near real time uh out to various different Northbound connections like uh Fabric or Azure data Explorer onwards from that we've got an industry standard mqtt broker at the edge here the Azure iot mq that allows us to be able to use uh the very latest mqtt V5 spec mqtt Communications so uh this is a message queuing Telemetry transport uh defined for um iot based communication scenarios where we we've got uh low latency and small packet information that we can send through um communicating between the assets and the edge and then further on to the cloud if needs be on from that um we've got some layered Network management so layered Network management is about how we can deploy um more than one of these devices where one of them is behind a firewall say where it's not a internet facing service and then we can actually use a pipe to communicate between these two Services uh allowing us to be able to to to layer if you will our Network so that we can work within the constraints of whatever networking infrastructure in place uh and then we've also got the Azure iot orchestrator uh and this is controlling all of the deployment and configuration and setup of the various containers that get deployed down to our kubernetes cluster uh and then finally we've got the Azure iot opcua broker uh which is controlled p in the communications forwards and backwards to and from the uh opcua assets that we've got connected to our Edge cluster here over here on the left hand side we have a bunch of assets so we can see here that we've got a couple of opcua servers and connected to those we have some opcua Assets Now opcua is uh an open standard for uh the definition of the protocol of communication between uh devices assets and an iot server of some sort um this isn't a protocol but it's merely the definition for how the protocol works so it's quite important to understand that but we can use the opcua definition to be able to communicate between our assets and the edge devices each of our uh assets here they connect to a server this one here for instance and that server uh then connects out to the Azure iot opcua broker um so that we can then communicate down to these uh lower level assets through that uh iot acre agent um we can go about discovering those devices when they're connected or provisioned so um we've got some some access to those opcua standard devices on with from that we can actually use our own connector here to be able to Define our own standards but we've also got access to things like onvif for perhaps CCTV cameras so we're using kubernetes here so we can deploy our own kubernetes workloads be some form of data processing or also things like Ai and of course we're using more powerful Edge Hardware here where with iot Edge for instance we could have got away with something like 8 gig and four cores where now we probably need something like eight cores and 16 gig so this isn't going to run on a Raspberry Pi like device uh this is far more likely to run on um something like a an Intel or an AMD type um device that's a class above that so what we're talking about the difference here is that uh iot Edge Azure iot Edge is something like light edge perhaps and we're moving towards medium and heavy edge here so there's going to be a difference in performance and with that a difference in price so uh moving on to the bottom part of this um diagram down here we've got a section labeled Azure Arc now what this is is that we can project our kubernetes cluster and our assets into the uh Azure portal and manage them directly from there so this allows us to be able to move that edge management story directly into the cloud for us to be able to manage those devices in the portal uh um and uh perform all of the same sort of functionality that we would in the portal for cloud-based devices so super powerful and then on the right hand side over here um where we have the operation iot operations experience portal we've actually got uh two sections to iot operations where on the left we've got the edge section and then on the right hand side we've got the portal section where we can actually manage our kubernetes cluster and the assets that are connected to it hopefully will see all of that when we get this installed uh and then finally at the bottom we've got the powerbi um Microsoft fabric Azure event grid and all of these are the the Northbound services that um we're able to then start visualizing and processing the data that our Edge and then uh the assets connected to it are producing so good um if you want to find out a little bit more about what uh Azure iot operations is actually doing then uh you can come along to uh the uh the docs in the docs learn site uh there'll be a bitly on the screen just down here uh you can go ahead and read a bit more about that here where uh it's talking about exactly what uh I just mentioned there about all of these different uh services and how we go about deploying them but we're going to start here in this quick start where we can deploy our Azure iot operations preview to an arc enabled cluster uh and all of this process will actually take us through uh installing AKs Edge Essentials the the kubernetes uh cluster from Microsoft locally and then AR enabling that and then deploying Azure iot operations to it uh there's a section here on what we need to do before we begin and of course you'll need an Azure subscription you can go ahead and create a free Azure subscription which should give you everything you need to get going with this uh and then prerequisite section here we need to create a kubernetes cluster to receed the Azure iot operations deployment of course um and then we'll need a GitHub account and visual studio code installed on our machine as well so um I've got all of that lot installed but you can come along to this page and again the bit lead will be at the bottom of the screen you can come along and um get the links to install all of those bits here so they're talking about what problem are we going to solve here which is nice of them so outlining the problem space we're going to create a kubernetes cluster and connect that to Azure AR and then we're going to create an Azure key bolt to manage the secrets and then we're going to configure the Clusters with a Secret store and a service principle to communicate with the ploud cloud resources and then deploy Azure iot operations so a fair few things to get through uh but hopefully it'll go relatively smoothly so uh we need to connect a kubernetes cluster to Azure Ark but before we can do that we'll need a kubernetes cluster so um we'll be running k3s as it says here um so uh that is a cut down lightweight version of a kubernetes cluster that's not going to take up all the resources on my machine uh we use the Azure CLI and Cube cutle which is the command line interface to be able to uh interact with the kubernetes cluster and then other useful tools like Helm and K9s as well so uh it says here that we can use code spaces to easily set up and tear down but they're not suitable performance evaluation or scale testing so uh which can create our code space and our cluster using the following steps um we can go ahead and create a uh codes space in GitHub codes spaces so let's click into that create a code space so we can get started with Azure uh samples and the explore iot operations no code space resume and then we get some Secrets here the repositor may require these secrets to function and so we'll need a subscription ID a resource Group and a location so uh the region to use must be one of any of those locations so I'm in well closest to North Europe so I'll likely be using that one but subscription ID if I flick across to another desktop here then um here in my uh Azure iot uh Ops Resource Group I should be able to then open up the essentials and I'll be able to get my my subscription ID I'll be blowing this out shortly I can copy that and then I can paste that into my code space there we go and then my Resource Group which is iot Ops so and copy that and then my location I'll choose as North Europe works for me and then we can create a new code space okay this looks like it worked this time which is good close out of this and we've got a read me here and some instructions in the terminal as well so that's good so if we flick back to our previous tab so we had to provide the uh the subscription the resource Group and the location which we did and we created a new codes space and with the codes space ready we can select the menu button at the top left and then select open in vs code desktop so let's do that here and then opening vs code desktop change may not have been saved that's all right click leave the site is trying to open vs code desktop we can press okay so that's installing the GitHub code spaces extension which I didn't have before so while that's doing that let's switch back to our instructions and find out what to do next close that tab now so we'll do that leave I saw an unexpected error there I'm not quite sure what that was but we'll see in a minute so um we've done that so inv visual studio click select View and terminal and use this terminal to run all of the following commands Okay so let's uh it should be Asad login first so we'll copy that Al complaining about my GitHub co-pilot but that could just be because I'm running in a code space so I'm not worried too much about that so Asad login this will likely pop up a window for me to log in with there we go and then I can log in now let's just make sure because um it's possible I need to log in with a work and school account so let's just see what it says first uh okay doesn't mention it so I think we're okay just logging into my regular um account so we'll go ahead and log in with this one and we've logged into Azure so I can close that window now and the extension wants to sign into GitHub so we'll allow that to and we'll give it access to all of this so with authorize Visual Studio code and I need to authorize this too so I can use GitHub mobile and then that should pop up on my phone it does indeed so now I need to give it the digits and approve that and it was approved so I can go back to visual studio code now there we go ah okay and this looks more like our uh iot operations code space so perhaps I was a little bit eager before and didn't give it time okay so looks like that's loaded up nicely which is good uh and we can actually see in the bottom left hand corner now that we've got Cod space is cautious space yodel that's the uh unique name it's given to our code space which is cool uh so while that's busy finishing itself off we'll flick back to the uh instructions there we go so uh we need to make sure we log in I'll do this again although there's a good chance that it is actually already logged in so View and terminal again and we'll log in and there we are so that looks like with logged in and we've got some information about our subscriptions there which is good what the next thing so now we need to set the subscription for all our commands so uh the language server couldn't create connection to the server okay well I'm not too worried about some of this stuff we are running in a code space after all so let's go back to our terminal and then we can set the correct account so that's finished uh and now this step only needs to be run once per subscription so we need to to register some providers now this is just making sure that uh I guess we've got access to some resource providers so let's go back will it let me run all of these commands in one go paste okay so that finished uh and then next we need to uh create a resource Group now I've already done that to store all my resources but I'm pretty sure we had to tell it what the resource Group was when we started this so I shouldn't really need to create another Resource Group but maybe it was the I just wanted to give it the name of what I was going to go ahead and create so that it had that as a as a parameter so I don't need to create that that's already created um and then we can use the azed connected K8 connect command to AR enable your kubernetes cluster and manage it it's part of the azra resource Group so let's do that so we can run this particular command let's copy that and see what it does so it looks like we've downloaded Cube cutle which is the command line uh interface for us to be able to uh interact with the kubernetes cluster as well as a home client to be able to then provision um uh nodes and pods and then uh resource provisioning is begun and finished and then it's installing the Azure Arc agents to help us project our cluster into the portal and that looks like that finished so let's go back to the instructions and see where we're at so cluster name is set to the name of your code space so that's okay replace the environment variable if we want to use different name that's okay uh get the object ID of the Microsoft entra ID application from the azzar service and save it as an environment variable okay again we'll trust the uh the documentation and run that so next use the uh Asad connected K enable features command to enable custom location to support on your cluster this command uses the object ID with again it uses that same thing so let's copy that and run that this command might take a while okay oh it didn't take that long so successfully enabled features custom locations so that's done now we can um use the Azure iot operations extension for Azure CLI to verify that your cluster and host is configured correctly so we can verify that our kubernetes cluster is correctly configured to accept Azure iot operations let's see what it says we're crossing our fingers now connectivity true uh to the management and MCR so iot Ops is in preview so that looks like it's happy I don't see a failure so must be okay so uh this home command checks connectivity so that makes sense and now we can go ahead and deploy Loy Azure iot operations preview to our uh cluster so we need to create a key Vault so we can go ahead and copy that so no doubt this is going to create it in the portal to our Resource Group that we've got in place we'll enable our back authorization by default in the near future okay interesting so while it's running it' be interesting to switch over to the portal and actually have a look see if it's creating anything in our Resource Group so if we refresh this then yes we've got a kubernetes uh Azure art cluster here already so that's good that matches that cautious space yodel that we saw uh in the bottom left hand corner for our code space so that's good oh and now we have a key volt as well so this is provisioning the services directly to our Azure subscription enter our iot Ops Resource Group and that looks like that's finished so let's switch over to the instructions again and carry on so we can use an existing key Vault but we've created a new one and now we can deploy Azure iot operations wooo so this is kind of the meat of what we want to do here so let's copy that it's warning us about needed to log in again potentially but I think it'll be okay so let's run this command I'm got a workflow and some pre-flight stuff ensure registered iot Ops resource providers so we have the resource providers the pre-flight checks are passed and now it's going to do a simulation of the deployment and see what the results would be rather than actually deploying and failing so that um it can make sure that it's going to accept everything before it does it which is quite cool uh with a what if deployment and that's passed now the key Vault CSI driver so verify that the permission model is correct for the key Vault and then create the app okay so we can view the resources in our cluster now with the cube cuttle get pods command oh no we do we have some pods now so it is actually doing something so has anything changed here nothing any different here interestingly see if anything's changed with our whoa now we got a lot more pods so this is definitely definitely doing something so we won't um won't touch this we'll just leave it with it um not sure why it's not updating on the in the terminal there but it is absolutely doing something oh loads ofu running now so um we can zoom in and have a better look so we've got SE managers and then we've got an aiio ref data and a runner and an operator and a reader and a message store so we've certainly got a bunch of stuff running one more have a look at that yeah and even more so while that's doing that let's switch over to the portal and then we can click on our cluster here and we get some information about our cluster which version of kubernetes it's running and some properties the agent version and this is all through Arc enablement it's projected the information about our cluster and the ability to manage it directly into the portal which is pretty powerful uh from the settings menu we need to click the extensions blade and then we can see that we've got um some extensions here installed for Microsoft iot operations so we got the data processor element the mq assets acre layered network uh management iot operations itself itself extensions usage and the key volts provider so that looks like that's that's trundling away nicely in the background let's have a look what we've got um for our pods now so we've got a bunch of running pods here which is good a lot of that's been running for a few minutes and then stuff here uh operators only been running for a few seconds some more containers so the discovery asset Discovery pod and The oel Collector so that's open Telemetry they're running now what have we got in our first bash here looks exactly the same not sure why nothing updates here but it looks like it is actually doing something in the background so Hotel collector running so this is looking good anything new in here yep uh not sure what appeared I think it was maybe I'm not sure maybe it was that extensions usage not quite sure um Creator it probably isn't it's be this opcua broker that's in that creating state so this should be showing us actually the um the Live status essentially of what's happening in that cluster so go down here let's have a look what's creating down here oh an error the OPC supervisor has given us an error um that doesn't sound good I wonder what that's all about a bunch of new stuff running down there as well with the D mqtt authentication from T and things like that have a supervisor oh okay don't have any errors anymore everything is running anything new in here no this is all as it was oh and that looks like that's finished interesting so let's have another look at our pods everything appears to be running which is good uh what about in the portal got anything new no that all looks like that's running as well so let's go back to the instructions on your cluster select so we did that and you can see that the cluster is running extensions of the type Microsoft iot operations. X which is a group name for all of the iot operations components and orchestration uh there's also an extension for the AKs Secrets provider um which is fine we can make a note of the full name of the extension called mq- we use this name in The Following quick starts interesting so let's go over and do that so the full name so we'll need to expand this across here mq- bu there we are so it must be a unique identifier mq bu so we go back and see what we need to do next okay so in this quick start you configured your Arc enabled kubernetes cluster so that you can communicate securely with the Azure iot operations component so it looks like we're finished for this particular tutorial which is good uh so I'll come back in a second video and we'll run through the next tutorial where we can add an OPC UA asset and simulator and see what iot operations actually looks like so thanks for following along folks see you
Info
Channel: Peter Gallagher
Views: 409
Rating: undefined out of 5
Keywords:
Id: gt4xRcuTrqU
Channel Id: undefined
Length: 27min 50sec (1670 seconds)
Published: Fri May 17 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.