From 3bc4e8db29c3d96533c3caf9ebedf9d1b9a80d1c Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Thu, 23 Jan 2025 02:34:31 +0000 Subject: [PATCH 1/2] update schema for using secrets in hooks --- schemas/v1.0/azure.yaml.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/schemas/v1.0/azure.yaml.json b/schemas/v1.0/azure.yaml.json index 8888125ab26..3788cd721a0 100644 --- a/schemas/v1.0/azure.yaml.json +++ b/schemas/v1.0/azure.yaml.json @@ -636,6 +636,19 @@ "description": "When specified overrides the hook configuration when executed in POSIX environments", "default": null, "$ref": "#/definitions/hook" + }, + "secrets": { + "type": "array", + "title": "Optional. List of azd environment variables to be used in the hook as secrets.", + "description": "If variable was set as a secret in the environment, the secret value will be passed to the hook.", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "minProperties": 1, + "maxProperties": 1 + } } }, "if": { From ce9673edc6ec9f80725e2a5a0f55cb6ef9e0ed74 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Thu, 23 Jan 2025 19:43:30 +0000 Subject: [PATCH 2/2] add example and change to map --- schemas/v1.0/azure.yaml.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/schemas/v1.0/azure.yaml.json b/schemas/v1.0/azure.yaml.json index 3788cd721a0..1f5e783a293 100644 --- a/schemas/v1.0/azure.yaml.json +++ b/schemas/v1.0/azure.yaml.json @@ -639,7 +639,7 @@ }, "secrets": { "type": "array", - "title": "Optional. List of azd environment variables to be used in the hook as secrets.", + "title": "Optional. Map of azd environment variables to hook secrets.", "description": "If variable was set as a secret in the environment, the secret value will be passed to the hook.", "items": { "type": "object", @@ -647,7 +647,10 @@ "type": "string" }, "minProperties": 1, - "maxProperties": 1 + "maxProperties": 1, + "example": { + "WITH_SECRET_VALUE": "ENV_VAR_WITH_SECRET" + } } } },