I'm trying to create a powershell script that will create a new event hub, consumer group, and Shared Access Policies, all so I can then create an Event Grid Subscription that then uses the event hub as the endpoint. Using:
$eventHubResource = New-AzureRmEventHub
-ResourceGroupName $RG.Name
-NamespaceName $eventHubNameSpace.Name
-Name $eventHubName
-MessageRetentionInDays $eventHubMessageRetention
-PartitionCount $eventHubPartitionCount
I can create the event hub, SAP's and consumer groups, but when trying to create the EventGridSubscription using: New-AzureRmEventGridSubscription
it asks for an -Endpoint parameter
-Endpoint
Event subscription destination endpoint. This can be a webhook URL or the Azure resource ID of an EventHub.
How can I get the EventHub resource Id via powershell?
Get-AzureRmEventHub does not return the resource id to be used New-AzureRmEventHub seems to return the same object as the Get-AzureRmEventHub
I haven't had any success with Get-AzureRmResource as it seems to only list the resources from a parent level and not for a given resource itself, but I may be using it incorrectly.
I'm open to suggestions on what to try.

