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

Update bicep references #1149

Merged
merged 41 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ddbc0ab
Update docs for v0.35.0
rad-ci-bot Jun 21, 2024
29491e6
Bump braces from 3.0.2 to 3.0.3 in /docs (#1132)
dependabot[bot] Jun 25, 2024
874acd6
update bicep references
sk593 Jul 12, 2024
df21e6f
update validate bicep
sk593 Jul 16, 2024
77cfc25
update docs
sk593 Jul 23, 2024
9ecd17f
addressing comments
sk593 Jul 25, 2024
bf3761e
update validate bicep script
sk593 Jul 25, 2024
8a0c387
addressing comments
sk593 Jul 30, 2024
58217b3
nit
sk593 Jul 30, 2024
39d19f1
fix
sk593 Jul 30, 2024
ea008ec
update ref
sk593 Jul 31, 2024
9ba1f04
nit
sk593 Jul 31, 2024
95d8ede
Update docs/content/guides/tooling/bicepconfig/overview/index.md
sk593 Aug 7, 2024
462f748
Update docs/content/guides/tooling/bicepconfig/overview/index.md
sk593 Aug 7, 2024
664052f
Update docs/content/guides/tooling/bicepconfig/overview/index.md
sk593 Aug 7, 2024
e75a143
Update docs/content/guides/tooling/bicepconfig/overview/index.md
sk593 Aug 7, 2024
d5ee815
Update docs/content/guides/tooling/bicepconfig/overview/index.md
sk593 Aug 7, 2024
b38dfa8
Update docs/content/guides/tooling/bicepconfig/overview/index.md
sk593 Aug 7, 2024
897aa7f
Update docs/shared-content/installation/vscode-bicep/install-vscode-b…
sk593 Aug 7, 2024
4f922c3
Update docs/content/guides/tooling/vscode/overview/index.md
sk593 Aug 7, 2024
80f6ed1
Update docs/shared-content/installation/vscode-bicep/install-vscode-b…
sk593 Aug 7, 2024
5254c2c
Update docs/content/guides/tooling/bicepconfig/overview/index.md
sk593 Aug 7, 2024
c5ef3c7
addressing comments
sk593 Aug 13, 2024
a89a9fa
update spelling
sk593 Aug 13, 2024
49a26fa
update comments
sk593 Aug 13, 2024
d4c70eb
Update docs/content/getting-started/index.md
sk593 Aug 13, 2024
c488844
update comments
sk593 Aug 13, 2024
af02a73
update comments
sk593 Aug 13, 2024
d195dc8
Update bicepconfig page
Reshrahim Aug 14, 2024
1747c9b
reNAME rADIUS-TYPES
Reshrahim Aug 14, 2024
e6ba4ac
Apply suggestions from code review
Reshrahim Aug 14, 2024
7fd2749
Update docs/content/guides/tooling/vscode/overview/index.md
sk593 Aug 14, 2024
35187d9
Update docs/shared-content/installation/vscode-bicep/install-vscode-b…
sk593 Aug 14, 2024
830bebc
Update docs/content/guides/tooling/vscode/overview/index.md
sk593 Aug 14, 2024
6211925
remove package lock
sk593 Aug 14, 2024
495b3ae
nit
sk593 Aug 14, 2024
294216b
Update docs/content/guides/tooling/bicepconfig/overview/index.md
Reshrahim Aug 14, 2024
8560b7a
Update docs/content/guides/tooling/bicepconfig/overview/index.md
Reshrahim Aug 14, 2024
444fa75
nit
sk593 Aug 14, 2024
376db0f
update imports
sk593 Aug 14, 2024
c621af6
Merge branch 'edge' into update-bicep-docs
Reshrahim Aug 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/config/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,10 @@ postgresenvSecrets
RecipeConfigPropertiesEnvSecrets
SecretReference
ProviderConfigPropertiesSecrets
upstreamed
irsa
bicepconfig
Bicepconfig
postgres
ReadOnly
DeployTimeConstant
5 changes: 5 additions & 0 deletions .github/scripts/validate_bicep.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def validate_file(f):
)
stderr = result.stderr.decode("utf-8")
exitcode = result.returncode

warning_prefix = "WARNING: The following experimental Bicep features"
if stderr.startswith(warning_prefix) and "Error" not in stderr:
stderr = ""
exitcode = 0

