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
Copy file name to clipboardExpand all lines: README.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,22 +147,33 @@ Create two containers in the local storage emulator called `processed-pdf` and `
147
147
148
148
Now that the storage emulator is running, has files on the `unprocessed-pdf` container, and our app is running, we can execute the `process_blob_upload`functionto simulate a new blob event.
149
149
150
-
+ If you are using VS Code, Visual Studio, or other tooling that supports .http files, you can open the [`test.http`](./test.http) project file, update the port on the `localhost` URL (if needed), and then click on Send Request to call the locally running `process_blob_upload` function. This will trigger the functionto process the `Benefit_Options.pdf` file. You can update the file name in the JSON to process other PDF files.
150
+
+ If you are using VS Code, Visual Studio, or other tooling that supports .http files, you can open the [`test.http`](./test.http) project file, update the port in the `@host` variable (if needed), and then click on Send Request to call the locally running `process_blob_upload` function. This will trigger the functionto process the `PerksPlus.pdf` file by default. You can update the `@blobName` variable to process other PDF files from the data folder.
151
+
152
+
The `test.http` file uses REST Client variable syntax to make testing easier:
153
+
- `@host`: The base URL for your locally running function(default:`http://localhost:7071`)
154
+
- `@functionName`: The name of the functionto trigger (`process_blob_upload`)
155
+
- `@blobContainer`: The source blob container (`unprocessed-pdf`)
156
+
- `@blobName`: The specific blob file to process (default: `PerksPlus.pdf`)
157
+
158
+
Make sure the file specified in`@blobName` exists in the `unprocessed-pdf` container before triggering the function.
151
159
152
160
## Source Code
153
161
154
162
The functioncodeforthe `process_blob_upload` endpoint is definedin [`function_app.py`](./src/function_app.py). The functionuses the Python v2 programming model and the `@app.blob_trigger()` decorator to register the blob trigger with Event Grid source.
The `copy_to_processed_container` method uses the Azure Storage Blob SDK to upload the processed file to the destination blob container.
176
+
The functionuses Azure Functions SDKtype bindings with a `ContainerClient` input binding to upload the processed file to the destination blob container.
0 commit comments