az version13 Week 12 (18-Dec-2025)
13.1 Use Azure Cli to manage Azure Resources
13.1.1 Download Azure Cli
- Access the following site to download the tool for your operating system and install it.
13.1.2 Run the Azure client
- Check the client version
- If you have already, just upgrade to the latest version.
az upgrade13.1.3 Download this exercise files
- Download the files needed to run this exercise from here.
- Expand the zip file.
- Move into the directory created by expanding the zip file.
13.1.4 Login to Azure
- Make sure you are able to login to Azure.
- Enter your username and password in the browser and return to the command line.
az login13.1.5 Create a Resource Group
- You need to create a resource group (in this example named
ul-eventhubs-rg) in a specificlocationto contain your hardware/software resources. - If you don’t know the possible locations execute:
az account list-locations -o tableand then pick the name you want.
az group create --name ul-eventhubs-rg --location westeurope # In this example we are using westeurope
13.1.6 Deploy and instantiate an Event Hub
- Define the name of your template (downloaded file
event-hub-template.json) file in a variable. In this case,templateFile. - In the same directory, run the following command, taking into account that the resource group name must be the one (
ul-eventhubs-rg) that you created in the previous step. - Answer the question for the project name (ex:
arit-eventhub1), and check in the Azure Portal within the resource groups the result of this command. - The execution of the command may take some minutes.
templateFile="event-hub-template.json"
az deployment group create --name ul-eventhub-template --resource-group ul-eventhubs-rg --template-file $templateFile
# As an alternative, you can also run the above command without defining a variable like this:
az deployment group create --name ul-eventhub-template --resource-group ul-eventhubs-rg --template-file event-hub-template.json

13.2 Generating Data for the Azure Event Hub
13.2.1 Download and Install NodeJS
- Download NodeJS for your OS here.
- Install NodeJS.
- After installation, test it with this command.
node -v- Positioned in the directory containing the files for this exercise, run the following command.
# On Windows
npm install
# If your are on Linux run
sudo npm install13.2.2 Configure a connection string
- To send/receive events to/from the Azure Event Hub you need to get a connection string from the Azure Portal.
- In the Azure Portal, within the resource group and event hub namespace section, expand
Settingsand thenShared access policies. - Drill down in
RootManagedSharedAccessKeyand copy the value ofConnection string-primary keyvariable.
- Replace the connection string in the files
send-azure.jsandreceive-azure.js. In variableconnectionStringput the value copied from the Portal inConnection string-primary key. VariableeventHubNameshould have the value you enter when running the template, which is the name of your Event hub.
13.2.3 Send Events to Azure
- To send events (random data and random intervals) to Azure event Hub run the following.
node send-azure.js- Check the results in the Azure Portal.
13.2.4 Receive Events from Azure
- To receive the same events from the Azure Event Hub run the following.
node receive-azure.js13.3 Removing Resources
- If you want to delete everything, delete your resource group. Everything within will be removed. Use the following command.
az group delete --name ul-eventhubs-rg --yes