Skip to main content
1-Visitor
January 15, 2018
Question

Configuring Thingworx Azure IOT Hub Connector

  • January 15, 2018
  • 3 replies
  • 7922 views

Hello All

I have installed Thingworx 8.1 war on 64 bit operating system. Now, I want to use Thingworx Azure IOT Hub Connector to connect the Thingworx to Azure IOT.

I am getting an error as follows whenever I am trying to run the azure-iot.bat file of Thingworx Azure IOT Hub Connector :

Error in custom provider, java.lang.RuntimeException: Error initializing azure cloud storage account

  at com.thingworx.protocol.azure.iot.AzureIotGuiceModule.getDeviceExportBlobStorageAccount(AzureIotGuiceModule.java:165)

  at com.thingworx.protocol.azure.iot.AzureIotGuiceModule.getDeviceExportBlobStorageAccount(AzureIotGuiceModule.java:165)

  while locating com.microsoft.azure.storage.blob.CloudBlobClient annotated with @com.google.inject.name.Named(value=DeviceExportBlobStorage)

Caused by: java.lang.RuntimeException: Error initializing azure cloud storage account

at com.thingworx.protocol.azure.iot.AzureIotGuiceModule.getBlobClient(AzureIotGuiceModule.java:186)

at com.thingworx.protocol.azure.iot.AzureIotGuiceModule.getDeviceExportBlobStorageAccount(AzureIotGuiceModule.java:165)

at com.thingworx.protocol.azure.iot.AzureIotGuiceModule$$FastClassByGuice$$cc5439e4.invoke(<generated>)

at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:264)

at com.google.inject.internal.ProviderMethod$Factory.provision(ProviderMethod.java:401)

at com.google.inject.internal.ProviderMethod$Factory.get(ProviderMethod.java:376)

at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)

at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)

at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)

at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)

at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)

at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)

at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)

at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)

at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)

at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)

at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)

at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:232)

at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:236)

at com.thingworx.connectionserver.ConnectionServer.instantiateProtocol(ConnectionServer.java:102)

at com.thingworx.connectionserver.ConnectionServer.startServer(ConnectionServer.java:71)

at com.thingworx.connectionserver.ConnectionServer.main(ConnectionServer.java:145)

Caused by: java.lang.IllegalArgumentException: Invalid connection string.

at com.microsoft.azure.storage.CloudStorageAccount.parse(CloudStorageAccount.java:249)

at com.thingworx.protocol.azure.iot.AzureIotGuiceModule.getBlobClient(AzureIotGuiceModule.java:182)

... 21 more

Now I am bit confused here . In the conf file of Thingworx Azure IOT Hub Connector we give the configuration for the azure blob storage account as follows:

blob-storage {

         

                    // <blob-store> > Settings > Access Keys > Storage account name

                    account-name = "<account-name>"

                    // <blob-store> > Settings > Access Keys > key1 or key2

                    account-key = "<account-key>"

          

        }

Here we are not giving the connection string anywhere then why does the error log say .... Invalid Connection String?.

Kindly help me solve this issue.

3 replies

tgarg11-VisitorAuthor
1-Visitor
January 16, 2018

Hello All

I would request the developer community to please take this issue on priority basis as I am really stuck here and not able to proceed further.

tgarg11-VisitorAuthor
1-Visitor
January 18, 2018

Hello All

I am eagerly waiting for some help on this issue. Please give me some help on this issue.

5-Regular Member
January 18, 2018

Hi Tarun, before asking anything else, reading your comments if you feel this is urgent issue related to PoC/Project, etc I'd highly recommend you to open a support case. Prioritising issues on community is challenging and may not get the required attention as you are looking for.

Could you clarify if you are attempting to use the Azure blob  or not? or simply trying without the blob storage?

tgarg11-VisitorAuthor
1-Visitor
January 18, 2018

Thanks for your response . I understand your point and will keep this in mind for future.

Coming to the issue,  I have created a blob storage account in my azure batch account and am passing it's account-key and account-name in the azure-iot.conf file of Thingworx Azure IOT Connector by following the directions given in the conf file.

blob-storage {

        

                    // <blob-store> > Settings > Access Keys > Storage account name

                    account-name = "<account-name>"

                    // <blob-store> > Settings > Access Keys > key1 or key2

                    account-key = "<account-key>"

         

        }

14-Alexandrite
January 18, 2018

I'm dealing with this issue right now. It appears Microsoft has made the naming conventions for event hubs stricter. Upper-case characters don't seem to be allowed in event hub names any more.

I fixed my issue by converting my hubName, eventHubName, and hubHostName entries in azure-iot.conf to all lower case, where applicable. For example, where I formerly had, "DemoIoTHub3", I substituted, "demoiothub3". This fixed my issue with the, "Error initializing azure cloud storage account," error.

Please give this a try. R&D is aware of the issue.

tgarg11-VisitorAuthor
1-Visitor
January 19, 2018

Hi Stephen, I have tried by substituting my hubName , eventHubName and hubHostName entries to lower case in the conf file. But I am still getting this error.