Skip to content

Commit b160615

Browse files
authored
Merge pull request #105358 from mumian/0221-ds-error-action
add erroractionpreference
2 parents 0cc3192 + 89c5bcc commit b160615

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

articles/azure-resource-manager/templates/deployment-script-template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ Deployment script outputs must be saved in the AZ_SCRIPTS_OUTPUT_PATH location,
208208

209209
[jq](https://stedolan.github.io/jq/) is used in the previous sample. It comes with the container images. See [Configure development environment](#configure-development-environment).
210210

211+
## Handle non-terminating errors
212+
213+
You can control how PowerShell responds to non-terminating errors by using the [**$ErrorActionPreference**](/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7#erroractionpreference
214+
) variable in your deployment script. The deployment script engine doesn't set/change the value. Despite the value you set for $ErrorActionPreference, deployment script sets the resource provisioning state to *Failed* when the script encounters an error.
215+
216+
211217
## Debug deployment scripts
212218

213219
The script service creates a [storage account](../../storage/common/storage-account-overview.md) and a [container instance](../../container-instances/container-instances-overview.md) for script execution. Both resources have the **azscripts** suffix in the resource names.

0 commit comments

Comments
 (0)