December 11th, 2023

The treatFailureAsDeploymentFailure flag

Joseph Calev
Principal Software Engineer, Azure Core Compute

In both VmApplications and RunCommand, we support a property called “treatFailureAsDeploymentFailure”. Note that for Managed RunCommand it may not be visible yet in Powershell or CLI, but it is available via ARM. Note that this flag is only available for managed RunCommand. It is not available for action RunCommand. For those unaware, managed RunCommand is the newer version and should be used by default.

This flag originated in VmApplications, where the question arose “what if my application should fail to install?” Should this result in a failed deployment? In some cases yes, but in others no. The truth is we don’t know what you might want, so treatFailureAsDeploymentFailure allows you to choose during deployment. By default it’s false, meaning if you application fails to install or update, the deployment itself won’t fail. To know whether the application succeeded, you’ll need to query the instance view.

Similarly, for RunCommand a command failure won’t fail the deployment unless this flag is set. Therefore, you’ll again need to query the instance view of the VM otherwise.

Author

Joseph Calev
Principal Software Engineer, Azure Core Compute

Software Engineer Lead at Microsoft. Focusing on enabling customer scenarios for VM extensions and applications.

0 comments

Discussion are closed.