CompositionalIT / farmer

Repeatable Azure deployments with ARM templates - made easy!
https://compositionalit.github.io/farmer
MIT License
527 stars 159 forks source link

Add --overwrite true to storage blob upload command #892

Closed duncanworthy closed 2 years ago

duncanworthy commented 2 years ago

This PR closes #890

The changes in this PR are as follows:

I have read the contributing guidelines and have completed the following:

If I haven't completed any of the tasks above, I include the reasons why here:

isaacabraham commented 2 years ago

@duncanworthy Thank you for this! Just to double check, the extra argument was always there, but it just wasn't on by default, right - so older versions of the CLI will still continue to work?

duncanworthy commented 2 years ago

@isaacabraham - good point! I need to do a bit more testing and code changes around that. I made an incorrect assumption from the conversation in the az cli repo. Having looked through the az cli repo history, it seems they may have added --overwrite in 2.34.0, and then made the breaking change to flip the default behaviour in v2.34.1. We'll need to include or not include that parameter based on azure CLI version.

duncanworthy commented 2 years ago

@isaacabraham I've pushed a new commit to include the CLI version check and only add the --overwrite parameter on 2.34 and above. I've tested locally to a live Azure subscription with CLI versions from before and after their change:

In order to use your existing checkVersion function I had to move it up into the Farmer.Deploy.Az module. Let me know if that's ok or if you want it done differently.

ninjarobot commented 2 years ago

@isaacabraham any remaining concerns on this one?

ninjarobot commented 2 years ago

Thank you for contributing this. It is now released in 1.6.34 and available on nuget.