Skip to content
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

Create Extendable Bicep Params File Article #14865

Merged
merged 7 commits into from
Aug 26, 2024

Conversation

stephaniezyen
Copy link
Contributor

@stephaniezyen stephaniezyen commented Aug 20, 2024

Added an article on using extendable bicep param files, as well as limitations.

Updated the experimental features page to link to this article too.

Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

github-actions bot commented Aug 20, 2024

Test this change out locally with the following install scripts (Action run 10566240211)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 10566240211
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 10566240211"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 10566240211
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 10566240211"

Copy link
Contributor

github-actions bot commented Aug 20, 2024

Dotnet Test Results

    72 files   -     36      72 suites   - 36   23m 12s ⏱️ - 10m 27s
11 043 tests  -     20  11 043 ✅  -     20  0 💤 ±0  0 ❌ ±0 
25 862 runs   - 12 927  25 862 ✅  - 12 927  0 💤 ±0  0 ❌ ±0 

Results for commit 3d14495. ± Comparison against base commit e42fbe6.

♻️ This comment has been updated with latest results.

## What is it?
Extendable Bicep Parameter Files is a feature that allows you to extend `.bicepparam` files from another `.bicepparam` file in order to reuse parameters across multiple deployments.

When using extendable bicep parameter files, you will have a `base.bicepparam` file that can be used by multiple `.bicep` and `.bicepparam` files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When using extendable bicep parameter files, you will have a `base.bicepparam` file that can be used by multiple `.bicep` and `.bicepparam` files.
When using extendable bicep parameter files, you will have a `bicepparam` file (for example, `base.bicepparam`, `common.bicepparam`, etc.) that can be used by multiple `.bicep` and `.bicepparam` files.

docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@alex-frankel alex-frankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing this up! Have a few points of feedback that we should address before merging.

docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@alex-frankel alex-frankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress! Have a few new comments on the updates as well as some things I missed in the first pass.

docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved

* variables: we will not have variable support in the `root.bicepparam` file to be able to read and override values in other files
```bicep
var namePrefix = 'share'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little odd to have such specific code samples for features that don't work. I think it's ok just to describe the limitation in words.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Anthony had requested I add an explanation and example for each of these bullet points - I'll follow up with him to see if this is what he is looking for or if just a quick description is good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anthony said the examples should be helpful for users - would you be okay if I kept them in?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - fine with me

docs/experimental/extendable-param-files.md Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
docs/experimental/extendable-param-files.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@alex-frankel alex-frankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few last comments. Apologies about all the back and forth. It is pretty much good to go.

docs/experimental/extendable-param-files.md Show resolved Hide resolved
docs/experimental/extendable-param-files.md Show resolved Hide resolved

`main.bicep` This is your main bicep file, which will define your parameters for deployment.

```bicep
param namePrefix string
param location string
param symbolicName string
param tag string
```

`root.bicepparam` This is your main bicepparam file, which can be reused by multiple extended .bicepparam files and in multiple deployments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am the only one, but to me root.bicepparam file is the one being extended, not leaf.bicepparam. So when we say "can be reused by multiple extended .bicepparam files", I get confused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the way I see it is that the root connects to multiple leaves - so the root can be reused multiple times into several different leaf files, which I think is also how Engin views it - should we ask the team?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I'm the only one with this perspective, it's fine to leave it as is

Copy link
Collaborator

@alex-frankel alex-frankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this done! Looks great.


* variables: we will not have variable support in the `root.bicepparam` file to be able to read and override values in other files
```bicep
var namePrefix = 'share'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - fine with me


`main.bicep` This is your main bicep file, which will define your parameters for deployment.

```bicep
param namePrefix string
param location string
param symbolicName string
param tag string
```

`root.bicepparam` This is your main bicepparam file, which can be reused by multiple extended .bicepparam files and in multiple deployments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I'm the only one with this perspective, it's fine to leave it as is

@stephaniezyen stephaniezyen merged commit c5b9546 into main Aug 26, 2024
47 checks passed
@stephaniezyen stephaniezyen deleted the stephy/extendableparamsdoc branch August 26, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants