farmer
farmer copied to clipboard
Are rollbacks supported in any capacity?
I am using Farmer via the SAFE stack template. When I first ran the deploy target, one part of it failed because the app name I had chosen was already taken. It looked something like this:
I just changed the name and it solved the issue. But the application insights and app service plans still had been created (using the previous name) and I had to go in and delete them. I think it's preferable, if possible, to have the resources fail/rollback/be deleted if any part of the deployment fails. Is such a thing possible?
@NatElkins That's kind of an ARM thing - maybe have a look at the deployment behaviour of ARM and see if there's an option for this, if there is, we could bake that in.
I see there's something like that: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/rollback-on-error
@NatElkins we could certainly add this. In the future, we're going to probably redesign the deployment API anyway (there's already an experimental branch) and this could be part of that i.e. supply an "auto rollback" argument.
For now, we could add a simple "rollback" command which you could manually call based on the result of the call to deploy e.g.
match template |> Deploy.execute "my-rg" [] with
| Ok _ ->
"happy days!"
| Error _ ->
template |> Deploy.rollback "my-rg"
"failed - rolled back"
What do you think?