lcarli / NodeRed-Azure-Storage-Blob

This project provides a NodeRed node that makes it easy to consume and manage Microsoft Azure Storage Services.
Apache License 2.0
1 stars 4 forks source link

Error Message Credentials #2

Open Armin-FB opened 6 years ago

Armin-FB commented 6 years ago

Hi,

I want to upload a file to my azure blob storage, so I worked after the instructions. Now I get this Error message from the Node:

"Error: Credentials must be provided when creating a service client."

Any suggestions?

thanks and best regards!

Armin-FB commented 6 years ago

Hey I reinstalled usin this instruction: https://nodered.org/docs/hardware/raspberrypi

Now I get this Error-Message "Error: getaddrinfo ENOTFOUND sc0img0data0dev.blob.core.windows.net sc0img0data0dev.blob.core.windows.net:443"

sc0img0data0de is the name if my storageaccount

rasavant-ms commented 6 years ago

Hey Armin,

I hope you have the .jpg file that you are trying to upload in the right directory. It should ideally be in your ~/.node-red directory or you can try providing an absolute path name.

I am working to resolve a couple of issues that I was seeing while testing this node out. Currently I have fixed the error that you were seeing earlier - "Error: Credentials must be provided when creating a service client."

What is to be worked upon is: Error caused when a container does not already exist and needs to be created.

I am working on resolving that. But hopefully, this takes you further along in your work/testing.

Armin-FB commented 6 years ago

Hey @rasavant-ms!

Thanks for your reply, I now put in the absolut file path and get these error-messages:

msg : error "Error: getaddrinfo ENOTFOUND sc0img0data0dev.blob.core.windows.net sc0img0data0dev.blob.core.windows.net:443" 26.1.2018, 09:50:25node: Azure Get Blob Storage msg : string[142] "Error while trying to create blob:Error: getaddrinfo ENOTFOUND sc0img0data0dev.blob.core.windows.net sc0img0data0dev.blob.core.windows.net:443"

I'm trying to upload the file to an already existing blob and container, is that an issue maybe?

Armin-FB commented 6 years ago

Hey @rasavant-ms ,

are there any updates?

I’m getting this error:

"Error while trying to create blob:Error: getaddrinfo ENOTFOUND sc0img0data0dev.blob.core.windows.net sc0img0data0dev.blob.core.windows.net:443"

Is it problem, that I’m trying to upload into an existing blob? I can’t see, what I am doing wrong.

Thanks and best regards, Armin

rasavant-ms commented 6 years ago

What is the blob name, container name, storage account name parameters that you are using? There should be no issue trying to upload to existing blob. Essentially, the blob will be overwritten with new data (createBlockBlobFromLocalFile is the nodeJS call made in the code). Make sure that is what you want to do.

Armin-FB commented 6 years ago

@rasavant-ms thanks for your answer, there are a few things I just realized:

When I “deploy” the flow, I get this error:

"Error while trying to create blob:Error: getaddrinfo ENOTFOUND sc0img0data0dev.blob.core.windows.net sc0img0data0dev.blob.core.windows.net:443"

I think the node tries to access sc0img0data0dev.blob.core.windows.net But I can’t access this url.

The Endpoint I use is: https://sc0img0data0dev.blob.core.cloudapi.de Could that be an issue ?

When I inject the flow manually by clicking on the inject node I also get this error: "TypeError: Cannot read property 'accountname' of undefined"

Thanks for your help Rajasa and best regards, Armin

rasavant-ms commented 6 years ago

Can you try importing this flow: [{"id":"6a913d9a.fa0844","type":"azureiothubregistry","z":"e621cbfa.f8a5f8","name":"Azure IoT Hub Registry","x":630,"y":240,"wires":[["14a58301.e60a9d"]]},{"id":"2fd0a3f.969ce5c","type":"inject","z":"e621cbfa.f8a5f8","name":"Register Payload","topic":"","payload":"{\"deviceId\":\"device146\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":400,"y":240,"wires":[["6a913d9a.fa0844"]]},{"id":"14a58301.e60a9d","type":"debug","z":"e621cbfa.f8a5f8","name":"Log","active":true,"console":"false","complete":"true","x":910,"y":240,"wires":[]},{"id":"f775e252.a49f2","type":"debug","z":"e621cbfa.f8a5f8","name":"Log","active":true,"console":"false","complete":"true","x":910,"y":180,"wires":[]},{"id":"95789379.e44d2","type":"azureiothub","z":"e621cbfa.f8a5f8","name":"Azure IoT Hub","protocol":"http","x":600,"y":180,"wires":[["f775e252.a49f2"]]},{"id":"228b0f18.7799c","type":"inject","z":"e621cbfa.f8a5f8","name":"Send Payload","topic":"","payload":"{\"deviceId\":\"device146\",\"key\":\"FgySFuUzwtQMrlS29GRr7luoW07RNAmKcMy5oPDA8pA=\",\"protocol\":\"http\",\"data\":\"{tem: 25, wind: 20}\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":390,"y":180,"wires":[["95789379.e44d2"]]}]

Now enter your Azure IoT Hub hostname in the azureiothub node. For Eg. NodeRedIotHub.azure-devices.net And enter your Azure IoT Hub Connection string in the connectionString parameter in the azureiothubregistry node. Fo Eg. HostName=;SharedAccessKeyName=registryReadWrite;SharedAccessKey=