if exitcode != 0:
failures.append(f)
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/validate-bicep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ on:
branches:
- edge
- v*
push:
branches:
- edge
- v*
jobs:
build:
name: Validate Bicep Code
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Parse release version and set environment variables
run: python ./.github/scripts/get_docs_version.py
- name: Download rad-bicep
- name: Setup and verify bicep CLI
run: |
oras pull ghcr.io/radius-project/radius/bicep/rad-bicep/linux-x64:latest
chmod +x rad-bicep
curl -Lo rad-bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
chmod +x ./rad-bicep
./rad-bicep --version
- name: Check out repo
uses: actions/checkout@v4
- name: Verify Bicep files
run: python ./.github/scripts/validate_bicep.py
12 changes: 12 additions & 0 deletions bicepconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// The bicepconfig.json file is needed so the bicep files in the repo can be compiled with the correct setup
{
"experimentalFeaturesEnabled": {
"extensibility": true,
"extensionRegistry": true,
"dynamicTypeLoading": true
},
"extensions": {
"radius": "br:biceptypes.azurecr.io/radius:latest",
"aws": "br:biceptypes.azurecr.io/aws:latest"
}
}
2 changes: 1 addition & 1 deletion docs/content/concepts/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Teams looking to leverage existing Helm charts can use the [Radius annotations a

Similar to how you can define Azure resources in Bicep, you can define Radius resources in Bicep.

Radius currently uses a temporary fork of Bicep to add support for the Radius resources, but work is underway to merge extensibility support into the main Bicep repo and eliminate the need for a fork.
Radius uses Bicep to add support for Radius resources. We previously used a temporary fork of Bicep, but have since deprecated it in favor of the main Bicep repo.

Teams building or migrating applications on Radius can use Bicep to model their application and deploy to Kubernetes today, as well as future platforms, including serverless platforms.

Expand Down
1 change: 0 additions & 1 deletion docs/content/contributing/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ Check out the following table to learn where and how you can contribute:
| **Radius** | Main repository that contains source code for [`rad` CLI](https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-cli/README.md), [control plane](https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/README.md) and other components of Radius | [radius-project/radius](https://github.com/radius-project/radius/blob/main/CONTRIBUTING.md)|
| **Recipes** | Commonly used [Recipe]({{< ref "guides/recipes/overview">}}) templates for Radius Environments | [radius-project/recipes](https://github.com/radius-project/recipes/blob/main/CONTRIBUTING.md) |
| **Dashboard** | The frontend experience for Radius |[radius-project/dashboard](https://github.com/radius-project/dashboard/blob/main/CONTRIBUTING.md) |
| **Bicep** | Temporary fork of the [Bicep repo](https://github.com/azure/bicep) used to inject the Radius types into the Bicep language. Contains both the Bicep CLI and the Bicep VS Code extension. | [radius-project/bicep](https://github.com/radius-project/bicep/blob/radius-compiler/CONTRIBUTING.md) |
2 changes: 1 addition & 1 deletion docs/content/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Initializing Radius...
Initialization complete! Have a RAD time 😎
```

In addition to starting Radius services in your Kubernetes cluster, this initialization command creates a default application (`app.bicep`) as your starting point. It contains a single container definition (`demo`).
In addition to starting Radius services in your Kubernetes cluster, this initialization command creates a default application (`app.bicep`) as your starting point. It contains a single container definition (`demo`). `rad init` also creates a [`bicepconfig.json`]({{< ref "/guides/tooling/bicepconfig/overview" >}}) file in your application's directory that has the necessary setup to use Radius with the official Bicep compiler.

{{< rad file="snippets/app.bicep" embed=true markdownConfig="{linenos=table,linenostart=1}" >}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Import the set of Radius resources (Applications.*) into Bicep
import radius as radius
extension radius

@description('The app ID of your Radius Application. Set automatically by the rad CLI.')
param application string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Import the set of Radius resources (Applications.*) into Bicep
import radius as radius
extension radius

@description('The app ID of your Radius Application. Set automatically by the rad CLI.')
param application string
Expand Down
2 changes: 1 addition & 1 deletion docs/content/getting-started/snippets/app.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Import the set of Radius resources (Applications.*) into Bicep
import radius as radius
extension radius

@description('The app ID of your Radius Application. Set automatically by the rad CLI.')
param application string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import radius as radius
extension radius

@description('The environment ID of your Radius Application. Set automatically by the rad CLI.')
param environment string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This how-to guide will show you:
- [eksctl CLI](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html)
- [kubectl CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}})
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-radius-bicep-extension" >}})
- [Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})

## Step 1: Create an EKS Cluster

Expand Down Expand Up @@ -52,15 +52,23 @@ Follow the prompts to install the [control plane services]({{< ref "/concepts/te
- **Add AWS provider** - An [AWS cloud provider]({{< ref "/guides/operations/providers/aws-provider" >}}) allows you to deploy and manage AWS resources as part of your application. Follow the how-to guides to [configure the AWS provider]({{< ref "/guides/operations/providers/aws-provider/howto-aws-provider" >}}) with the preferred identity.
- **Environment name** - The name of the environment to create. You can specify any name with lowercase letters, such as `myawsenv`.

## Step 3: Create a Bicep file to model AWS Simple Storage Service (S3)
Select 'No' when asked to setup application in the current directory.

## Step 3: Create a `bicepconfig.json` in your application's directory
Reshrahim marked this conversation as resolved.
Show resolved Hide resolved

{{< read file= "/shared-content/installation/bicepconfig/manual.md" >}}

More information on how to setup a `bicepconfig.json` can be found [here]({{< ref "/guides/tooling/bicepconfig/overview" >}})

## Step 4: Create a Bicep file to model AWS Simple Storage Service (S3)

Create a new file called `app.bicep` and add the following bicep code to model an AWS S3 Bucket:

{{< rad file="snippets/s3.bicep" embed=true >}}

Radius uses the [AWS Cloud Control API](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/what-is-cloudcontrolapi.html) to interact with AWS resources. This means that you can model your AWS resources in Bicep and Radius will be able to deploy and manage them. You can find the list of supported AWS resources in the [AWS resource library]({{< ref "guides/author-apps/aws/overview#resource-library" >}}).

## Step 4: Add a Radius container to interact with the AWS S3 Bucket
## Step 5: Add a Radius container to interact with the AWS S3 Bucket

Open the `app.bicep` and append the following Radius resources:

Expand All @@ -72,7 +80,7 @@ Your final `app.bicep` file should look like this

This creates a container that will be deployed to your Kubernetes cluster. This container will interact with the AWS S3 Bucket you created in the previous step.

## Step 5: Deploy the application
## Step 6: Deploy the application

1. Deploy your application to your environment:

Expand All @@ -95,7 +103,7 @@ This creates a container that will be deployed to your Kubernetes cluster. This

{{< image src="s3app.png" alt="Screenshot of the sample application to interact with s3 bucket " width=900 >}}

## Step 6: Cleanup
## Step 7: Cleanup

1. When you're done with testing, you can use the rad CLI to [delete an environment]({{< ref rad_env_delete.md >}}) to delete all Radius resources running on the EKS Cluster.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import aws as aws
extension aws

import radius as radius
extension radius

@description('The name of your S3 bucket.The AWS S3 Bucket name must follow the [following naming conventions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html).')
param bucket string ='mys3bucket'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aws as aws
extension aws

@description('The name of your S3 bucket.The AWS S3 Bucket name must follow the naming conventions described at https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html')
param bucket string ='mys3bucket-${uniqueString(resourceGroup().id)}'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import aws as aws
extension aws

import radius as radius
extension radius

@description('The name of your S3 bucket.The AWS S3 Bucket name must follow the [following naming conventions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html).')
param bucket string ='mys3bucket'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import aws as aws
extension aws

import radius as radius
extension radius

param environment string

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The steps below will showcase a "rad-ified" version of the existing [Azure AD wo
## Prerequisites

- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}})
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Setup a supported Kubernetes cluster]({{< ref "/guides/operations/kubernetes/overview#supported-clusters" >}})
- [Azure AD Workload Identity](https://azure.github.io/azure-workload-identity/docs/installation.html) installed in your cluster, including the [Mutating Admission Webhook](https://azure.github.io/azure-workload-identity/docs/installation/mutating-admission-webhook.html)

Expand All @@ -32,27 +32,35 @@ Begin by running [`rad init --full`]({{< ref rad_init >}}). Make sure to configu
rad init --full
```

## Step 2: Define a Radius Environment
Select 'No' when asked to setup application in the current directory.

## Step 2: Create a `bicepconfig.json` in your application's directory

{{< read file= "/shared-content/installation/bicepconfig/manual.md" >}}

More information on how to setup a `bicepconfig.json` can be found [here]({{< ref "/guides/tooling/bicepconfig/overview" >}})

## Step 3: Define a Radius Environment
Reshrahim marked this conversation as resolved.
Show resolved Hide resolved

Create a file named `app.bicep` and define a Radius Environment with [identity property]({{< ref "/guides/deploy-apps/environments/overview" >}}) set. This configures your environment to use your Azure AD workload identity installation with your cluster's OIDC endpoint:

{{< rad file="snippets/container-wi.bicep" embed=true marker="//ENVIRONMENT">}}

## Step 3: Define an app and a container
## Step 4: Define an app and a container

Add a Radius Application, a Radius [container]({{< ref "guides/author-apps/containers" >}}), and an Azure Key Vault to your `app.bicep` file. Note the connection from the container to the Key Vault, with an iam property set for the Azure AD RBAC role:

{{< rad file="snippets/container-wi.bicep" embed=true marker="//CONTAINER" >}}

## Step 4: Deploy the app and container
## Step 5: Deploy the app and container

Deploy your app by specifying the OIDC issuer URL. To retrieve the OIDC issuer URL, follow the [Azure Workload Identity installation guide](https://azure.github.io/azure-workload-identity/docs/installation.html).

```bash
rad deploy ./app.bicep -p oidcIssuer=<OIDC_ISSUER_URL>
```

## Step 5: Verify access to the Key Vault
## Step 6: Verify access to the Key Vault

1. Once deployment completes, read the logs from your running container resource:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//ENVIRONMENT
import radius as radius
extension radius

@description('The Azure region to deploy Azure resource(s) into. Defaults to the region of the target Azure resource group.')
param azLocation string = resourceGroup().location
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import radius as radius
extension radius

param environment string

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This how-to guide will teach how to connect to your dependencies via [connection
## Prerequisites

- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}})
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Radius environment]({{< ref "installation#step-3-initialize-radius" >}})

## Step 1: View the container definition
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Import the set of Radius resources (Applications.*) into Bicep
import radius as radius
extension radius

@description('The app ID of your Radius Application. Set automatically by the rad CLI.')
param application string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import radius as rad
extension radius

@description('The app ID of your Radius application. Set automatically by the rad CLI.')
param application string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This how-to guide will provide an overview of how to:
## Prerequisites

- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}})
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Supported Kubernetes cluster]({{< ref "guides/operations/kubernetes" >}})
- [Azure AD Workload Identity](https://azure.github.io/azure-workload-identity/docs/installation.html) installed on your cluster
- [Azure Keyvault Provider](https://azure.github.io/secrets-store-csi-driver-provider-azure/docs/getting-started/installation/)
Expand All @@ -33,33 +33,41 @@ Begin by running [`rad init --full`]({{< ref rad_init >}}). Make sure to configu
rad init --full
```

## Step 2: Define a Radius Environment
Select 'No' when asked to setup application in the current directory.

## Step 2: Create a `bicepconfig.json` in your application's directory

{{< read file= "/shared-content/installation/bicepconfig/manual.md" >}}

More information on how to setup a `bicepconfig.json` can be found [here]({{< ref "/guides/tooling/bicepconfig/overview" >}})

## Step 3: Define a Radius Environment

Create a file named `app.bicep` and define a Radius Environment with the identity property set:

{{< rad file="snippets/keyvault-wi.bicep" embed=true marker="//ENVIRONMENT">}}

## Step 3: Define an app, Key Vault, and volume
## Step 4: Define an app, Key Vault, and volume

Add a Radius Application, an Azure Key Vault, and a Radius volume which uses the Key Vault to your `app.bicep` file:

{{< rad file="snippets/keyvault-wi.bicep" embed=true marker="//APP" >}}

## Step 4: Define an app, Key Vault, and volume
## Step 5: Define an app, Key Vault, and volume

Now add a Radius [container]({{< ref "guides/author-apps/containers" >}}) with a volume mount for the Radius volume:

{{< rad file="snippets/keyvault-wi.bicep" embed=true marker="//CONTAINER" >}}

## Step 5: Deploy the app
## Step 6: Deploy the app

Deploy your app, specifying the OIDC issuer URL. To retrieve the OIDC issuer URL, follow the [Azure Workload Identity installation guide](https://azure.github.io/azure-workload-identity/docs/installation.html).

```bash
rad deploy ./app.bicep -p oidcIssuer=<OIDC_ISSUER_URL>
```

## Step 5: Verify access to the mounted Azure Key Vault
## Step 7: Verify access to the mounted Azure Key Vault

1. Once deployment completes, read the logs from your running container resource:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//ENVIRONMENT
import radius as rad
extension radius

@description('The Azure region to deploy Azure resource(s) into. Defaults to the region of the target Azure resource group.')
param azLocation string = resourceGroup().location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This how-to guide will provide an overview of how to:
## Prerequisites

- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}})
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Radius environment]({{< ref "installation#step-3-initialize-radius" >}})

## Step 1: Define an app and a container
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import radius as rad
extension radius

param environment string

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import radius as rad
extension radius

param environment string

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide will walk you through how to use an [extender]({{< ref "/guides/autho
## Prerequisites

- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}})
- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}})
- [Radius environment]({{< ref "installation#step-3-initialize-radius" >}})

## Step 1: Register an extender Recipe
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import radius as rad
extension radius

@description('The ID of your Radius environment. Set automatically by the rad CLI.')
param environment string
Expand Down Expand Up @@ -28,7 +28,7 @@ resource demo 'Applications.Core/containers@2023-10-01-preview' = {
POSTGRESQL_HOST: extender.properties.host
POSTGRESQL_PORT: extender.properties.port
POSTGRESQL_USERNAME: extender.properties.username
POSTGRESQL_PASSWORD: extender.secrets('password')
POSTGRESQL_PASSWORD: extender.listSecrets().password
}
ports: {
web: {
Expand Down
Loading
Loading