Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to automate the creation and deletion of Bastion resource.
Wrt, "Would it still be secure to write a bash/powershell script to run on the development-machine"
- This depends on your environment and what you mean by the development-machine.
- You can also use a VM that is not part of development or production.
Also, Andreas Hartig's comment seems to be the best way forward as this would neither require you to login to Portal every time nor sign in to CLI or Powershell from your machine.
You can use a CRON Job to trigger the Logic App and create/delete the Bastion resource.
Kindly let us know if the below helps or you need further assistance on this issue.
Thanks,
Kapil