You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 11, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ products:
18
18
This sample will show you how to create Terraform scripts that create an Azure Function and Subscribe it to Event Grid Storage events.
19
19
This is especially interesting as, for Event Grid Subscriptions, the target endpoint must answer EG's "[Subscription Validation Event](https://docs.microsoft.com/en-us/azure/event-grid/security-authentication#validation-details)" which it cannot do until it is deployed. So this method - affectionally coined a "Terraform Sandwich" - shows how to do just that.
20
20
21
-
## Running the sample locally
21
+
## Deploying locally
22
22
1. Open the repo in its VS Code Dev Container (this ensures you have all the right versions of the necessary tooling)
23
23
1. run `az login` and `az account set --subscription <target subscription id>` to connect to your Azure Subscription
24
24
1.`cd infrastructure/terraform`
@@ -34,8 +34,28 @@ This is especially interesting as, for Event Grid Subscriptions, the target endp
34
34
- Deploys the function app out to Azure so it's ready to answer the subscription wire-up that Terraform will do next
35
35
- Tells terraform to apply **everything**, which issues the necessary changes to Azure to add the event grid subscription to an 'inbox' storage account
36
36
37
-
## Running the sample via Azure DevOps
37
+
## Deploying via Azure DevOps
38
38
By importing the [azure-piplines.yaml](./azure-pipelines.yaml) file in to an Azure DevOps pipeline, you'll get the same process as the above local execution.
39
-
> Note: Be sure to change [the `PREFIX` variable](./azure-pipelines.yml#L14) to something unique to you to avoid naming collisions on storage & function apps
39
+
> Note: Be sure to uncomment change [the `PREFIX` variable](./azure-pipelines.yml#L10) to something unique to you to avoid naming collisions on storage & function apps
This sample has an Azure Function that subscribes to Blob Storage Events and then simply passes the event on to a custom Event Grid Topic. The receiving and sending of events is accomplished via the Event Grid Binding for Azure Functions.
45
+
46
+
To exercise the sample:
47
+
1. Open the 'inbox' storage account created by the deployment
48
+
1. Create a new container
49
+
1. Upload a file in to the container
50
+
51
+
Next, go to the Azure Portal, and the Storage Account created by the deployment. Click the 'Events' area and you will see one or more events have come through:
Finally, if you wish to see the output from the Function, go to the Application Insights resource created by deployment and look through the logged TRACE events:
0 commit comments