Apply dynamic connection and role switching to embeds

Sigma customers can use the embed API to dynamically assign a Snowflake warehouse and/or role at runtime for each user. This allows you to use different levels of security (as configured in a Snowflake Role) as well as the compute tier used, based on specified Snowflake warehouse.

This topic has a moderate amount of configuration required in Snowflake.

We recommend that you review the QuickStart: Embedding 7: Dynamic Role Switching with Snowflake, which covers each step in detail.

User attributes are created in Sigma to support passing the required values at runtime to Snowflake.

For example, if we want to restrict snowflake data based on data in a column (like "Region"), that User Attribute configuration in Sigma might look like this:

User Attribute configuration example

User Attribute configuration example for "DRS_Warehouse"

Once User Attributes have been created, we can apply them to in the Snowflake connection in Sigma:

Warehouse and Role set to use User Attributes

Warehouse and Role set to use User Attributes

Embed API Configuration

NOTE: For example, these parameters would be added in "section 6" of the sample embed API code for ease of viewing


// NOTE: UA values are case sensitive. Multiple values can be separated by a comma. 
searchParams += '&:DRS_ROLE=DRS_WEST';
searchParams += '&:DRS_Warehouse=COMPUTE_WH';

πŸ“˜

User attributes are case sensitive.