Hi Team / Instructors,
I completed the Azure Event Hub integration task on xfusion-vm, but the automated evaluation failed with the following error message:
"Failed to fetch metrics for the Event Hub after multiple attempts."
Below are all the step-by-step details, commands, and code edits performed during the task for your review.
1. Task Environment Details
-
Resource Group:
kml_rg_main-0138fa1c61a140fe -
Region:
eastus -
Event Hubs Namespace:
xfusion-namespace -
Event Hub:
xfusion-hub -
Virtual Machine:
xfusion-vm(172.191.49.34) -
Script Location:
/home/azureuser/send_logs.py
2. Setup Steps Completed via Azure CLI
Step A: Created Namespace & Event Hub
# 1. Created Event Hubs Namespace (Standard SKU with Auto-inflate enabled)
az eventhubs namespace create \
--name xfusion-namespace \
--resource-group kml_rg_main-0138fa1c61a140fe \
--location eastus \
--sku Standard \
--enable-auto-inflate true \
--maximum-throughput-units 2
# 2. Created Event Hub inside namespace
az eventhubs eventhub create \
--name xfusion-hub \
--namespace-name xfusion-namespace \
--resource-group kml_rg_main-0138fa1c61a140fe
Step B: Extracted Connection String
EH_CONN_STRING=$(az eventhubs namespace authorization-rule keys list \
--resource-group kml_rg_main-0138fa1c61a140fe \
--namespace-name xfusion-namespace \
--name RootManageSharedAccessKey \
--query primaryConnectionString -o tsv)
3. Virtual Machine Configuration & Script Troubleshooting
- SSH into VM:
ssh azureuser@172.191.49.34
-
Initial Execution & Error:
When runningpython3 /home/azureuser/send_logs.py, it threw:
ValueError: Connection string is either blank or malformed.
-
Script Modification via Nano:
Opened the file:
nano /home/azureuser/send_logs.py
Updated variables to:
CONNECTION_STR = "Endpoint=sb://xfusion-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=6W2Qr3zT0ikHQAyoK0GqUwCm+RXgtnqfr+AEhBM0u8w="
EVENTHUB_NAME = "xfusion-hub"
producer = EventHubProducerClient.from_connection_string(
conn_str=CONNECTION_STR,
eventhub_name=EVENTHUB_NAME
)
Saved and exited (Ctrl+O → Enter → Ctrl+X).
4. Successful Log Generation:
Ran the script multiple times without any errors:
python3 /home/azureuser/send_logs.py
python3 /home/azureuser/send_logs.py
python3 /home/azureuser/send_logs.py
4. Reason for Appeal
The script ran cleanly and sent log events directly to xfusion-hub. I believe the automated checker failed because Azure Monitor metrics experienced a standard 5 to 15 minute delay before registering Incoming Messages / Incoming Bytes via the Azure Metrics API.
Could an instructor please review my submission and logs?