In this video, we'll create a national function with a cure message. Tree go.
Let's switch to azure Management Porto and do that.
Creating a function with acute trigger is very similar to the function with http three year
Inside our function up, you just need to click on the plus sign to create a new function,
and you can say like azure que storage trigger.
I will name our function que trigger
What you need to do is you also need to select the Q name in the storage account connection.
I have already created a storage account. Now I need to connect my storage account and buying the cue to my,
how? Click on New Here
and I will select my cyber very
input binding storage account
and the name of the Q is cyber very example que
so I won't bind this thing to my function.
And now, from now on, this function will be triggered by any message that is sent toe the cyber the example que in the storage account,
let's go and test that we can taste that directly from Dodger Porto when we are on the function and we click run
actual environment. Simon assimilates the sending of a message, and as you can see, the execution happens and we get log message here with the sample Data Cube.
Now let's try to do another test. I will go and use the actual Q and submit a message in need and see whether the
function will be triggered.
Let's go to the storage account
will go into the Q and submit a message using Azure Storage Explorer.
So here is the storage account.
Inside, the storage account is the cue.
So what will select storage exporter
and we'll go to the cues. As you can see, this is Sai Buri example Q. And we'll just create a new message there.
and we'll typing the message he sees a message from Storage
will submit the message.
this is the message. The message text and all the other information will go back to our function
and you'll see that the function trigger immediately.
This is a message from storage Exporter Log message.
As you can see, you can get information from the messages so you have a complete
access to the message inside the function so you can pull information out of the message and process this message based on the information inside it.
As you can see, creating a function that is
triggered by a que message is quite reviewer.
In this lesson, we also learned how you can bind a service azure service to your function. What we did is we bound our
storage account and the cue to our function, and we use that to trigger the function.