-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute local scripts as a part of bicep deployment #7259
Comments
Note that such a feature might also require something similar to a null_resource. |
Duplicate of #417, but going to close that one as this is a bit more detailed |
+1 |
It seems it'll take more time - has anyone found workaround for this? I'm converting Terraform to Bicep and this is one big missing part |
Just for context, Bicep/ARM Template deployments are evaluated service-side today, so there is no physical way to do something like TF's In the meantime, the only workaround is either to break your deployment into different parts and run your scripts locally in between deployments, or you can use a |
@alex-frankel - thanks for providing some workarounds. |
I would follow #6540 for any updates. We have been working on adding support for it recently, so I'm hoping we have an update in the next 2-3 months. |
Any updates on this? |
@cw-andrews - in the short term, we don't have a way to enable this because Bicep/ARM Templates are evaluated service side. See: #7259 (comment) |
Hi stewartadam, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! 😄 🦾 |
/reopen |
What is the author feedback required? |
I think that label was stale. Thanks for bumping the thread. |
+1 use-case -> trying to provide devs a single |
@stewartadam I wonder if this will be satisfied by #14243. The spec doesn't seem to be publicly released as yet so I'm not sure what the goal/implementation is, but looks very interesting! One of my questions for local-deploy is are you going to have to choose between normal server-side deploy at run time? Basically, will you have to create specific local templates? |
Is your feature request related to a problem? Please describe.
I would like to be able to execute scripts on the host triggering a deployment as a part of the deployment sequence. Complex deployments usually have some portions of infra that depends other infra + some data plant configuration, so some 'glue' scripts that interact with dataplanes or manipulate local data are required in order to facilitate the subsequent infrastructure steps.
While these steps can be facilitated by breaking Bicep into several stages, it requires creating multiple stages of Bicep templates with outputs (or key vault secrets), mapping those to variables in the shell scripts, and then running the shell scripts in between each Bicep stage -- that's a lot of boilerplate and fragmentation for consuming the data outputs that are immediately and readily available within the bicep templates.
Say you go ahead and do that, then you run into a bunch semi-related and frustrating issues like:
Tangent: And even if you work around/solve all that, you might be tempted to use a common parameters file to ensure existing resources from prior stages can be referenced exactly without having to declare a parameter file for each bicep stage and risk making a typo - except that cannot be done because parameters must exactly match the bicep file - the parameters file cannot contain extraneous parameters that are not declared in a bicep file. So at this point you look loading JSON but it seems insane to completely circumvent the native parameter functionality.
Terraform handles this neatly with local-exec to provide script execution inline with IaC declarations and to be able to consume available resource properties directly. Some use cases I've bumped into in the past that local-exec helped with:
Describe the solution you'd like
I'd like a resource type that executes a local script similar to local-exec:
The text was updated successfully, but these errors were encountered: