Defaults to Resource Group as the source for eventGrid
Exposes Microsoft.Resources.* events for subscriptions
Introduces 2 overloads of add_function_subscriber to specify Azure Function as subscription target
with function resource defined in the current deployment
with LinkedResource reference to function handler already deployed separately
I think the latter overload will be more widely used as the handler, not just the function has to exist when subscription is created. This means the code has be deployed that exposes the handler, which is often a separate from ARM step.
[x] Tested my code end-to-end against a live Azure subscription.
[x] Updated the documentation in the docs folder for the affected changes.
[x] Written unit tests against the modified code that I have made.
[x] Updated the release notes with a new entry for this PR.
[x] Checked the coding standards outlined in the contributions guide and ensured my code adheres to them.
Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:
/// Send events to this function that was deployed separately
let fnRef =
{ Arm.Web.siteFunctions.resourceId(ResourceName "gridFnApp", ResourceName "eventHandler") with
ResourceGroup = Some "fn-rg" }
|> Unmanaged
/// The source will default to the resourceGroup() and event grid target will be the function handler.
let grid = eventGrid {
topic_name "src-rg-events"
add_function_subscriber fnRef
{ MaxEventsPerBatch = 1u; PreferredBatchSizeInKilobytes = 64u }
[ SystemEvents.Resources.ResourceWriteSuccess; SystemEvents.Resources.ResourceActionSuccess ]
}
// deploy into the resource group that we want to be the source of events
let deployment = arm {
add_resources [
grid
]
}
This PR closes #1029 and #1030
The changes in this PR are as follows:
add_function_subscriber
to specify Azure Function as subscription targetfunction
resource defined in the current deploymentLinkedResource
reference to function handler already deployed separatelyI think the latter overload will be more widely used as the handler, not just the function has to exist when subscription is created. This means the code has be deployed that exposes the handler, which is often a separate from ARM step.
I have read the contributing guidelines and have completed the following:
Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure: