From cbb160a59b47bd3e46f204d91d83bb95cfabca53 Mon Sep 17 00:00:00 2001 From: sk593 Date: Tue, 30 Jul 2024 16:11:19 -0700 Subject: [PATCH 1/4] update bicep references Signed-off-by: sk593 --- .github/scripts/validate_bicep.py | 5 + .github/workflows/validate-bicep.yaml | 10 +- bicepconfig.json | 11 + samples/aws-sqs/sqs.bicep | 4 +- samples/aws/awss3.bicep | 4 +- samples/dapr/dapr-azure.bicep | 2 +- samples/dapr/dapr.bicep | 6 +- samples/dapr/dapr.json | 225 ++++++++++++++++++ samples/demo/app.bicep | 2 +- samples/eshop-dapr/infra/dapr-pub-sub.bicep | 2 +- .../eshop-dapr/infra/dapr-secret-store.bicep | 2 +- .../eshop-dapr/infra/dapr-state-store.bicep | 2 +- samples/eshop-dapr/infra/gateway.bicep | 2 +- samples/eshop-dapr/infra/sql-server.bicep | 2 +- samples/eshop-dapr/main.bicep | 2 +- samples/eshop-dapr/services/basket-api.bicep | 2 +- .../eshop-dapr/services/blazor-client.bicep | 2 +- samples/eshop-dapr/services/catalog-api.bicep | 2 +- .../eshop-dapr/services/identity-api.bicep | 2 +- .../eshop-dapr/services/ordering-api.bicep | 2 +- samples/eshop-dapr/services/payment-api.bicep | 2 +- samples/eshop-dapr/services/seq.bicep | 2 +- .../eshop-dapr/services/webshopping-agg.bicep | 2 +- .../eshop-dapr/services/webshopping-gw.bicep | 2 +- samples/eshop-dapr/services/webstatus.bicep | 2 +- samples/eshop/environments/aws.bicep | 2 +- samples/eshop/environments/azure.bicep | 2 +- samples/eshop/eshop.bicep | 2 +- samples/eshop/infra/infra.bicep | 4 +- samples/eshop/infra/networking.bicep | 2 +- samples/eshop/services/basket.bicep | 4 +- samples/eshop/services/catalog.bicep | 4 +- samples/eshop/services/identity.bicep | 6 +- samples/eshop/services/ordering.bicep | 8 +- samples/eshop/services/payment.bicep | 2 +- samples/eshop/services/seq.bicep | 2 +- samples/eshop/services/web.bicep | 6 +- samples/eshop/services/webhooks.bicep | 4 +- samples/eshop/services/webshopping.bicep | 2 +- samples/eshop/services/webstatus.bicep | 2 +- samples/volumes/app.bicep | 2 +- 41 files changed, 298 insertions(+), 57 deletions(-) create mode 100644 bicepconfig.json create mode 100644 samples/dapr/dapr.json diff --git a/.github/scripts/validate_bicep.py b/.github/scripts/validate_bicep.py index fc57dfb4..75e369dd 100644 --- a/.github/scripts/validate_bicep.py +++ b/.github/scripts/validate_bicep.py @@ -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) diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 69030e50..bc9d4d7b 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -29,12 +29,12 @@ jobs: name: Validate Bicep Code runs-on: ubuntu-latest steps: - - name: Check out repo - uses: actions/checkout@v4 - - 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 diff --git a/bicepconfig.json b/bicepconfig.json new file mode 100644 index 00000000..65aa5844 --- /dev/null +++ b/bicepconfig.json @@ -0,0 +1,11 @@ +{ + "experimentalFeaturesEnabled": { + "extensibility": true, + "extensionRegistry": true, + "dynamicTypeLoading": true + }, + "extensions": { + "radius": "br:biceptypes.azurecr.io/radius:latest", + "aws": "br:biceptypes.azurecr.io/aws:latest" + } +} \ No newline at end of file diff --git a/samples/aws-sqs/sqs.bicep b/samples/aws-sqs/sqs.bicep index 5bc7c125..c2b2f7df 100644 --- a/samples/aws-sqs/sqs.bicep +++ b/samples/aws-sqs/sqs.bicep @@ -1,5 +1,5 @@ -import aws as aws -import radius as radius +extension aws +extension radius param environment string param queue_name string diff --git a/samples/aws/awss3.bicep b/samples/aws/awss3.bicep index 9f01ac82..0fee8a82 100644 --- a/samples/aws/awss3.bicep +++ b/samples/aws/awss3.bicep @@ -1,5 +1,5 @@ -import aws as aws -import radius as radius +extension aws +extension radius param environment string diff --git a/samples/dapr/dapr-azure.bicep b/samples/dapr/dapr-azure.bicep index af2e96a8..aa61ac1b 100644 --- a/samples/dapr/dapr-azure.bicep +++ b/samples/dapr/dapr-azure.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius param location string = resourceGroup().location param environment string diff --git a/samples/dapr/dapr.bicep b/samples/dapr/dapr.bicep index 60004376..a24ee7fd 100644 --- a/samples/dapr/dapr.bicep +++ b/samples/dapr/dapr.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('Specifies the environment for resources.') param environment string @@ -83,10 +83,10 @@ resource stateStore 'Applications.Dapr/stateStores@2023-10-01-preview' = { } } -import kubernetes as kubernetes{ +extension kubernetes with { kubeConfig: '' namespace: namespace -} +} as kubernetes resource statefulset 'apps/StatefulSet@v1' = { metadata: { diff --git a/samples/dapr/dapr.json b/samples/dapr/dapr.json new file mode 100644 index 00000000..48639e44 --- /dev/null +++ b/samples/dapr/dapr.json @@ -0,0 +1,225 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.1-experimental", + "contentVersion": "1.0.0.0", + "metadata": { + "_EXPERIMENTAL_WARNING": "This template uses ARM features that are experimental. Experimental features should be enabled for testing purposes only, as there are no guarantees about the quality or stability of these features. Do not enable these settings for any production usage, or your production environment may be subject to breaking.", + "_EXPERIMENTAL_FEATURES_ENABLED": [ + "Extensibility" + ], + "_generator": { + "name": "bicep", + "version": "0.29.47.4906", + "templateHash": "12499313113127413175" + } + }, + "parameters": { + "environment": { + "type": "string", + "metadata": { + "description": "Specifies the environment for resources." + } + }, + "namespace": { + "type": "string", + "defaultValue": "default", + "metadata": { + "description": "Specifies Kubernetes namespace for redis." + } + }, + "frontendImage": { + "type": "string", + "defaultValue": "ghcr.io/radius-project/samples/dapr-frontend:latest" + }, + "backendImage": { + "type": "string", + "defaultValue": "ghcr.io/radius-project/samples/dapr-backend:latest" + } + }, + "imports": { + "Radius": { + "provider": "Radius", + "version": "latest" + }, + "kubernetes": { + "provider": "Kubernetes", + "version": "1.0.0", + "config": { + "kubeConfig": "", + "namespace": "[parameters('namespace')]" + } + } + }, + "resources": { + "app": { + "import": "Radius", + "type": "Applications.Core/applications@2023-10-01-preview", + "properties": { + "name": "dapr", + "properties": { + "environment": "[parameters('environment')]" + } + } + }, + "backend": { + "import": "Radius", + "type": "Applications.Core/containers@2023-10-01-preview", + "properties": { + "name": "backend", + "properties": { + "application": "[reference('app').id]", + "container": { + "image": "[parameters('backendImage')]", + "ports": { + "web": { + "containerPort": 3000 + } + } + }, + "connections": { + "orders": { + "source": "[reference('stateStore').id]" + } + }, + "extensions": [ + { + "kind": "daprSidecar", + "appId": "backend", + "appPort": 3000 + } + ] + } + }, + "dependsOn": [ + "app", + "stateStore" + ] + }, + "frontend": { + "import": "Radius", + "type": "Applications.Core/containers@2023-10-01-preview", + "properties": { + "name": "frontend", + "properties": { + "application": "[reference('app').id]", + "container": { + "image": "[parameters('frontendImage')]", + "env": { + "CONNECTION_BACKEND_APPID": "[reference('backend').name]", + "ASPNETCORE_URLS": "http://*:8080" + }, + "ports": { + "ui": { + "containerPort": 8080 + } + } + }, + "extensions": [ + { + "kind": "daprSidecar", + "appId": "frontend" + } + ] + } + }, + "dependsOn": [ + "app", + "backend" + ] + }, + "stateStore": { + "import": "Radius", + "type": "Applications.Dapr/stateStores@2023-10-01-preview", + "properties": { + "name": "statestore", + "properties": { + "environment": "[parameters('environment')]", + "application": "[reference('app').id]", + "resourceProvisioning": "manual", + "type": "state.redis", + "version": "v1", + "metadata": { + "redisHost": "[format('{0}.{1}.svc.cluster.local:{2}', reference('service').metadata.name, parameters('namespace'), reference('service').spec.ports[0].port)]", + "redisPassword": "" + } + } + }, + "dependsOn": [ + "app", + "service" + ] + }, + "statefulset": { + "import": "kubernetes", + "type": "apps/StatefulSet@v1", + "properties": { + "metadata": { + "name": "redis", + "labels": { + "app": "redis" + } + }, + "spec": { + "replicas": 1, + "serviceName": "[reference('service').metadata.name]", + "selector": { + "matchLabels": { + "app": "redis" + } + }, + "template": { + "metadata": { + "labels": { + "app": "redis" + } + }, + "spec": { + "automountServiceAccountToken": true, + "terminationGracePeriodSeconds": 10, + "containers": [ + { + "name": "redis", + "image": "redis:6.2", + "securityContext": { + "allowPrivilegeEscalation": false + }, + "ports": [ + { + "containerPort": 6379 + } + ] + } + ] + } + } + } + }, + "dependsOn": [ + "service" + ] + }, + "service": { + "import": "kubernetes", + "type": "core/Service@v1", + "properties": { + "metadata": { + "name": "redis", + "labels": { + "app": "redis" + } + }, + "spec": { + "clusterIP": "None", + "ports": [ + { + "port": 6379 + } + ], + "selector": { + "app": "redis" + } + } + } + } + } +} \ No newline at end of file diff --git a/samples/demo/app.bicep b/samples/demo/app.bicep index 8eabe9dd..4d31bd0b 100644 --- a/samples/demo/app.bicep +++ b/samples/demo/app.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius param application string param environment string diff --git a/samples/eshop-dapr/infra/dapr-pub-sub.bicep b/samples/eshop-dapr/infra/dapr-pub-sub.bicep index f2ffaeab..7a53f79c 100644 --- a/samples/eshop-dapr/infra/dapr-pub-sub.bicep +++ b/samples/eshop-dapr/infra/dapr-pub-sub.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/infra/dapr-secret-store.bicep b/samples/eshop-dapr/infra/dapr-secret-store.bicep index 0d1645d7..52881dcc 100644 --- a/samples/eshop-dapr/infra/dapr-secret-store.bicep +++ b/samples/eshop-dapr/infra/dapr-secret-store.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/infra/dapr-state-store.bicep b/samples/eshop-dapr/infra/dapr-state-store.bicep index 4d5fbb7a..acf70490 100644 --- a/samples/eshop-dapr/infra/dapr-state-store.bicep +++ b/samples/eshop-dapr/infra/dapr-state-store.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/infra/gateway.bicep b/samples/eshop-dapr/infra/gateway.bicep index 81d44ca3..f251f287 100644 --- a/samples/eshop-dapr/infra/gateway.bicep +++ b/samples/eshop-dapr/infra/gateway.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/infra/sql-server.bicep b/samples/eshop-dapr/infra/sql-server.bicep index 64fc428b..83f8bc77 100644 --- a/samples/eshop-dapr/infra/sql-server.bicep +++ b/samples/eshop-dapr/infra/sql-server.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/main.bicep b/samples/eshop-dapr/main.bicep index fcd1e5ef..e45a33a7 100644 --- a/samples/eshop-dapr/main.bicep +++ b/samples/eshop-dapr/main.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Azure region where the resources will be deployed.') param location string = resourceGroup().location diff --git a/samples/eshop-dapr/services/basket-api.bicep b/samples/eshop-dapr/services/basket-api.bicep index 6d496cdf..fa89370d 100644 --- a/samples/eshop-dapr/services/basket-api.bicep +++ b/samples/eshop-dapr/services/basket-api.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/blazor-client.bicep b/samples/eshop-dapr/services/blazor-client.bicep index 56c06211..b0a0e7e1 100644 --- a/samples/eshop-dapr/services/blazor-client.bicep +++ b/samples/eshop-dapr/services/blazor-client.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/catalog-api.bicep b/samples/eshop-dapr/services/catalog-api.bicep index 853f90bd..18e0f10c 100644 --- a/samples/eshop-dapr/services/catalog-api.bicep +++ b/samples/eshop-dapr/services/catalog-api.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/identity-api.bicep b/samples/eshop-dapr/services/identity-api.bicep index 4f861d98..0ecb2170 100644 --- a/samples/eshop-dapr/services/identity-api.bicep +++ b/samples/eshop-dapr/services/identity-api.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/ordering-api.bicep b/samples/eshop-dapr/services/ordering-api.bicep index c434cc9b..0be88e01 100644 --- a/samples/eshop-dapr/services/ordering-api.bicep +++ b/samples/eshop-dapr/services/ordering-api.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/payment-api.bicep b/samples/eshop-dapr/services/payment-api.bicep index 52786bf9..77b2a619 100644 --- a/samples/eshop-dapr/services/payment-api.bicep +++ b/samples/eshop-dapr/services/payment-api.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/seq.bicep b/samples/eshop-dapr/services/seq.bicep index 14d368f7..9877dd7b 100644 --- a/samples/eshop-dapr/services/seq.bicep +++ b/samples/eshop-dapr/services/seq.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/webshopping-agg.bicep b/samples/eshop-dapr/services/webshopping-agg.bicep index a4ffbe29..4efc7a4c 100644 --- a/samples/eshop-dapr/services/webshopping-agg.bicep +++ b/samples/eshop-dapr/services/webshopping-agg.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop-dapr/services/webshopping-gw.bicep b/samples/eshop-dapr/services/webshopping-gw.bicep index 4ab88564..2ce02039 100644 --- a/samples/eshop-dapr/services/webshopping-gw.bicep +++ b/samples/eshop-dapr/services/webshopping-gw.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius param appId string diff --git a/samples/eshop-dapr/services/webstatus.bicep b/samples/eshop-dapr/services/webstatus.bicep index 639a2933..5a697515 100644 --- a/samples/eshop-dapr/services/webstatus.bicep +++ b/samples/eshop-dapr/services/webstatus.bicep @@ -1,4 +1,4 @@ -import radius as radius +extension radius @description('The Radius application ID.') param appId string diff --git a/samples/eshop/environments/aws.bicep b/samples/eshop/environments/aws.bicep index 61d5cc24..751c65ed 100644 --- a/samples/eshop/environments/aws.bicep +++ b/samples/eshop/environments/aws.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius @description('Account ID of the AWS account resources should be deployed in') param awsAccountId string diff --git a/samples/eshop/environments/azure.bicep b/samples/eshop/environments/azure.bicep index a796cd24..9e178aea 100644 --- a/samples/eshop/environments/azure.bicep +++ b/samples/eshop/environments/azure.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius @description('The name of the Azure resource group where Azure resources will be deployed.') param azureResourceGroup string diff --git a/samples/eshop/eshop.bicep b/samples/eshop/eshop.bicep index ee77d102..312aa31f 100644 --- a/samples/eshop/eshop.bicep +++ b/samples/eshop/eshop.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // Parameters ------------------------------------------------------- diff --git a/samples/eshop/infra/infra.bicep b/samples/eshop/infra/infra.bicep index f16d492e..a1b03617 100644 --- a/samples/eshop/infra/infra.bicep +++ b/samples/eshop/infra/infra.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius @description('Radius environment ID') param environment string @@ -113,4 +113,4 @@ output rabbitmq string = rabbitmq.name output servicebus string = servicebus.name @description('Event Bus connection string') -output eventBusConnectionString string = (AZURESERVICEBUSENABLED == 'True') ? servicebus.secrets('connectionString') : rabbitmq.properties.host +output eventBusConnectionString string = (AZURESERVICEBUSENABLED == 'True') ? servicebus.listSecrets().connectionString : rabbitmq.properties.host diff --git a/samples/eshop/infra/networking.bicep b/samples/eshop/infra/networking.bicep index 7a2f55c1..8e10cfb1 100644 --- a/samples/eshop/infra/networking.bicep +++ b/samples/eshop/infra/networking.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS ------------------------------------------------------------ @description('Radius application ID') diff --git a/samples/eshop/services/basket.bicep b/samples/eshop/services/basket.bicep index c3b9e327..1cb8bcd0 100644 --- a/samples/eshop/services/basket.bicep +++ b/samples/eshop/services/basket.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // Parameters --------------------------------------------------------- @@ -46,7 +46,7 @@ resource basket 'Applications.Core/containers@2023-10-01-preview' = { PORT: '80' GRPC_PORT: '81' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: redisBasket.connectionString() + ConnectionString: redisBasket.listSecrets().connectionString EventBusConnection: eventBusConnectionString identityUrl: 'http://identity-api:5105' IdentityUrlExternal: '${gateway.properties.url}/identity-api' diff --git a/samples/eshop/services/catalog.bicep b/samples/eshop/services/catalog.bicep index ec78da17..35199590 100644 --- a/samples/eshop/services/catalog.bicep +++ b/samples/eshop/services/catalog.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // Parameters --------------------------------------------------------- @@ -51,7 +51,7 @@ resource catalog 'Applications.Core/containers@2023-10-01-preview' = { PicBaseUrl: PICBASEURL AzureStorageEnabled: 'False' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: sqlCatalogDb.connectionString() + ConnectionString: sqlCatalogDb.listSecrets().connectionString EventBusConnection: eventBusConnectionString } ports: { diff --git a/samples/eshop/services/identity.bicep b/samples/eshop/services/identity.bicep index e95c4638..d146e283 100644 --- a/samples/eshop/services/identity.bicep +++ b/samples/eshop/services/identity.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- @@ -35,9 +35,9 @@ resource identity 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' OrchestratorType: 'K8S' IsClusterEnv: 'True' - DPConnectionString: redisKeystore.connectionString() + DPConnectionString: redisKeystore.listSecrets().connectionString EnableDevspaces: 'False' - ConnectionString: sqlIdentityDb.connectionString() + ConnectionString: sqlIdentityDb.listSecrets().connectionString MvcClient: '${gateway.properties.url}/webmvc' SpaClient: gateway.properties.url BasketApiClient: '${gateway.properties.url}/basket-api' diff --git a/samples/eshop/services/ordering.bicep b/samples/eshop/services/ordering.bicep index edf366a3..1fa6bbd5 100644 --- a/samples/eshop/services/ordering.bicep +++ b/samples/eshop/services/ordering.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- @@ -53,7 +53,7 @@ resource ordering 'Applications.Core/containers@2023-10-01-preview' = { PATH_BASE: '/ordering-api' GRPC_PORT: '81' PORT: '80' - ConnectionString: sqlOrderingDb.connectionString() + ConnectionString: sqlOrderingDb.listSecrets().connectionString EventBusConnection: eventBusConnectionString identityUrl: 'http://identity-api:5105' IdentityUrlExternal: '${gateway.properties.url}/identity-api' @@ -99,7 +99,7 @@ resource orderbgtasks 'Applications.Core/containers@2023-10-01-preview' = { 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' ORCHESTRATOR_TYPE: 'K8S' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: sqlOrderingDb.connectionString() + ConnectionString: sqlOrderingDb.listSecrets().connectionString EventBusConnection: eventBusConnectionString } ports: { @@ -133,7 +133,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2023-10-01-preview' = IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED EventBusConnection: eventBusConnectionString - SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},abortConnect=False' + SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.listSecrets().password},abortConnect=False' identityUrl: 'http://identity-api:5105' IdentityUrlExternal: '${gateway.properties.url}/identity-api' } diff --git a/samples/eshop/services/payment.bicep b/samples/eshop/services/payment.bicep index 32c6c38f..fddeb7dc 100644 --- a/samples/eshop/services/payment.bicep +++ b/samples/eshop/services/payment.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- diff --git a/samples/eshop/services/seq.bicep b/samples/eshop/services/seq.bicep index 32090891..cf97cb07 100644 --- a/samples/eshop/services/seq.bicep +++ b/samples/eshop/services/seq.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- diff --git a/samples/eshop/services/web.bicep b/samples/eshop/services/web.bicep index 4a2af4a6..276772aa 100644 --- a/samples/eshop/services/web.bicep +++ b/samples/eshop/services/web.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- @@ -34,7 +34,7 @@ resource webspa 'Applications.Core/containers@2023-10-01-preview' = { ORCHESTRATOR_TYPE: 'K8S' IsClusterEnv: 'True' CallBackUrl: '${gateway.properties.url}/' - DPConnectionString: redisKeystore.connectionString() + DPConnectionString: redisKeystore.listSecrets().connectionString IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: 'http://identity-api:5105/liveness' PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' @@ -94,7 +94,7 @@ resource webmvc 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webmvc' UseCustomizationData: 'False' - DPConnectionString: redisKeystore.connectionString() + DPConnectionString: redisKeystore.listSecrets().connectionString UseLoadTest: 'False' ORCHESTRATOR_TYPE: 'K8S' IsClusterEnv: 'True' diff --git a/samples/eshop/services/webhooks.bicep b/samples/eshop/services/webhooks.bicep index 6a65df17..93b74de7 100644 --- a/samples/eshop/services/webhooks.bicep +++ b/samples/eshop/services/webhooks.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- @@ -43,7 +43,7 @@ resource webhooks 'Applications.Core/containers@2023-10-01-preview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' ORCHESTRATOR_TYPE: 'K8S' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: sqlWebhooksDb.connectionString() + ConnectionString: sqlWebhooksDb.listSecrets().connectionString EventBusConnection: eventBusConnectionString identityUrl: 'http://identity-api:5105' IdentityUrlExternal: '${gateway.properties.url}/identity-api' diff --git a/samples/eshop/services/webshopping.bicep b/samples/eshop/services/webshopping.bicep index a27f37bc..0de76854 100644 --- a/samples/eshop/services/webshopping.bicep +++ b/samples/eshop/services/webshopping.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- diff --git a/samples/eshop/services/webstatus.bicep b/samples/eshop/services/webstatus.bicep index b2f7fe10..c83bb61e 100644 --- a/samples/eshop/services/webstatus.bicep +++ b/samples/eshop/services/webstatus.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius // PARAMETERS --------------------------------------------------------- diff --git a/samples/volumes/app.bicep b/samples/volumes/app.bicep index 36504e27..d6700f79 100644 --- a/samples/volumes/app.bicep +++ b/samples/volumes/app.bicep @@ -1,4 +1,4 @@ -import radius as rad +extension radius param environment string From 9342260dce15653024e0db8b3465fdb4fd141a84 Mon Sep 17 00:00:00 2001 From: sk593 Date: Thu, 1 Aug 2024 09:00:46 -0700 Subject: [PATCH 2/4] nit Signed-off-by: sk593 --- samples/dapr/dapr.json | 225 ----------------------------------------- 1 file changed, 225 deletions(-) delete mode 100644 samples/dapr/dapr.json diff --git a/samples/dapr/dapr.json b/samples/dapr/dapr.json deleted file mode 100644 index 48639e44..00000000 --- a/samples/dapr/dapr.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "languageVersion": "2.1-experimental", - "contentVersion": "1.0.0.0", - "metadata": { - "_EXPERIMENTAL_WARNING": "This template uses ARM features that are experimental. Experimental features should be enabled for testing purposes only, as there are no guarantees about the quality or stability of these features. Do not enable these settings for any production usage, or your production environment may be subject to breaking.", - "_EXPERIMENTAL_FEATURES_ENABLED": [ - "Extensibility" - ], - "_generator": { - "name": "bicep", - "version": "0.29.47.4906", - "templateHash": "12499313113127413175" - } - }, - "parameters": { - "environment": { - "type": "string", - "metadata": { - "description": "Specifies the environment for resources." - } - }, - "namespace": { - "type": "string", - "defaultValue": "default", - "metadata": { - "description": "Specifies Kubernetes namespace for redis." - } - }, - "frontendImage": { - "type": "string", - "defaultValue": "ghcr.io/radius-project/samples/dapr-frontend:latest" - }, - "backendImage": { - "type": "string", - "defaultValue": "ghcr.io/radius-project/samples/dapr-backend:latest" - } - }, - "imports": { - "Radius": { - "provider": "Radius", - "version": "latest" - }, - "kubernetes": { - "provider": "Kubernetes", - "version": "1.0.0", - "config": { - "kubeConfig": "", - "namespace": "[parameters('namespace')]" - } - } - }, - "resources": { - "app": { - "import": "Radius", - "type": "Applications.Core/applications@2023-10-01-preview", - "properties": { - "name": "dapr", - "properties": { - "environment": "[parameters('environment')]" - } - } - }, - "backend": { - "import": "Radius", - "type": "Applications.Core/containers@2023-10-01-preview", - "properties": { - "name": "backend", - "properties": { - "application": "[reference('app').id]", - "container": { - "image": "[parameters('backendImage')]", - "ports": { - "web": { - "containerPort": 3000 - } - } - }, - "connections": { - "orders": { - "source": "[reference('stateStore').id]" - } - }, - "extensions": [ - { - "kind": "daprSidecar", - "appId": "backend", - "appPort": 3000 - } - ] - } - }, - "dependsOn": [ - "app", - "stateStore" - ] - }, - "frontend": { - "import": "Radius", - "type": "Applications.Core/containers@2023-10-01-preview", - "properties": { - "name": "frontend", - "properties": { - "application": "[reference('app').id]", - "container": { - "image": "[parameters('frontendImage')]", - "env": { - "CONNECTION_BACKEND_APPID": "[reference('backend').name]", - "ASPNETCORE_URLS": "http://*:8080" - }, - "ports": { - "ui": { - "containerPort": 8080 - } - } - }, - "extensions": [ - { - "kind": "daprSidecar", - "appId": "frontend" - } - ] - } - }, - "dependsOn": [ - "app", - "backend" - ] - }, - "stateStore": { - "import": "Radius", - "type": "Applications.Dapr/stateStores@2023-10-01-preview", - "properties": { - "name": "statestore", - "properties": { - "environment": "[parameters('environment')]", - "application": "[reference('app').id]", - "resourceProvisioning": "manual", - "type": "state.redis", - "version": "v1", - "metadata": { - "redisHost": "[format('{0}.{1}.svc.cluster.local:{2}', reference('service').metadata.name, parameters('namespace'), reference('service').spec.ports[0].port)]", - "redisPassword": "" - } - } - }, - "dependsOn": [ - "app", - "service" - ] - }, - "statefulset": { - "import": "kubernetes", - "type": "apps/StatefulSet@v1", - "properties": { - "metadata": { - "name": "redis", - "labels": { - "app": "redis" - } - }, - "spec": { - "replicas": 1, - "serviceName": "[reference('service').metadata.name]", - "selector": { - "matchLabels": { - "app": "redis" - } - }, - "template": { - "metadata": { - "labels": { - "app": "redis" - } - }, - "spec": { - "automountServiceAccountToken": true, - "terminationGracePeriodSeconds": 10, - "containers": [ - { - "name": "redis", - "image": "redis:6.2", - "securityContext": { - "allowPrivilegeEscalation": false - }, - "ports": [ - { - "containerPort": 6379 - } - ] - } - ] - } - } - } - }, - "dependsOn": [ - "service" - ] - }, - "service": { - "import": "kubernetes", - "type": "core/Service@v1", - "properties": { - "metadata": { - "name": "redis", - "labels": { - "app": "redis" - } - }, - "spec": { - "clusterIP": "None", - "ports": [ - { - "port": 6379 - } - ], - "selector": { - "app": "redis" - } - } - } - } - } -} \ No newline at end of file From 8824187fea835e6903385e898737b39aab86a5db Mon Sep 17 00:00:00 2001 From: sk593 Date: Tue, 6 Aug 2024 10:58:31 -0700 Subject: [PATCH 3/4] nit Signed-off-by: sk593 --- bicepconfig.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bicepconfig.json b/bicepconfig.json index 65aa5844..1e19ce0b 100644 --- a/bicepconfig.json +++ b/bicepconfig.json @@ -1,11 +1,11 @@ { - "experimentalFeaturesEnabled": { - "extensibility": true, - "extensionRegistry": true, - "dynamicTypeLoading": true - }, - "extensions": { - "radius": "br:biceptypes.azurecr.io/radius:latest", - "aws": "br:biceptypes.azurecr.io/aws:latest" - } + "experimentalFeaturesEnabled": { + "extensibility": true, + "extensionRegistry": true, + "dynamicTypeLoading": true + }, + "extensions": { + "radius": "br:biceptypes.azurecr.io/radius:latest", + "aws": "br:biceptypes.azurecr.io/aws:latest" + } } \ No newline at end of file From 85cb2fb536ca3f261632e79bf8b13903b0299cf3 Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 13:42:23 -0700 Subject: [PATCH 4/4] update validate bicepconfig Signed-off-by: sk593 --- bicepconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bicepconfig.json b/bicepconfig.json index 1e19ce0b..a034f8ce 100644 --- a/bicepconfig.json +++ b/bicepconfig.json @@ -7,5 +7,8 @@ "extensions": { "radius": "br:biceptypes.azurecr.io/radius:latest", "aws": "br:biceptypes.azurecr.io/aws:latest" + }, + "cloud": { + "credentialPrecedence": [ "Environment" ] } } \ No newline at end of file