Testing Azure Stream Analytics Job not working (Error on send) - azure

I'm trying to complete the tutorial of Azure Stream Analytics that using an app provided by Microsoft docs to send data to Azure Event Hub, to be simple, I'm just following this tutorial.
Now I got stuck at the step: "Start the event generator application"
What I have done is:
Create the Azure Event Hub & Azure Event Hub Namespace
Create the policy at "Shared access policies" (as below)
Update the element in the config file (telcodatagen.exe.config, as below)
The below file can be download here.
Here are the values I filled in at the shelter in the previous image:
<add key="EventHubName" value="***My Event Hubs Namespace***"/>
<add key="Microsoft.ServiceBus.ConnectionString" value="***My Connection string–primary key without the EntityPath value***"/>
But when I run the below command at CMD:
telcodatagen.exe 1000 0.2 2
I got an error as the figure below (error on send: one or more error occurred):
I'm completely brand new to Azure Event Hub and Azure Stream Analytics and I can guarantee to follow the steps of the tutorial, but I am not sure what the error is, why this error occurs and how to debug.
Any solution? Thanks!

Your ConnectionString is wrong.
You should get it from namespace,not Instance.
And EventHubName is your Event Hubs Instance's name.
By the way,you can download c# code from Github.
Hope this can help you:).

Two things to fix:
This needs to be set to the entity name not "Event Hubs Namespace".
<add key="EventHubName" value="***My Event Hubs Namespace***"/>
Remove trailing ; at the end if there is one.
<add key="Microsoft.ServiceBus.ConnectionString" value="***My Connection string–primary key without the EntityPath value***"/>

I had similar issues & downloaded the source as per Steve's comment.
I couldn't build as it targeted .Net 4.5.1
Gave up, used this blog post to build my own Event Sender
Another alternative might be try downloading .Net 4.5.1 Developer Pack & debug?

Related

AzureBlobCredentialMissing Error only occurs when triggered, versus no error in Debug

I get the following error in a pipeline that's first activity is to do a lookup on a storage container to get the contents of a file. When I test the connectionns, linked server, datasets or debug the pipeline I do not receive any errors. However when the pipeline is triggered by the storage event, it throws this error:
ErrorCode=AzureBlobCredentialMissing,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Please provide either connectionString or sasUri or serviceEndpoint to connect to Blob.,Source=Microsoft.DataTransfer.ClientLibrary,'
As per your scenario, where the debug is successful but the trigger runs failing. This make me assume that your dev changes have not been published which is why the trigger run fails. In simple terms the most recent published version of your linked service is different than that of your development version which haven't been published.
In case if you are using Source control then I would recommed following this tutorial for best practices - Automated publishing for continuous integration and delivery
If you are using CI-CD, then the issue might indeed cause by the DevOps pipeline not overriding the linked service parameters. Try redeploying the resource bye following below step and it should work as expected. (Linked service parameters had to be overwritten on the Azure resource template)
For example, if you have a linked service such as below:
Then you will still have to add below values into the overrideParameters section of the AzureResourceManagerTemplateDeployment task.

Sending data to Azure IoT hub using REST

I am trying to learn the Azure IoT hub, but I am unable to send data to my IoT hub using Postman.
I did the following:
Create Azure IoT hub
Create a device using Azure Portal CLI
Copied the text where it said "primary key" on the Device page
My request looks as follows:
POST https://myhub.azure-devices.net/devices/MyDevice/messages/events?api-version=2020-03-13
I have added the authorization header, which has the value:
SharedAccessSignature=SharedAccessSignature sr=myhub.azure-devices.net%2Fdevices%2FMyDevice&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Where the key is the copied text from the "primary key" field from the device page.
Content-type is set to application/json. But the body is currently empty.
I am getting the following response:
"Message": "ErrorCode:ServerError;InternalServerError",
Note: Hub and device name are not the same as stated here.
For a quick-start on this, we have 3 stages 1) SAS key generation from Visual Studio Code see below images(Or from CLI please see the answer posted by silent) 2) Use Postman 3) Monitor via VS code
Steps: VS Code
1) Install VS Code extension tools for Azure IoT & Connect your IoT Hub as per onscreen instructions
2) You can see the list of devices in VS code Explorer. Now right click the device (created in the portal) and select 'Generate SAS Token for the device', give the time in hours like 24 and hit enter.Copy the SAS key from output window fully (entire). Sample shown below.
SharedAccessSignature
sr=deviothub.azure-devices.net%2Fdevices%2FNewDevice&sig=H3II%2FCa5Km5V2pieP5Ti1SI%3D&se=1590867649
Steps Postman
1) I hope you have already visited this document on Azure IoT Hub REST API
Replace the required sections with your IoT Hub values.
POST
https://fully-qualified-iothubname.azure-devices.net/devices/{id}/messages/events?api-version=2020-03-13
2) Make sure to include the fully copied SAS token and use it in the header section of POST call
3) Body content : It depends on your use case.
example 'raw'--JSON--> {"Temperature":54}
**You can see the accepted response from IoT Hub as '204 No Content'
Step Monitor the Telemetry the easy way
1) Open the VS Code editor and right click the particular device and slect 'Start Monitoring the in built events'
2) Send another telemetry from Postman and you can see the message arrived at IoT Hub and is visible on the VS code Monitoring screen.
Happy Azure IoT Learning
You need to calculate the auth header based on your primary key, not just put it into the header. See here for examples how to do this, for instance by using CLI az iot hub generate-sas-token

Azure event triggered function for blob creation

I've been trying to create an azure function which will move blobs from one container to another. For this purpose, I created a function following this tutorial.
Now when I add blob in container, I can debug the rest in local. Problem starts when I try to deploy the function. I'm using CICD for function deployment. After that, when I'm trying to configure the event subscription, it's failing.
I cannot edit the ENDPOINT DETAILS when creating event subscription
If I try to "Add event grid subscription", it gives a strange error message - Deployment has failed with the following error:
{"code":"Url validation","message":"The attempt to validate the
provided endpoint
https://.azurewebsites.net/admin/extensions/EventGridExtensionConfig
failed. For more details, visit https://aka.ms/esvalidation."}
All the tutorials I found are either irrelevant or outdated. Does anyone have any suggestion what I should do or what am I doing wrong?
Thanks in adance

Azure Function, Service bus trigger not working

I'm trying to set up an Azure Function that I want to trigger when a message is put on a Service Bus queue. However, I can´t get it to work. The first "log.Info" does not trigger.
I deployed an Http trigger together with my Service Bus trigger and that works.
Some screenshots is shown below. I´ve already tried to remove the json string with key "generatedBy", as I saw as a suggestion on Google.
There are two files in my Visual Studio project which I have not edited: host.json and local.settings.json, I can´t find information about how to set them up or if it´s necessary at all.
Can anyone help me?
The Connection property of ServiceBusTrigger attribute should refer to a setting name, e.g. ServiceBusConnectionString.
Then, you should put the setting with same name to local.settings.json for local development and to Application settings for Azure.
I needed to append this bit to my ServiceBusConnectionString when running locally:
;TransportType=AmqpWebSockets

Event hub does not load in Azure portal when resource group has accent in its name

When I follow these steps:
create event hub in a namespace with a resource group named tést (or other name with é in it)
Try to open up the event hub in the portal
Then the portal never finishes loading the event hub and I get this:
rainy cloud
I can reproduce this bug on different Azure subscriptions...
#SQLWaldorf,
I checked on this issue, when using the accent in Portal, it doesn't allow me to create the namespace since the character doesn't seem to be supported, I attached both screenshots from my experiment:
Then without accent:

Resources