MicrosoftLearning / DP-900T00A-Azure-Data-Fundamentals

DP-900 ILT lab instructions
https://microsoftlearning.github.io/DP-900T00A-Azure-Data-Fundamentals/
MIT License
282 stars 275 forks source link

streaming/setup.sh fails to recognize iot hub in subscription despite azure portal showing it has been created #34

Closed mleprince018 closed 1 year ago

mleprince018 commented 1 year ago

Module: DP-900

Lab/Demo: 05 - Streaming Analytics

Task: 00

Step: 00

Description of issue: streaming/setup.sh fails to recognize iot hub in subscription despite azure portal showing it has been created.

Steps to issue:

  1. I am using the Azure Free Subscription - and am following the steps in this streaming analytics exercise
  2. I ran bash setup.sh and ran into the below error
    Creating IoT hub...
    ERROR: Unable to find IoT Hub: iothubb7fd109c1c2b488b88 in current subscription 30bxxxxxxxxxxxxxx.
    Unable to find IoT Hub: iothubb7fd109c1c2b488b88 in current subscription 30bxxxxxxxxxxxxx.
    ERROR: Unable to find IoT Hub: iothubb7fd109c1c2b488b88 in current subscription 30bxxxxxxxxxxxx.
  3. Appears to be due to line 25 in the setup.sh
    marc [ ~/dp-900/streaming ]$ az iot hub connection-string show --hub-name iothubb7fd109c1c2b488b88 --output tsv
    Unable to find IoT Hub: iothubb7fd109c1c2b488b88 in current subscription 30bxxxxxxxxxxxxxx. 
  4. What's more confusing is when I click on the iothub7fd... it says it is part of the azure subscription: image
    • I thought this might have originally had something to do with the resource provider registration, but the device is registered (and luckily MSFT would have thrown a different error)
    • Moreover, if this isn't tied to this subscription - what is it tied to?
rcaper commented 1 year ago

looking into this issue thanks for flagging

mettke commented 1 year ago

I also experience this problem.

Not sure about the Authors problem, but for me, I was able to resolve this by making sure that the resource group is created somewhere near me.

The setup.sh script explicitly creates the resource group in the location westus. Me being in europe, if I change it to westeurope everything works fine.

I guess this has to do with the azure portal taking some time to propagate changes made in the us region when querying from a European region. A fix could be to get the region of the cloud shell and creating the rg in that region or a region nearby

AndyLi-Vitals commented 1 year ago

Hi

I also experienced this issue today, and managed to workaround it using @mettke 's suggestion. E.g. changing lines 13 and 34 to a local region (uksouth in my case) allows the script to work fine.

Thanks.

rcaper commented 1 year ago

The issue has been fixed. We changed the setup script to choose a region from a random list, rather than staying fixed with westus. This worked when testing, eliminating all errors.