An Azure managed PostgreSQL database service for app development and deployment.
Hi @Nguyen, Anh (CAI - Ho Chi Minh City - CON) , Hope you are doing well.
Based on the current Microsoft Fabric documentation, retries are performed at the activity level, meaning the Script activity is executed again when a retry is triggered. However, the documentation does not explicitly state whether the PostgreSQL connection is reused or whether a new database session/connection is created for each retry attempt.
From a practical standpoint, it is safest to treat each retry as a new execution of the Script activity. Because the activity is re-executed, the stored procedure may be invoked again if the previous attempt failed after execution had already started. For this reason, procedures should be designed to handle possible re-execution safely, for example by using idempotent logic or safeguards against duplicate processing.
One additional consideration is that Retry conditions (preview) are documented as being available only for specific activity types, and Script activity is not listed among the supported activity types. As a result, Script activity retries are configured using the standard retry settings and are not currently documented as supporting conditional retry behavior.
If you need to verify the exact connection behavior in your environment, the most reliable approach is to review PostgreSQL server-side logs or capture connection/session identifiers during retry attempts and compare them across executions.
I hope this helps clarify the expected retry behavior.
References:
https://learn.microsoft.com/en-us/fabric/data-factory/script-activity
Kind Regards,
Microsoft Support Team.