Describe the bug
'No IoT Hub found with name Hydro-QA-Hub in current subscription.' error when executing
az iot hub device-identity create --device-id "testabe" --hub-name "hubName" --edge-enabled
To Reproduce
Expected behavior
The edge device 'test' in the hubName should be created.
Environment summary
Actual Result:
'No IoT Hub found with name Hydro-QA-Hub in current subscription.' error
@c-ryan-k
Hey @binishababu - if you run:
az iot hub show -n "Hydro-QA-Hub" -o table,
...do you get the same error?
Let's see if that hub exists inside the subscription you've set.
Try:
az account show -o table - just to sanity check that you're logged into the correct subscription. The "Name" column should match your subscription.
Once you verify that you're on the correct subscription, you can run:
az iot hub list -o table - to see all hubs in all resource groups that are in your subscription.
Do you see the hub you're looking for in there?
az account show -o table
EnvironmentName IsDefault Name State TenantId
AzureCloud True mysubscription Enabled 3d2d2b6f-061a-48b6-b4b3-9312d687e3a1
and the below command gives
az iot hub show -n "Hydro-QA-Hub" -o table
Operation returned an invalid status code 'Not Found'
Also
'az iot hub show -n "Hydro-QA-Hub" -o table 'gives an error as below
ResourceGroupNotFound - Resource group 'test-UAT-RG' could not be found.
The test-UAT-RG is in another subscription.
If the hub is in a resource group in another subscription you have two options:
1: specify --name NAME --resource-group GROUP and --subscription SUB_ID
2: specify --ids ID
Both of those approaches should work--if they don't it is a bug.
@tjprescott why this ticket is closed?
Nothing works.
Please reopen the ticket
any workaround for this issue?
@c-ryan-k for comment.
@binishababu - So just to make sure I can reproduce this issue, let's verify where your hub lives:
az account list -o table ?az account set --subscription [sub]az iot hub list -o table - do you see your hub?If your hub lives inside a different subscription, then like @tjprescott mentioned, you can try to locate it within the RG and Subscription it belongs to:
az iot hub list --resource-group [RG] --subscription [sub]
@binishababu - Are you still encountering this issue? If so, please share your experience after following the steps above.
@binishababu can you let us know if you're still hitting this issue?
This still exists
Try only including the IoT Hub name - not the full name. Ie if the hub hostname is yourname.azure-devices.net - trying using yourname only.
@binishababu we need a bit more detail to continue as per comment from @c-ryan-k above. In the meantime I will close the issue. Please comment back and we can reopen
~I'm experiencing the same issue and _cannot_ resolve it with the steps outlined by @tjprescott~
Resolved by leaving out the azure-devices.net suffix
Most helpful comment
~I'm experiencing the same issue and _cannot_ resolve it with the steps outlined by @tjprescott~
Resolved by leaving out the azure-devices.net suffix