azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az iot hub routing-endpoint create: error: argument --connection-string/-c: expected one argument

Open arabelaa opened this issue 7 years ago • 11 comments

az feedback auto-generates most of the information requested below, as of CLI version

2.0.76

Describe the bug When running the following azure-cli command I get a strange error

az iot hub routing-endpoint create --hub-name 'xx' --endpoint-name 'yyyx' --endpoint-type azurestoragecontainer --endpoint-resource-group Cloud-G ateway --endpoint-subscription-id 'xxx' --connection-string 'DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;Accou ntName=storageiothubtest;AccountKey=xx'

Error: az iot hub routing-endpoint create: error: argument --connection-string/-c: expected one argument I enabled debug flag and indeed the connection string parameter is not read.

I provide the correct arguments and the command still fails. I tested this inside azure cloud shell and it works perfectly fine. I am not sure where the problem is. Any help is appreciated.

I think the issue is somehow related to bash. I am running this on Windows using Git bash.

arabelaa avatar Nov 07 '19 11:11 arabelaa

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @iluican @jlian

ghost avatar Nov 08 '19 03:11 ghost

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @iluican @jlian

ghost avatar Nov 08 '19 03:11 ghost

Wait, so this works with Cloud Shell but doesn't work with git bash on windows? Weird @iluican can you assign someone to look at this please

jlian avatar Nov 08 '19 17:11 jlian

The issue is caused by this known issue: https://bugs.python.org/issue9334 Auxiliar syntax (--connection-string='value') can be used as a workaround

radeanurazvan avatar Nov 14 '19 14:11 radeanurazvan

Looks like we agree on tracking this outside here. Closing

jlian avatar Dec 11 '19 00:12 jlian

Hello,

May I know whats the endpoint-resource-group, endpoint-subscription-id and connection-string in this below command. Or please let me know if there is a way to get these property values.

az iot hub routing-endpoint create --hub-name 'xx' --endpoint-name 'yyyx' --endpoint-type azurestoragecontainer --endpoint-resource-group Cloud-G ateway --endpoint-subscription-id 'xxx' --connection-string 'DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;Accou ntName=storageiothubtest;AccountKey=xx'

Thanks, Satish Kumbari

SatishKumbari47 avatar Dec 13 '19 16:12 SatishKumbari47

az iot routing-endpoint list

will return all the information for endpoints (including name, resource group and connection string).

iluican avatar Dec 13 '19 17:12 iluican

Hello @iluican

Thanks for your reply. When I tried to create the storage endpoint with the above command(az iot hub routing-endpoint create) using the property values(endpoint-resource-group, --connection-string, endpoint-subscription-id ) from the command provided by you (az iot routing-endpoint list), I am unable to create the endpoint and getting error as "exceptionMessage:No valid combination of account information found. If you contact a support representative please include this correlation identifier: 0c78e291-3410-4144-86d4-92aa11e6c237".

Are the resource-group name and endpoint-resource-group name different?

Please someone help. @arabelaa @jlian @radeanurazvan @

-Satish

SatishKumbari47 avatar Dec 14 '19 07:12 SatishKumbari47

To retrieve the storage account resource group: az storage account show --name storage_account_name

(the information you need is the value of "resourceGroup" key)

To retrieve the storage account connection string: az storage account show-connection-string --name storage_account_name

You can use these values to run the endpoint creation command:

az iot hub routing-endpoint create --hub-name hub_name --endpoint-name endpoint_name --endpoint-type azurestoragecontainer --container-name container_name --endpoint-resource-group resource_group --endpoint-subscription-id subscription_id --connection-string connection_string

iluican avatar Dec 14 '19 14:12 iluican

Hi @iluican

Thanks so much for your time and valuable response. I have used the command az storage account show-connection-string --name storage_account_name to get the value for --connection-string and used the command az storage account show --name storage_account_name to get the values for resource_group and used the id value as --endpoint-subscription-id.

I used these above 3 from values into the endpoint creation command provided by u above. But when I execute the command, I am unable to create the storage endpoint and getting error as "SubscriptionId length exceeded. Endpoint name:testendpoint, subscriptionId:subscriptions/abcdefg-hijk-lmno-pqrs-143576agfs/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/teststorageaccount".

I am out of trying all the ways. Please help me to create storage endpoint, that would be grateful.

Thanks, Satish

SatishKumbari47 avatar Dec 15 '19 12:12 SatishKumbari47

Hello All,

This issue has been resolved, I got the mistake that I was doing while creating endpoint that is I was passing existing already used container name while creating endpoint hence I was facing this issue. I had no idea that I have to pass a new container name everytime for every new endpoint. Anyways, now I could able to create storage endpoint so did message routing. Thanks everyone for your help :)

SatishKumbari47 avatar Dec 19 '19 08:12 SatishKumbari47