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

Rearrange Bicep Modules #548

Merged
merged 40 commits into from
Sep 16, 2022
Merged

Rearrange Bicep Modules #548

merged 40 commits into from
Sep 16, 2022

Conversation

jongio
Copy link
Member

@jongio jongio commented Aug 29, 2022

Fixes #543

Right now all bicep is in resource.bicep. That file is getting long and we aren't sharing common bicep files amongst the templates.

Let's break into modules and structure better for reuse.

@check-enforcer
Copy link

check-enforcer bot commented Sep 2, 2022

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override

@jongio jongio force-pushed the bicepreorg branch 2 times, most recently from 9e12996 to c1fa359 Compare September 8, 2022 17:22
Copy link
Contributor

@wbreza wbreza left a comment

Choose a reason for hiding this comment

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

This is looking really good so far. Excited for the day where we don't need to ask devs to author their own infra vs just pulling in different modules on demand from a module registry based on some azure.yaml configuration or similar.

Added some comments to consider for now or at a later stage.

Copy link
Member

@ellismg ellismg left a comment

Choose a reason for hiding this comment

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

This seems much better than what we have today, so please don't consider this feedback blocking.

I think it is worthwhile to try to remove all the uses of dependsOn in favor of threading outputs from one resource/module as inputs to another resource/module. In practice, I think this means we just take a "name" parameter for external resources a module depends and using that in our existing calls instead of "knowing" what the name of the resource is.

I also feel strongly that we should be using camelCase outputs (just like our parameters) for all of these modules we are building, and only using SCREAMING_CASE in main.bicep and other "entrypoints", since these are the outputs that are written into .env and we want SCREAMING_CASE there.

Is your longer term plan to try to move these modules into a registry and just depend on them that way, or do you think we'll be shipping the source for these modules as part of the sample repositories?

@azure-sdk
Copy link
Collaborator

Repoman Generation Results

Repoman pushed changes to remotes for the following projects:

Project: todo-csharp-cosmos-sql

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/548

View Changes | Compare Changes


Project: todo-csharp-sql

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-sql -b pr/548

View Changes | Compare Changes


Project: todo-nodejs-mongo-aca

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/548

View Changes | Compare Changes


Project: todo-nodejs-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/548

View Changes | Compare Changes


Project: todo-nodejs-mongo

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo -b pr/548

View Changes | Compare Changes


Project: todo-python-mongo-aca

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-aca -b pr/548

View Changes | Compare Changes


Project: todo-python-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/548

View Changes | Compare Changes


Project: todo-python-mongo

Remote: azure-samples-staging

Branch: pr/548

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo -b pr/548

View Changes | Compare Changes


@azure-sdk
Copy link
Collaborator

Azure Dev CLI Install Instructions

Install scripts

MacOS/Linux

May elevate using sudo on some platforms and configurations

bash:

curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548 --version '' --verbose

pwsh:

Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548' -Version '' -Verbose

Windows

powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/548' -Version '' -Verbose;"

Standalone Binary

Container

docker run -it azdevcliextacr.azurecr.io/azure-dev:pr-548

@jongio jongio merged commit fd16d99 into Azure:main Sep 16, 2022
@jongio jongio deleted the bicepreorg branch September 16, 2022 19:54
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.

Refactor template bicep into modules
5 participants