More documentation for Azure

Trying to follow this tutorial.
https://docs.ghielectronics.com/software/tinyclr/tutorials/azure.html

I have:
iotHubName
deviceId

Replace “password” with a string that starts with “SharedAccessSignature sr=…”.
where is this in Azure?

There are shared access policies, which has access key and connection string
Like this: “xDyELoA4d1qd4BpY47JrGKaKS9RwCtNjJgYoLArp/uE=”
Like this: “HostName=yourhub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xDyELoA4d1qd4BpY47JrGKaKS9RwCtNjJgYoLArp/uE=”

Device has this:
HostName=yourhub.azure-devices.net;DeviceId=yourdevice;SharedAccessKey=IbEBViUjrIL3hJ5/Xilqu4kWadQLZtAM25Iy4qRbXpY=

what authentication type to choose?
i can update the documentation to be more precise once i figure out how to do this

There is a nice tutorial to use Azure IoT from microcontrollers in C++.
It should be not too difficult to port this App to TinyCLR.
-https://blog.benjamin-cabe.com/2020/08/05/connecting-the-wio-terminal-to-azure-iot

It does not work for me either. I keep getting ConnectReturnCode 5 (NotAuthorized)

I believe Microsoft Doc docs about this, but easier if you download this tool to generate it:

Microsoft seems provide new tool so you can use but I haven’t used it yet.
Any way, you need Generate SAS token and copy it, use it as password.

And, keep in mind about this , it will be happened in next few days.

Thanks. Now it works. :slight_smile:

1 Like

Great! Would be nice if you could post a little example project (or link to a Github repo) which shows how it works in TinyCLR.

1 Like

Just like the tutorial but with these modifications

I downloaded Baltimore CyberTrust Root Certificate *.pem file from here.
https://www.digicert.com/kb/digicert-root-certificates.htm
Then uploaded the Certificate to Azure.

Then added a string value resource with the certificate
(Open the *.pem file with notepad)

var caCert = new X509Certificate(UTF8Encoding.UTF8.GetBytes(Resources.GetString(Resources.StringResources.BaltimoreRootCA))));

var iotHubName = “XXXXXXXXXXXXXX.azure-devices.net”;

var password = @"SharedAccessSignature sr=XXXXXXXXXXXXXXXXX.azure-devices.net%2Fdevices%2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1 Like

We will add a couple of notes to docs to make easier for everyone. Thanks.

I am not sure if this step is necessary ?

Can you show us where you got this instruction?

1 Like

Correct. I think it was some leftovers from a desperate try to make it work. :slight_smile:
I deleted the certificate from Azure, and it is still working.

2 Likes

All Cloud Support Tutorials have been updated with better instructions in Docs.

2 Likes

What about IFTTT :nerd_face: @Greg_Norris

1 Like

Aren’t they terminal now, given that they have started charging for non-trivial implementations?

I didn’t know that. We will check…

ok so I may have attempted to predict the future, but their business model was recently (~1 month) changed and now you can have only 3 automations to remain “free”. So there’s not much benefit in using them any longer, in my view. Sure, some people will pay for the logic platform, but I won’t…

IFTTT is currently offering a pricing promo for their Pro service until Oct 31st… You set the price you’ll pay forever, as long as your account is active. As little as $1.99 per month. Everyone after Oct 31st will have to pay a minimum of $3.99 per month which they lowered from the original announced cost of $9.99 per month.

https://ifttt.com/subscriptions/pro?utm_medium=website&utm_source=toutbuton&utm_campaign=freecountdown&

I used to use them but it meant a delay when something was to be switched on and if your internet was down, nothing works. I switched everything over to Node-red and kept as much as possible internal to the home network. My Alexa devices are the only ones that require external connection but I can still do things manually without it and just lose voice control.

1 Like