@@ -74,6 +74,9 @@ def set_up_external_access_integration_resources(
7474 integration1 ,
7575 integration2 ,
7676 integration3 ,
77+ key4 ,
78+ integration4 ,
79+ wif_audience ,
7780):
7881 try :
7982 # IMPORTANT SETUP NOTES: the test role needs to be granted the creation privilege
@@ -128,6 +131,12 @@ def set_up_external_access_integration_resources(
128131 ).collect ()
129132 session .sql (
130133 f"""
134+ CREATE SECRET IF NOT EXISTS { key4 }
135+ TYPE = WORKLOAD_IDENTITY_FEDERATION;
136+ """
137+ ).collect ()
138+ session .sql (
139+ f"""
131140 CREATE IF NOT EXISTS EXTERNAL ACCESS INTEGRATION { integration1 }
132141 ALLOWED_NETWORK_RULES = ({ rule1 } )
133142 ALLOWED_AUTHENTICATION_SECRETS = ({ key1 } )
@@ -148,6 +157,14 @@ def set_up_external_access_integration_resources(
148157 ALLOWED_NETWORK_RULES = ({ rule3 } )
149158 ALLOWED_AUTHENTICATION_SECRETS = ({ key3 } )
150159 ENABLED = true;
160+ """
161+ ).collect ()
162+ session .sql (
163+ f"""
164+ CREATE EXTERNAL ACCESS INTEGRATION IF NOT EXISTS { integration4 }
165+ ALLOWED_NETWORK_RULES = ({ rule1 } )
166+ ALLOWED_AUTHENTICATION_SECRETS = ({ key4 } )
167+ ENABLED = true;
151168 """
152169 ).collect ()
153170 CONNECTION_PARAMETERS ["external_access_rule1" ] = rule1
@@ -156,9 +173,12 @@ def set_up_external_access_integration_resources(
156173 CONNECTION_PARAMETERS ["external_access_key1" ] = key1
157174 CONNECTION_PARAMETERS ["external_access_key2" ] = key2
158175 CONNECTION_PARAMETERS ["external_access_key3" ] = key3
176+ CONNECTION_PARAMETERS ["external_access_key4" ] = key4
159177 CONNECTION_PARAMETERS ["external_access_integration1" ] = integration1
160178 CONNECTION_PARAMETERS ["external_access_integration2" ] = integration2
161179 CONNECTION_PARAMETERS ["external_access_integration3" ] = integration3
180+ CONNECTION_PARAMETERS ["external_access_integration4" ] = integration4
181+ CONNECTION_PARAMETERS ["wif_audience" ] = wif_audience
162182 except SnowparkSQLException :
163183 # GCP currently does not support external access integration
164184 # we can remove the exception once the integration is available on GCP
@@ -184,9 +204,12 @@ def clean_up_external_access_integration_resources():
184204 CONNECTION_PARAMETERS .pop ("external_access_key1" , None )
185205 CONNECTION_PARAMETERS .pop ("external_access_key2" , None )
186206 CONNECTION_PARAMETERS .pop ("external_access_key3" , None )
207+ CONNECTION_PARAMETERS .pop ("external_access_key4" , None )
187208 CONNECTION_PARAMETERS .pop ("external_access_integration1" , None )
188209 CONNECTION_PARAMETERS .pop ("external_access_integration2" , None )
189210 CONNECTION_PARAMETERS .pop ("external_access_integration3" , None )
211+ CONNECTION_PARAMETERS .pop ("external_access_integration4" , None )
212+ CONNECTION_PARAMETERS .pop ("wif_audience" , None )
190213
191214
192215def set_up_dataframe_processor_parameters (
@@ -315,9 +338,12 @@ def session(
315338 key1 = "snowpark_python_test_key1"
316339 key2 = "snowpark_python_test_key2"
317340 key3 = "snowpark_python_test_key3"
341+ key4 = "snowpark_python_test_key4"
318342 integration1 = "snowpark_python_test_integration1"
319343 integration2 = "snowpark_python_test_integration2"
320344 integration3 = "snowpark_python_test_integration3"
345+ integration4 = "snowpark_python_test_integration4"
346+ wif_audience = "https://replace-with-your-wif-audience"
321347
322348 session = (
323349 Session .builder .configs (db_parameters )
@@ -351,6 +377,9 @@ def session(
351377 integration1 ,
352378 integration2 ,
353379 integration3 ,
380+ key4 ,
381+ integration4 ,
382+ wif_audience ,
354383 )
355384
356385 if validate_ast :
@@ -387,9 +416,12 @@ def profiler_session(
387416 key1 = "snowpark_python_profiler_test_key1"
388417 key2 = "snowpark_python_profiler_test_key2"
389418 key3 = "snowpark_python_profiler_test_key3"
419+ key4 = "snowpark_python_profiler_test_key4"
390420 integration1 = "snowpark_python_profiler_test_integration1"
391421 integration2 = "snowpark_python_profiler_test_integration2"
392422 integration3 = "snowpark_python_profiler_test_integration3"
423+ integration4 = "snowpark_python_profiler_test_integration4"
424+ wif_audience = "https://replace-with-your-wif-audience"
393425 session = (
394426 Session .builder .configs (db_parameters )
395427 .config ("local_testing" , local_testing_mode )
@@ -409,6 +441,9 @@ def profiler_session(
409441 integration1 ,
410442 integration2 ,
411443 integration3 ,
444+ key4 ,
445+ integration4 ,
446+ wif_audience ,
412447 )
413448 set_up_test_session_parameters (session , local_testing_mode )
414449 try :
0 commit comments