File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
packages/fx-core/src/component Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import {
24
24
} from "./interface" ;
25
25
import { MissingEnvironmentVariablesError } from "../../error" ;
26
26
import { setErrorContext } from "../../common/globalVars" ;
27
+ import { AzureEnvironmentVariables , OpenAIEnvironmentVariables } from "../constants" ;
27
28
28
29
function resolveDriverDef (
29
30
def : DriverDefinition ,
@@ -101,7 +102,10 @@ export function resolveString(
101
102
resolved . push ( envVar ) ;
102
103
newVal = newVal . replace ( matches [ 0 ] , envVal ) ;
103
104
}
104
- } else if ( envVar . includes ( "AZURE" ) || envVar . includes ( "OPENAI" ) ) {
105
+ } else if (
106
+ OpenAIEnvironmentVariables . hasOwnProperty ( envVar ) ||
107
+ AzureEnvironmentVariables . hasOwnProperty ( envVar )
108
+ ) {
105
109
if ( envVal ) {
106
110
resolved . push ( envVar ) ;
107
111
newVal = newVal . replace ( matches [ 0 ] , envVal ) ;
Original file line number Diff line number Diff line change @@ -130,3 +130,9 @@ export const OpenAIEnvironmentVariables = {
130
130
AZURE_OPENAI_EMBEDDING_DEPLOYMENT : "AZURE_OPENAI_EMBEDDING_DEPLOYMENT" ,
131
131
AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME : "AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME" ,
132
132
} ;
133
+
134
+ export const AzureEnvironmentVariables = {
135
+ AZURE_SEARCH_KEY : "AZURE_SEARCH_KEY" ,
136
+ SECRET_AZURE_SEARCH_KEY : "SECRET_AZURE_SEARCH_KEY" ,
137
+ AZURE_SEARCH_ENDPOINT : "AZURE_SEARCH_ENDPOINT" ,
138
+ } ;
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ const getGenericEnvVarConfig = (envKey: string): OpenAIEnvVarConfig => ({
238
238
validation : getNonEmptyStringValidation (
239
239
"driver.file.createOrUpdateEnvironmentFile.genericEnvVar.validation"
240
240
) ,
241
+ isPassword : envKey . toLowerCase ( ) . includes ( "key" ) || envKey . toLowerCase ( ) . includes ( "secret" ) ,
241
242
} ) ;
242
243
243
244
const envVarConfigs : OpenAIEnvVarConfig [ ] = [
You can’t perform that action at this time.
0 commit comments