@@ -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,13 @@ 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 IF NOT EXISTS EXTERNAL ACCESS INTEGRATION { integration4 }
165+ ALLOWED_AUTHENTICATION_SECRETS = ({ key4 } )
166+ ENABLED = true;
151167 """
152168 ).collect ()
153169 CONNECTION_PARAMETERS ["external_access_rule1" ] = rule1
@@ -156,9 +172,12 @@ def set_up_external_access_integration_resources(
156172 CONNECTION_PARAMETERS ["external_access_key1" ] = key1
157173 CONNECTION_PARAMETERS ["external_access_key2" ] = key2
158174 CONNECTION_PARAMETERS ["external_access_key3" ] = key3
175+ CONNECTION_PARAMETERS ["external_access_key4" ] = key4
159176 CONNECTION_PARAMETERS ["external_access_integration1" ] = integration1
160177 CONNECTION_PARAMETERS ["external_access_integration2" ] = integration2
161178 CONNECTION_PARAMETERS ["external_access_integration3" ] = integration3
179+ CONNECTION_PARAMETERS ["external_access_integration4" ] = integration4
180+ CONNECTION_PARAMETERS ["wif_audience" ] = wif_audience
162181 except SnowparkSQLException :
163182 # GCP currently does not support external access integration
164183 # we can remove the exception once the integration is available on GCP
@@ -184,9 +203,12 @@ def clean_up_external_access_integration_resources():
184203 CONNECTION_PARAMETERS .pop ("external_access_key1" , None )
185204 CONNECTION_PARAMETERS .pop ("external_access_key2" , None )
186205 CONNECTION_PARAMETERS .pop ("external_access_key3" , None )
206+ CONNECTION_PARAMETERS .pop ("external_access_key4" , None )
187207 CONNECTION_PARAMETERS .pop ("external_access_integration1" , None )
188208 CONNECTION_PARAMETERS .pop ("external_access_integration2" , None )
189209 CONNECTION_PARAMETERS .pop ("external_access_integration3" , None )
210+ CONNECTION_PARAMETERS .pop ("external_access_integration4" , None )
211+ CONNECTION_PARAMETERS .pop ("wif_audience" , None )
190212
191213
192214def set_up_dataframe_processor_parameters (
@@ -315,9 +337,12 @@ def session(
315337 key1 = "snowpark_python_test_key1"
316338 key2 = "snowpark_python_test_key2"
317339 key3 = "snowpark_python_test_key3"
340+ key4 = "snowpark_python_test_key4"
318341 integration1 = "snowpark_python_test_integration1"
319342 integration2 = "snowpark_python_test_integration2"
320343 integration3 = "snowpark_python_test_integration3"
344+ integration4 = "snowpark_python_test_integration4"
345+ wif_audience = "https://replace-with-your-wif-audience"
321346
322347 session = (
323348 Session .builder .configs (db_parameters )
@@ -351,6 +376,9 @@ def session(
351376 integration1 ,
352377 integration2 ,
353378 integration3 ,
379+ key4 ,
380+ integration4 ,
381+ wif_audience ,
354382 )
355383
356384 if validate_ast :
@@ -387,9 +415,12 @@ def profiler_session(
387415 key1 = "snowpark_python_profiler_test_key1"
388416 key2 = "snowpark_python_profiler_test_key2"
389417 key3 = "snowpark_python_profiler_test_key3"
418+ key4 = "snowpark_python_profiler_test_key4"
390419 integration1 = "snowpark_python_profiler_test_integration1"
391420 integration2 = "snowpark_python_profiler_test_integration2"
392421 integration3 = "snowpark_python_profiler_test_integration3"
422+ integration4 = "snowpark_python_profiler_test_integration4"
423+ wif_audience = "https://replace-with-your-wif-audience"
393424 session = (
394425 Session .builder .configs (db_parameters )
395426 .config ("local_testing" , local_testing_mode )
@@ -409,6 +440,9 @@ def profiler_session(
409440 integration1 ,
410441 integration2 ,
411442 integration3 ,
443+ key4 ,
444+ integration4 ,
445+ wif_audience ,
412446 )
413447 set_up_test_session_parameters (session , local_testing_mode )
414448 try :
0 commit comments