Hi !
Last week my friend Sam helped me to understand the basic concepts of Infrastructure as a Code, and of course, we started with Bicep. You can watch the recording here:
After this, I started to play around and try to figure out how to automate the creation of my required resources for most of my IoT demos. And hey, we are in July, so it’s great for JulyOT!
https://julyot.dev/
During my research I found this great article that explains how to use a bicep template to create an Azure IoT Hub and a Storage Account.
Quickstart: Deploy an Azure IoT Hub and a storage account using Bicep
This is almost everything I need, I only need to add an Azure Function. Again, Docs here to save me:
Quickstart: Create and deploy Azure Functions resources using Bicep
And reading for samples, a I did a quick merge and ended with this bicep file:
That’s it ! In order to run it, I 1st create a resource group with the following command.
az group create --name blogBicepAzureIoT --location eastus
And this command to create all the resources
az deployment group create --resource-group blogBicepAzureIoT --template-file AzureIoTDemo.bicep --parameters demoName=JulyOT
And, after a couple of minutes, I got everything that I need in my Resource Group.
This is so cool !
Happy coding!
Greetings
El Bruno
More posts in my blog ElBruno.com.