title | description | author | ms.author | ms.subservice | ms.topic | ms.custom | ms.date | |
---|---|---|---|---|---|---|---|---|
Send data to a gRPC endpoint from a pipeline |
Configure a pipeline destination stage to send the pipeline output to a gRPC endpoint for further processing with Azure IoT Data Processor. |
dominicbetts |
dobett |
data-processor |
how-to |
|
10/09/2023 |
[!INCLUDE public-preview-note]
Use the gRPC destination to write processed and clean data to a gRPC endpoint for further processing.
When you send data to a gRPC endpoint from a destination stage:
- Currently, the stage only supports the Unary RPC type.
- You can only use the Protobuf format. You must use the Protobuf with the gRPC call out stage.
- Because this stage is a pipeline destination, the response is discarded.
To configure and use a destination pipeline stage, you need:
- A deployed instance of Azure IoT Data Processor Preview that includes the optional Data Processor component.
- A gRPC server that's accessible from the Data Processor instance.
- The
protoc
tool to generate the descriptor.
The gRPC destination stage JSON configuration defines the details of the stage. To author the stage, you can either interact with the form-based UI, or provide the JSON configuration on the Advanced tab:
Name | Type | Description | Required | Default | Example |
---|---|---|---|---|---|
Name | string | A name to show in the Data Processor UI. | Yes | - | MLCall2 |
Description | string | A user-friendly description of the destination stage. | No | Call ML endpoint 2 |
|
Server address | String | The gRPC server address | Yes | - | https://localhost:1313 |
RPC name | string | The RPC name to call | Yes | - | GetInsights |
Descriptor1 | String | The base 64 encoded descriptor | Yes | - | CuIFChxnb29nb |
Authentication | string | The authentication type to use. None /Metadata . |
Yes | None |
None |
Metadata key | string | The metadata key to use when Authentication is set to Metadata . |
No | authorization |
authorization |
Secret | string | The secret reference to use when Authentication is set to Metadata . |
No | - | mysecret |
Retry | Retry | The retry policy to use. | No | default |
fixed |
API request > Body path | Path | The path to the portion of the Data Processor message that should be serialized and set as the request body. Leave empty if you don't need to send a request body. | No | - | .payload.gRPCRequest |
API request > Metadata > Key2 | Static/Dynamic field | The metadata key to set in the request. | No | Static/Dynamic field | |
API request > Metadata > Value2 | Static/Dynamic field | The metadata value to set in the request. | No | Static/Dynamic field |
1Descriptor: To serialize the request body, you need a base 64 encoded descriptor of the .proto file.
Use the following command to generate the descriptor, replace <proto-file>
with the name of your .proto file:
protoc --descriptor_set_out=/dev/stdout --include_imports <proto-file> | base64 | tr '\n' ' ' | sed 's/[[:space:]]//g'
Use the output from the previous command as the descriptor
in the configuration.
2API request > Metadata: Each element in the metadata array is a key value pair. You can set the key or value dynamically based on the content of the incoming message or as a static string.