Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshmimsft committed Aug 28, 2023
1 parent b3defb4 commit d25ca93
Show file tree
Hide file tree
Showing 80 changed files with 264 additions and 185 deletions.
4 changes: 2 additions & 2 deletions docs/content/concepts/environments-concept/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ In this example there are two teams within an organization: a central operations
A typical workflow for this team structure would look like:

1. The ops team initializes a new environment, configured with a compute runtime setup with networking, identity, diagnostics, and other configuration that matches their org's requirements.
1. The developer authors a Radius application template, including containers for their services, links for their infrastructure, and routes/gateways for their networking.
1. The developer authors a Radius application template, including containers for their services, portable resources for their infrastructure, and routes/gateways for their networking.
1. The developer deploys the app template to the Radius environment
- The app's containers automatically run on the container runtime
- The link automatically configures security best practices and injects connection information into the consuming container
- The resource automatically configures security best practices and injects connection information into the consuming container

When the developer deploys their application, these org-level concerns are automatically wired up based on the environment. Developers don't have to think about credentials or how networking is configured, enabling them to focus on their applications instead.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/concepts/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Radius aims to support all hosting platform types - from hyperscale cloud, to se

### Application portability

The Radius app model is designed to be portable across all Radius-supported platforms. Combined with links and other frameworks such as [Dapr](https://dapr.io/), teams can write their apps once and deploy to any Radius-enabled platform in minutes.
The Radius app model is designed to be portable across all Radius-supported platforms. Combined with portable resources and other frameworks such as [Dapr](https://dapr.io/), teams can write their apps once and deploy to any Radius-enabled platform in minutes.

### Consistent tooling

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource demo 'Applications.Core/containers@2022-03-15-privatepreview' = {
@description('The environment ID of your Radius application. Set automatically by the rad CLI.')
param environment string

resource db 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
resource db 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' = {
name: 'db'
properties: {
application: application
Expand Down
2 changes: 1 addition & 1 deletion docs/content/getting-started/snippets/app-with-redis.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource demo 'Applications.Core/containers@2022-03-15-privatepreview' = {
}

param environment string
resource db 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
resource db 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' = {
name: 'db'
properties: {
application: application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ Add an `env` property which will contain a list of environment variables to set.

Here you can see the environment variables `FOO` and `BAZ`, with their accompanying values.

## Step 4: Add a Mongo Link
## Step 4: Add a Mongo database

Next, add to `app.bicep` a [Mongo link]({{< ref portable-resources >}}), leveraging the default "dev" Recipe:
Next, add to `app.bicep` a [Mongo database]({{< ref portable-resources >}}), leveraging the default "dev" Recipe:

{{< rad file="snippets/3-app.bicep" embed=true marker="//LINK" >}}

## Step 5: Connect to the Mongo Link
## Step 5: Connect to the Mongo database

Connections from a container to a link result in environment variables for connection information automatically being set on the container. Update your container definition to add a connection to the new Mongo link:
Connections from a container to a resource result in environment variables for connection information automatically being set on the container. Update your container definition to add a connection to the new Mongo database:

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ resource container 'Applications.Core/containers@2022-03-15-privatepreview' = {
}
connections: {
myconnection: {
source: mongoLink.id
source: mongoDatabase.id
}
}
}
}
//CONTAINER

//LINK
resource mongoLink 'Applications.Link/mongoDatabases@2022-03-15-privatepreview' = {
name: 'mongo-link'
resource mongoDatabase 'Applications.Datastores/mongoDatabases@2022-03-15-privatepreview' = {
name: 'mongo-db'
properties: {
environment: environment
application: app.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource container 'Applications.Core/containers@2022-03-15-privatepreview' = {
}

//CONTAINER
resource statestore 'Applications.Link/daprStateStores@2022-03-15-privatepreview' = {
resource statestore 'Applications.Dapr/stateStores@2022-03-15-privatepreview' = {
name: 'inventory'
properties: {
environment: environment
Expand Down
4 changes: 2 additions & 2 deletions docs/content/guides/author-apps/dapr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ Model your building blocks as resources:

To interact with a Dapr building block, you need to know the name of the [Dapr component](https://docs.dapr.io/concepts/components-concept/). This name is the same as the name of the building block resource.

For example, if you have a `Applications.Link/daprStateStores` resource named `mystatestore` the Dapr component name will be `mystatestore`. Your code will then interact with this component via `http://localhost:3500/v1.0/state/mystatestore`, or via the Dapr SDKs through the `mystatestore` component name.
For example, if you have a `Applications.Dapr/stateStores` resource named `mystatestore` the Dapr component name will be `mystatestore`. Your code will then interact with this component via `http://localhost:3500/v1.0/state/mystatestore`, or via the Dapr SDKs through the `mystatestore` component name.

### Connecting to Dapr building blocks

You can connect to a Dapr building block by manually referencing the resource name or by adding a connection. Connections automatically inject environment variables into your container with the resource name prefixed.

{{< rad file="snippets/dapr-componentname.bicep" embed=true marker="//MARKER" replace-key-ss="//STATESTORE" replace-value-ss="resource statestore 'Applications.Link/daprStateStores@2022-03-15-privatepreview' = {...}" >}}
{{< rad file="snippets/dapr-componentname.bicep" embed=true marker="//MARKER" replace-key-ss="//STATESTORE" replace-value-ss="resource statestore 'Applications.Dapr/stateStores@2022-03-15-privatepreview' = {...}" >}}

### Service invocation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource container 'Applications.Core/containers@2022-03-15-privatepreview' = {
}

//STATESTORE
resource statestore 'Applications.Link/daprStateStores@2022-03-15-privatepreview' = {
resource statestore 'Applications.Dapr/stateStores@2022-03-15-privatepreview' = {
name: 'mystatestore'
properties: {
environment: environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource account 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
}

// The accompanying Dapr component resource is automatically created for you
resource stateStore 'Applications.Link/daprStateStores@2022-03-15-privatepreview' = {
resource stateStore 'Applications.Dapr/stateStores@2022-03-15-privatepreview' = {
name: 'mystatestore'
properties: {
environment: environment
Expand Down
4 changes: 2 additions & 2 deletions docs/content/guides/author-apps/portable-resources/_index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
type: docs
title: "Radius portable resources"
linkTitle: "Links"
description: "Learn how to make your applications portable with Links"
linkTitle: "Portable Resources"
description: "Learn how to make your applications portable"
weight: 400
tags: ["portability"]
---
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
type: docs
title: "Overview: Radius Links"
title: "Overview: Portable Resources"
linkTitle: "Overview"
description: "Add links to your Radius application for infrastructure portability"
description: "Add portable resources to your Radius application for infrastructure portability"
weight: 600
categories: "Overview"
tags: ["links","portability"]
tags: ["portability"]
---

## Overview

Links provide **abstraction** and **portability** to Radius applications. This allows development teams to depend on high level resource types and APIs, and let infra teams swap out the underlying resource and configuration.
Portable resources provide **abstraction** and **portability** to Radius applications. This allows development teams to depend on high level resource types and APIs, and let infra teams swap out the underlying resource and configuration.

<img src="links.png" alt="Diagram of a link connecting from a container to either an Azure Redis Cache or a Kubernetes Deployment" width=700px />
<img src="links.png" alt="Diagram of a resource connecting from a container to either an Azure Redis Cache or a Kubernetes Deployment" width=700px />

### Example

The following examples show how a [container]({{< ref "guides/author-apps/containers" >}}) can connect to a Redis link, which in turn binds to an Azure Cache for Redis or a Kubernetes Pod.
The following examples show how a [container]({{< ref "guides/author-apps/containers" >}}) can connect to a Redis cache, which in turn binds to an Azure Cache for Redis or a Kubernetes Pod.

{{< tabs Kubernetes Azure >}}

Expand All @@ -27,11 +27,11 @@ In this example Redis is provided by a Kubernetes Pod:

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

<h4>Link</h4>
<h4>Portable Resource</h4>

A Redis link can be configured with properties from the Kubernetes Pod:
A Redis cache can be configured with properties from the Kubernetes Pod:

{{< rad file="snippets/redis-container.bicep" embed=true marker="//LINK" >}}
{{< rad file="snippets/redis-container.bicep" embed=true marker="//Portable Resource" >}}

{{< /codetab >}}

Expand All @@ -42,24 +42,18 @@ In this example Redis is provided by an Azure Cache for Redis:

{{< rad file="snippets/redis-azure.bicep" embed=true marker="//RESOURCE" >}}

<h4>Link</h4>
<h4>Portable Resource</h4>

A Redis link can be configured with an Azure resource:
A Redis cache can be configured with an Azure resource:

{{< rad file="snippets/redis-azure.bicep" embed=true marker="//LINK" >}}
{{< rad file="snippets/redis-azure.bicep" embed=true marker="//Portable Resource" >}}

{{< /codetab >}}

{{< /tabs >}}

<h4>Container</h4>

A container can connect to the Redis link without any configuration or knowledge of the underlying resource:
A container can connect to the Redis cache without any configuration or knowledge of the underlying resource:

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

## Link categories

Check out the Radius link resource schema docs to learn how to leverage links in your application:

{{< button text="Link resources" page="link-schema" >}}
{{< rad file="snippets/redis-azure.bicep" embed=true marker="//CONTAINER" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' existing
name: 'myapp'
}

//LINK
resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
name: 'myredis-link'
//PORTABLE RESOURCE
resource redis 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' = {
name: 'myrediscache'
properties: {
environment: environment
application: app.id
Expand All @@ -40,7 +40,7 @@ resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
}
}
}
//LINK
//PORTABLE RESOURCE
//CONTAINER
resource container 'Applications.Core/containers@2022-03-15-privatepreview' = {
name: 'mycontainer'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' existing
name: 'myapp'
}

//LINK
resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
name: 'myredis-link'
//PORTABLE RESOURCE
resource redis 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' = {
name: 'myrediscache'
properties: {
environment: environment
application: app.id
Expand All @@ -45,7 +45,7 @@ resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
}
}
}
//LINK
//PORTABLE RESOURCE
//CONTAINER
resource container 'Applications.Core/containers@2022-03-15-privatepreview' = {
name: 'mycontainer'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Radius environments can be setup with the rad CLI via two paths: interactive or
```
```
NAME TYPE TEMPLATE KIND TEMPLATE
default Applications.Link/mongoDatabases bicep radius.azurecr.io/recipes/dev/mongodatabases:latest
default Applications.Link/redisCaches bicep radius.azurecr.io/recipes/dev/rediscaches:latest
default Applications.Datastores/mongoDatabases bicep radius.azurecr.io/recipes/dev/mongodatabases:latest
default Applications.Datastores/redisCaches bicep radius.azurecr.io/recipes/dev/rediscaches:latest
```
You can follow the [recipes]({{< ref "/guides/recipes/overview" >}}) documentation to learn more about the recipes and how to use them in your application.

Expand Down Expand Up @@ -163,7 +163,7 @@ Radius can also be installed and an environment created with manual rad CLI comm

1. Create a new Radius resource group:

[Radius resource groups]({{< ref groups >}}) are used to organize Radius resources such as applications, environments, links, and routes. Run [`rad group create`]({{< ref rad_group_create >}}) to create a new resource group:
[Radius resource groups]({{< ref groups >}}) are used to organize Radius resources such as applications, environments, portable resources, and routes. Run [`rad group create`]({{< ref rad_group_create >}}) to create a new resource group:

```bash
rad group create myGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Resource groups are collections of resources that you can manage as a single uni
<img src="group-diagram.png" alt="Diagram showing Radius resources inside of a Radius resource group" width=600px />

{{% alert title="Radius vs. Azure Resource Groups" color="primary" %}}
Note that resource groups in Radius are not the same as [Azure resource groups](https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal). Azure resource groups are used to organize Azure resources, while Radius resource groups are used to organize Radius resources, such as applications, environments, links, and routes. When you deploy a template that contains both, Radius resources route to the Radius resource group defined in your workspace, and Azure resources route to the Azure resource group defined in your [cloud provider]({{< ref providers >}}).
Note that resource groups in Radius are not the same as [Azure resource groups](https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal). Azure resource groups are used to organize Azure resources, while Radius resource groups are used to organize Radius resources, such as applications, environments, portable resources, and routes. When you deploy a template that contains both, Radius resources route to the Radius resource group defined in your workspace, and Azure resources route to the Azure resource group defined in your [cloud provider]({{< ref providers >}}).
{{% /alert %}}

## Initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ The following resources map to Kubernetes objects:
| [`Applications.Core/containers`]({{< ref container-schema >}}) | `apps/Deployment@v1` |
| [`Applications.Core/httpRoutes`]({{< ref httproute >}}) | `core/Service@v1` |
| [`Applications.Core/gateways`]({{< ref gateway >}}) | `projectcontour.io/HTTPProxy@v1` |
| [`Applications.Link/daprPubSubBrokers`]({{< ref dapr-pubsub >}}) | `dapr.io/Component@v1alpha1` |
| [`Applications.Link/daprSecretStores`]({{< ref dapr-secretstore >}}) | `dapr.io/Component@v1alpha1` |
| [`Applications.Link/daprStateStores`]({{< ref dapr-statestore >}}) | `dapr.io/Component@v1alpha1` |
| [`Applications.Dapr/pubSubBrokers`]({{< ref dapr-pubsub >}}) | `dapr.io/Component@v1alpha1` |
| [`Applications.Dapr/secretStores`]({{< ref dapr-secretstore >}}) | `dapr.io/Component@v1alpha1` |
| [`Applications.Dapr/stateStores`]({{< ref dapr-statestore >}}) | `dapr.io/Component@v1alpha1` |

## Resource naming

Expand Down
10 changes: 5 additions & 5 deletions docs/content/guides/recipes/howto-author-recipes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ When you output a `values` object, all of the individual properties will be dire

#### Properties

Simply define an object that matches the schema of the resource calling the Recipe. For example, for an `Application.Link/redisCaches` resource, a Recipe would output:
Simply define an object that matches the schema of the resource calling the Recipe. For example, for an `Application.Datastores/redisCaches` resource, a Recipe would output:

{{< rad file="snippets/recipe.bicep" embed=true marker="//OUTVALUES" >}}

Expand Down Expand Up @@ -94,7 +94,7 @@ Recipes can be added via the rad CLI or an environment Bicep definition:

{{% codetab %}}
```bash
rad recipe register myrecipe --environment myenv --template-kind bicep --template-path myregistry.azurecr.io/recipes/myrecipe:v1 --link-type Applications.Link/redisCaches
rad recipe register myrecipe --environment myenv --template-kind bicep --template-path myregistry.azurecr.io/recipes/myrecipe:v1 --link-type Applications.Datastores/redisCaches
```
{{% /codetab %}}
{{% codetab %}}
Expand All @@ -110,7 +110,7 @@ You can now use your custom recipe in its accompanying resource. Visit the [Reci

## `context` parameter properties

In the following tables, "resource" refers to the resource "calling" the Recipe. For example, if you were to create a Recipe for an `Applications.Link/redisCaches` resource, the "resource" would be the instance of the redisCaches that is calling the Recipe.
In the following tables, "resource" refers to the resource "calling" the Recipe. For example, if you were to create a Recipe for an `Applications.Datastores/redisCaches` resource, the "resource" would be the instance of the redisCaches that is calling the Recipe.

| Key | Type | Description |
|-----|------|-------------|
Expand All @@ -124,8 +124,8 @@ In the following tables, "resource" refers to the resource "calling" the Recipe.
| Key | Type | Description | Example |
|-----|------|-------------|---------|
| `name` | string | The resource name of the application | `myredis`
| `id` | string | The ID of the resource | `/planes/radius/resourceGroups/myrg/Applications.Link/redisCaches/myredis`
| `type` | string | The type of the resource calling this recipe | `Applications.Link/redisCaches`
| `id` | string | The ID of the resource | `/planes/radius/resourceGroups/myrg/Applications.Datastores/redisCaches/myredis`
| `type` | string | The type of the resource calling this recipe | `Applications.Datastores/redisCaches`

### application

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = {
namespace: 'default'
}
recipes: {
'Applications.Link/redisCaches':{
'Applications.Datastores/redisCaches':{
myrecipe: {
templateKind: 'bicep'
templatePath: 'https://myregistry.azurecr.io/recipes/myrecipe:v1'
Expand Down
16 changes: 8 additions & 8 deletions docs/content/guides/recipes/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ Recipes currently support the following resources. Support for additional resour

| Supported resources |
|---------------------|
| [`Applications.Link/redisCaches`]({{< ref redis >}}) |
| [`Applications.Link/mongoDatabases`]({{< ref mongodb >}}) |
| [`Applications.Link/sqlDatabase`]({{< ref microsoft-sql >}}) |
| [`Applications.Link/rabbitmqMessageQueues`]({{< ref rabbitmq >}}) |
| [`Applications.Link/daprStateStores`]({{< ref dapr-statestore >}}) |
| [`Applications.Link/daprPubSubBrokers`]({{< ref dapr-pubsub >}}) |
| [`Applications.Link/daprSecretStore`]({{< ref dapr-secretstore >}}) |
| [`Applications.Link/extenders`]({{< ref extender >}}) |
| [`Applications.Datastores/redisCaches`]({{< ref redis >}}) |
| [`Applications.Datastores/mongoDatabases`]({{< ref mongodb >}}) |
| [`Applications.Datastores/sqlDatabases]({{< ref microsoft-sql >}}) |
| [`Applications.Messaging/rabbitmqQueues`]({{< ref rabbitmq >}}) |
| [`Applications.Dapr/stateStores`]({{< ref dapr-statestore >}}) |
| [`Applications.Dapr/pubSubBrokers`]({{< ref dapr-pubsub >}}) |
| [`Applications.Dapr/secretStores`]({{< ref dapr-secretstore >}}) |
| [`Applications.Core/extenders`]({{< ref extender >}}) |

## Infrastructure linking

Expand Down
Loading

0 comments on commit d25ca93

Please sign in to comment.