Deploy EventGrid using powershell - azure

I have an EventGrid for analyzing the device active and inactive status which means Azure IOT collect the information from sensors and publish the event to EventGrid and subscribe to Azure Queue. It is working fine. Now, I want to deploy this EventGrid functionality to cloud using PowerShell. I have checked a lot of EventGrid document deployment using Azure PowerShell. We can deploy the EventGrid with Queue subscription. But could not find any input from IoT. How will we set input from IoT hub?

There might be a way to subscribe to and filter all of the events of a resource group. Provided that your IoT hub is part of a resource group, perhaps you can receive all events from it?
I imagine you've tried that though.https://learn.microsoft.com/en-us/powershell/azure/get-started-azureps?view=azps-1.8.0
If the above link doesn't help you. I would request you to let me know, –

Related

send events from Azure Service Bus Topic to Event Hub

I want to send an event that is sent to Azure Service Bus topic to an event hub. Is this possible?
Details:
I am working with a different team in my company that receives third party events (via webhook) to Azure Service Bus topic and this is further used in different application.
My team wants to now listen/subscribe to this topic using our existing event hub and using azure capture store these events to a storage account.
I did the following:
I created a subscription to their topic in their Azure Service Bus.
I created an event hub in my Event hub namespace.
I am not sure, how to now connect the azure service bus topic subscription to send those events to my event hub.
Thanks for your time.
Service bus operates with the receivers having to pull messages from it. This is opposite to Eventgrid which pushes the events to its subscribers. Eventhub does not pull messages from the source, we need to push messages into it. So you cannot achieve your requirement without an extra component between Service Bus and Eventhub.
One of the possible components would be a service bus topic triggered azure function LINK which writes into the eventhub using output binding LINK or the SDK LINK.
You will need to choose your service plan carefully depending on the volume of messages expected but usually Consumption plan will suit this purpose.

Monitor new coming files and start a new VM

I would like to build a trigger like thing that can monitor my Azure File Storage for new coming files. If there are new files then create a VM.
What should I look at? Monitor + Alert or Logic Apps Designer?
Any one done anything similar before? Thanks!
What should I look at? Monitor + Alert or Logic Apps Designer?
I recommand that you could use Azure function+ Event Grid.
You could use the Event Grid to listen the change of the storage and implement the creating VM in the Azure function. About how to handle Event Grid events in Azure Function, please refer to this document.
Note: Currently, the following Azure services support sending events to Event Grid:
Azure Subscriptions (management operations)
Container Registry
Custom Topics
Event Hubs
IoT Hub
Media Services
Resource Groups (management operations)
Service Bus
Storage Blob
Storage General-purpose v2 (GPv2)
If Azure blob storage is possible, you could use the Azure function with blob trigger.

How to get Azure Webapp start/stop events to Azure Functions

I have a requirement when webapp is started or stoped my azure function should be called. I have gone through Azure Grid Events, using Subscription as Resource Group but it does not capture any event on WebApp. So Azure Function is not called.
Is it possible to achieve this using Event Grid? I dont want to create use Custom Events.
Is it possible to achieve this using Event Grid? I dont want to create use Custom Events.
In short answer, it is not possbile to do that currenctly. We could get more information about Event grid from this tutorial.
Currently, the following Azure services support sending events to Event Grid:
Azure Subscriptions (management operations)
Custom Topics
Event Hubs
IoT Hub
Resource Groups (management operations)
Service Bus
Storage Blob
Storage General-purpose v2 (GPv2)
Note: It supports part of the region currently.
As Thomas mentioned that you could try to application insights paired with availability monitoring alert.

Unable to Associate a SB Queue to an Azure IOT Hub Custom Route

I'm trying to add a Custom Endpoint to an IOT Hub. The Endpoint should write to a Service Bus Queue in my Resource Group. I'm getting error "No namespaces found for subscription id ... in the region where this IoT hub is located".
According to the IoT Hub Properties blade on the Portal, my IoT Hub is in my Resource Group xxx, in the East US region location. My IoT Hub has 3 built-in endpoints: File Upload Notifications (messages/servicebound/fileNotifications), Cloud to device feedback (messages/servicebound/feedback) and Events (messages/events).
According to the ServiceBus Properties blade, my ServiceBus namespace is also in my Resource Group xxx, also located in the East US location. My ServiceBus has several Queues and Topics. Some of my queues enable partitioning, others do not. The max size of my queues range from 1GB to 16 GG to 80 GB. They are all active.
I've also tried to create a new EventHub namespace, with an Event Hub instance, in my Resource Group xxx, also located in the East US location. The IoT Hub Custom Route blade also does not see this Event Hub's namespace.
What am I missing? Is the Custom Endpoints feature requiring something of my IoT Hub or ServiceBus or EventHub that I'm not setting properly?
This turned out to be an Azure issue, now fixed by Microsoft.
The IOT Hub and SB were correct, as far as the Portal UI was concerned. In our case the scripts all used the same, precise, string for specifying Location but the issue occurred nonetheless.
There had been an issue in the SubscriptionId/ResourceGroup/Location validation logic in Azure - I believe due to how the 'Location' element was stored internally originally.
I'm told that Microsoft has repaired the data -- potentially Azure wide, but certainly the data that affected our Subscriptions and their IotHubs.

Stream Analytics jobs receive no input

I downloaded and deployed the Remote Monitoring Azure IoT Suite project. The only change I made to the deployment template was to deploy a free version of IoT Hub instead of S2. I am using the Azure IoT SDK to send messages to the IoT Hub. Monitoring on Azure Portal shows me that messages are arriving.
But when I look at the three Azure Stream Analytics jobs, none of them are receiving any inputs. It's like IoT Hub isn't letting any of the ASAs know that there is data to process. The permissions are unchanged. IoT Hub has a policy with all permissions and all the ADAs are using that policy. I created a new ADA with the same policy and I don't get any data in that one either.
What could be going wrong here?
It seems there was a glitch in Azure. I came back and everything was magically working. Sigh...

Resources