QuestionQ31

VerifiedOfficial exam objectives/topics

A Data Engineer uses a Snowpark Python User-Defined Function (UDF) that invokes a third-party fraud-scoring REST API through the requests library. The API key is not hard-coded in the handler.

The UDF is registered as a permanent function and succeeds in local testing, but it consistently encounters name-resolution and network errors when run in Snowflake. The Engineer wants to avoid placing the API key in code while keeping all processing within Snowflake.

How should these requirements be fulfilled?

Explanation

Snowflake UDF handlers need an external access integration to reach approved external endpoints. The integration combines an egress network rule for the API host with the permitted secret; the UDF must reference that integration and bind the secret through SECRETS, allowing handler code to retrieve the credential through Snowflake’s secret API. This provides controlled outbound HTTPS access without embedding the API key in code.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!