Skip to content

Commit

Permalink
Merge pull request #987 from solliancenet/mg-t17599
Browse files Browse the repository at this point in the history
Adding App Configuration settings for Gateway API and aligning API Key secrets with expected names
  • Loading branch information
ciprianjichici authored May 20, 2024
2 parents aa6cf41 + 7cc5dda commit 8bd1bc8
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 59 deletions.
126 changes: 77 additions & 49 deletions deploy/quick-start/config/appconfig.template.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
{
"items": [
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/orchestration-api-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:APIUrl",
"value": "${env:SERVICE_ORCHESTRATION_API_ENDPOINT_URL}",
"label": null,
"content_type": "",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:ForceHttpsRedirection",
"value": "false",
"label": null,
"content_type": "",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:AgentHubAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/agent-hub-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-agenthubapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -44,7 +16,7 @@
},
{
"key": "FoundationaLLM:APIs:AgentHubAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand Down Expand Up @@ -72,7 +44,7 @@
},
{
"key": "FoundationaLLM:APIs:CoreAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -86,7 +58,7 @@
},
{
"key": "FoundationaLLM:APIs:DataSourceHubAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/data-source-hub-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-datasourcehubapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -100,14 +72,14 @@
},
{
"key": "FoundationaLLM:APIs:DataSourceHubAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:GatekeeperAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/gatekeeper-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-gatekeeperapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -121,7 +93,7 @@
},
{
"key": "FoundationaLLM:APIs:GatekeeperAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand Down Expand Up @@ -149,7 +121,7 @@
},
{
"key": "FoundationaLLM:APIs:GatekeeperIntegrationAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/gatekeeper-integration-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-gatekeeperintegrationapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -163,14 +135,35 @@
},
{
"key": "FoundationaLLM:APIs:GatekeeperIntegrationAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:GatewayAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-gatewayapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:GatewayAPI:APIUrl",
"value": "${env:SERVICE_GATEWAY_API_ENDPOINT_URL}",
"label": null,
"content_type": "",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:GatewayAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:LangChainAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/langchain-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-langchainapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -184,7 +177,7 @@
},
{
"key": "FoundationaLLM:APIs:LangChainAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -198,14 +191,42 @@
},
{
"key": "FoundationaLLM:APIs:ManagementAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-orchestrationapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:APIUrl",
"value": "${env:SERVICE_ORCHESTRATION_API_ENDPOINT_URL}",
"label": null,
"content_type": "",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:OrchestrationAPI:ForceHttpsRedirection",
"value": "false",
"label": null,
"content_type": "",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:PromptHubAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/prompt-hub-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-prompthubapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -219,14 +240,14 @@
},
{
"key": "FoundationaLLM:APIs:PromptHubAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
},
{
"key": "FoundationaLLM:APIs:SemanticKernelAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/semantic-kernel-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-semantickernelapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -240,7 +261,7 @@
},
{
"key": "FoundationaLLM:APIs:SemanticKernelAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -254,7 +275,7 @@
},
{
"key": "FoundationaLLM:APIs:VectorizationAPI:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/vectorization-api-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-vectorizationapi-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -268,7 +289,7 @@
},
{
"key": "FoundationaLLM:APIs:VectorizationAPI:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -282,7 +303,7 @@
},
{
"key": "FoundationaLLM:APIs:VectorizationWorker:APIKey",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/vectorization-job-apikey\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-apis-vectorizationworker-apikey\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand All @@ -296,7 +317,7 @@
},
{
"key": "FoundationaLLM:APIs:VectorizationWorker:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand Down Expand Up @@ -688,7 +709,7 @@
},
{
"key": "FoundationaLLM:CoreWorker:AppInsightsConnectionString",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/appinsights-connection\"}",
"value": "{\"uri\":\"${env:AZURE_KEY_VAULT_ENDPOINT}secrets/foundationallm-app-insights-connection-string\"}",
"label": null,
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
"tags": {}
Expand Down Expand Up @@ -812,6 +833,13 @@
"content_type": "application/json",
"tags": {}
},
{
"key": "FoundationaLLM:Gateway:AzureOpenAIAccounts",
"value": "${env:AZURE_OPENAI_ID}",
"label": null,
"content_type": "",
"tags": {}
},
{
"key": "FoundationaLLM:Instance:Id",
"value": "${env:FOUNDATIONALLM_INSTANCE_ID}",
Expand Down
1 change: 0 additions & 1 deletion deploy/quick-start/infra/app/acaService.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var env = union(
)

var secretNames = [
'${serviceName}-apikey'
apiKeySecretName
]

Expand Down
3 changes: 3 additions & 0 deletions deploy/quick-start/infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var clientSecrets = [

var deployOpenAi = empty(existingOpenAiInstance.name)
var azureOpenAiEndpoint = deployOpenAi ? openAi.outputs.endpoint : customerOpenAi.properties.endpoint
var azureOpenAiId = deployOpenAi ? openAi.outputs.id : customerOpenAi.id
var azureOpenAi = deployOpenAi ? openAiInstance : existingOpenAiInstance
var openAiInstance = {
name: openAi.outputs.name
Expand Down Expand Up @@ -617,6 +618,7 @@ output AZURE_EVENT_GRID_ID string = eventgrid.outputs.id
output AZURE_KEY_VAULT_NAME string = keyVault.outputs.name
output AZURE_KEY_VAULT_ENDPOINT string = keyVault.outputs.endpoint
output AZURE_OPENAI_ENDPOINT string = azureOpenAiEndpoint
output AZURE_OPENAI_ID string = azureOpenAiId
output AZURE_STORAGE_ACCOUNT_NAME string = storage.outputs.name

var appRegNames = [for appRegistration in appRegistrations: appRegistration.name]
Expand Down Expand Up @@ -659,6 +661,7 @@ output SERVICE_CORE_JOB_ENDPOINT_URL string = acaServices[indexOf(serviceNames,
output SERVICE_DATA_SOURCE_HUB_API_ENDPOINT_URL string = acaServices[indexOf(serviceNames, 'data-source-hub-api')].outputs.uri
output SERVICE_GATEKEEPER_API_ENDPOINT_URL string = acaServices[indexOf(serviceNames, 'gatekeeper-api')].outputs.uri
output SERVICE_GATEKEEPER_INTEGRATION_API_ENDPOINT_URL string = acaServices[indexOf(serviceNames, 'gatekeeper-integration-api')].outputs.uri
output SERVICE_GATEWAY_API_ENDPOINT_URL string = acaServices[indexOf(serviceNames, 'gateway-api')].outputs.uri
output SERVICE_LANGCHAIN_API_ENDPOINT_URL string = acaServices[indexOf(serviceNames, 'langchain-api')].outputs.uri
output SERVICE_MANAGEMENT_API_ENDPOINT_URL string = acaServices[indexOf(serviceNames, 'management-api')].outputs.uri
output SERVICE_MANAGEMENT_API_MI_OBJECT_ID string = acaServices[indexOf(serviceNames, 'management-api')].outputs.miPrincipalId
Expand Down
16 changes: 8 additions & 8 deletions deploy/quick-start/infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-gatekeeperapi-apikey"
},
{
"name": "gateway-api",
"useEndpoint": true,
"hasIngress": true,
"image": "${SERVICE_GATEWAYAPI_IMAGE=cropseastus2svinternal.azurecr.io/gateway-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-gatewayapi-apikey"
},
{
"name": "gatekeeper-integration-api",
"useEndpoint": true,
Expand All @@ -166,6 +158,14 @@
"appConfigEnvironmentVarName": "foundationallm-app-configuration-uri",
"apiKeySecretName": "foundationallm-apis-gatekeeperintegrationapi-apikey"
},
{
"name": "gateway-api",
"useEndpoint": true,
"hasIngress": true,
"image": "${SERVICE_GATEWAYAPI_IMAGE=cropseastus2svinternal.azurecr.io/gateway-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-gatewayapi-apikey"
},
{
"name": "langchain-api",
"useEndpoint": true,
Expand Down
1 change: 0 additions & 1 deletion deploy/quick-start/infra/shared/monitoring.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ param logAnalyticsName string
param tags object = {}

var secretNames = [
'appinsights-connection'
'foundationallm-app-insights-connection-string'
]

Expand Down
1 change: 1 addition & 0 deletions deploy/quick-start/infra/shared/openai.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ resource openAiDeployments 'Microsoft.CognitiveServices/accounts/deployments@202

/********** Outputs **********/
output endpoint string = openAi.properties.endpoint
output id string = openAi.id
output name string = openAi.name

0 comments on commit 8bd1bc8

Please sign in to comment.