From 7b6727e66ace07a6150fb670257a8af6c2544d1d Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Tue, 5 Nov 2024 15:59:57 +0800 Subject: [PATCH 1/2] update azure yaml schema to support `resources` --- schemas/alpha/azure.yaml.json | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/schemas/alpha/azure.yaml.json b/schemas/alpha/azure.yaml.json index f846f3f1fd5..1c98c15d473 100644 --- a/schemas/alpha/azure.yaml.json +++ b/schemas/alpha/azure.yaml.json @@ -352,6 +352,63 @@ ] } }, + "resources": { + "type": "object", + "title": "Definition of resources that the application depends on", + "description": "Optional. Provides additional configuration for Azure resources that the application depends on.", + "minProperties": 1, + "additionalProperties": { + "type": "object", + "additionalProperties": false, + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "title": "Required. The type of Azure resource that the application depends on", + "description": "The Azure resource type that the application depends on", + "enum": [ + "db.mysql", + "db.redis", + "db.postgres", + "db.mongo" + ] + }, + "authType": { + "type": "string", + "title": "The authentication type of Azure resource used for the application", + "description": "The application uses this kind of authentication to connect to the Azure resource.", + "enum": [ + "managedIdentity", + "usernamePassword" + ] + }, + "databaseName": { + "type": "string", + "title": "The name of Azure resource that the application depends on", + "description": "The Azure resource that will be accessed during application runtime." + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "db.mysql" + } + } + }, + "then": { + "required": [ + "authType", + "databaseName" + ] + } + } + ] + } + }, "pipeline": { "type": "object", "title": "Definition of continuous integration pipeline", From 7182640f4d79207a22fdfd1471541472cbcd6be9 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Wed, 6 Nov 2024 11:05:10 +0800 Subject: [PATCH 2/2] small update for private preview --- cli/azd/pkg/project/project.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/azd/pkg/project/project.go b/cli/azd/pkg/project/project.go index 3aa988937bf..9d7dba97775 100644 --- a/cli/azd/pkg/project/project.go +++ b/cli/azd/pkg/project/project.go @@ -23,7 +23,8 @@ import ( const ( //nolint:lll - projectSchemaAnnotation = "# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json" + // todo(haozhan): update this line for sjad private preview, need to revert it when merge into azure-dev/main branch + projectSchemaAnnotation = "# yaml-language-server: $schema=https://raw.githubusercontent.com/azure-javaee/azure-dev/feature/sjad/schemas/alpha/azure.yaml.json" ) func New(ctx context.Context, projectFilePath string, projectName string) (*ProjectConfig, error) {