Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhulen committed Jul 31, 2024
2 parents 6c47c92 + ea2c8a1 commit 4df8a34
Show file tree
Hide file tree
Showing 86 changed files with 2,389 additions and 2,001 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureEventGrid:APIKey"
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureEventGrid:Essentials:APIKey"
},
"url": "https://eg-mg08-fllmstd-westus-svc.westus3-1.eventgrid.azure.net/",
"url_exceptions": [],
"timeout_seconds": 60,
"retry_strategy_name": "ExponentialBackoff"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Gatekeeper",
"authentication_type": "APIKey",
"authentication_parameters":{
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureContentSafety:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureContentSafety:Essentials:APIKey",
"api_key_header_name": "Ocp-Apim-Subscription-Key"
},
"url": "${env:AZURE_CONTENT_SAFETY_ENDPOINT}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureEventGrid:APIKey"
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureEventGrid:Essentials:APIKey"
},
"url": "${env:AZURE_EVENT_GRID_ENDPOINT}",
"url_exceptions": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
"cost_center": null,
"category": "General",
"authentication_type": "APIKey",
"api_version": "2023-05-15",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureOpenAI:APIKey"
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:AzureOpenAI:Essentials:APIKey",
"api_key_header_name": "api-key"
},
"operation_type": "chat",
"url": "${env:AZURE_OPENAI_ENDPOINT}",
"url_exceptions": [],
"timeout_seconds": 60,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Gatekeeper",
"authentication_type": "APIKey",
"authentication_parameters":{
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatekeeperAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatekeeperAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_GATEKEEPER_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Gatekeeper",
"authentication_type": "APIKey",
"authentication_parameters":{
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatekeeperIntegrationAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatekeeperIntegrationAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_GATEKEEPER_INTEGRATION_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters":{
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatewayAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatewayAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_GATEWAY_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatewayAdapterAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:GatewayAdapterAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_GATEWAY_ADAPTER_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Orchestration",
"authentication_type": "APIKey",
"authentication_parameters":{
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:LangChainAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:LangChainAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_LANGCHAIN_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:OrchestrationAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:OrchestrationAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_ORCHESTRATION_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Orchestration",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:SemanticKernelAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:SemanticKernelAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_SEMANTIC_KERNEL_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:StateAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:StateAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_STATE_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:VectorizationAPI:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:VectorizationAPI:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_VECTORIZATION_API_ENDPOINT_URL}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "General",
"authentication_type": "APIKey",
"authentication_parameters": {
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:VectorizationWorker:APIKey",
"api_key_configuration_name": "FoundationaLLM:APIEndpoints:VectorizationWorker:Essentials:APIKey",
"api_key_header_name": "X-API-KEY"
},
"url": "${env:SERVICE_VECTORIZATION_JOB_ENDPOINT_URL}",
Expand Down
1 change: 1 addition & 0 deletions deploy/quick-start/infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ module acaServices './app/acaService.bicep' = [
var cosmosRoleTargets = [
'core-api'
'core-job'
'state-api'
]

module cosmosRoles './shared/sqlRoleAssignments.bicep' = [
Expand Down
22 changes: 11 additions & 11 deletions deploy/quick-start/infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"hasIngress": false,
"image": "${SERVICE_COREJOB_IMAGE=cropseastus2svinternal.azurecr.io/core-job:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-corejob-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-coreworker-apikey",
"cpu": "${SERVICE_COREJOB_CPU=1.0}",
"memory": "${SERVICE_COREJOB_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_COREJOB_REPLICAS}"
Expand All @@ -171,7 +171,7 @@
"hasIngress": true,
"image": "${SERVICE_GATEKEEPERAPI_IMAGE=cropseastus2svinternal.azurecr.io/gatekeeper-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-gatekeeperapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-gatekeeperapi-apikey",
"cpu": "${SERVICE_GATEKEEPERAPI_CPU=1.0}",
"memory": "${SERVICE_GATEKEEPERAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_GATEKEEPERAPI_REPLICAS}"
Expand All @@ -182,7 +182,7 @@
"hasIngress": true,
"image": "${SERVICE_GATEKEEPERINTEGRATIONAPI_IMAGE=cropseastus2svinternal.azurecr.io/gatekeeper-integration-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FOUNDATIONALLM_APP_CONFIGURATION_URI",
"apiKeySecretName": "foundationallm-apis-gatekeeperintegrationapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-gatekeeperintegrationapi-apikey",
"cpu": "${SERVICE_GATEKEEPERINTEGRATIONAPI_CPU=1.0}",
"memory": "${SERVICE_GATEKEEPERINTEGRATIONAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_GATEKEEPERINTEGRATIONAPI_REPLICAS}"
Expand All @@ -193,7 +193,7 @@
"hasIngress": true,
"image": "${SERVICE_GATEWAYADAPTERAPI_IMAGE=cropseastus2svinternal.azurecr.io/gateway-adapter-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-gatewayadapterapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-gatewayadapterapi-apikey",
"cpu": "${SERVICE_GATEWAYADAPTERAPI_CPU=1.0}",
"memory": "${SERVICE_GATEWAYADAPTERAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_GATEWAYADAPTERAPI_REPLICAS}"
Expand All @@ -204,7 +204,7 @@
"hasIngress": true,
"image": "${SERVICE_GATEWAYAPI_IMAGE=cropseastus2svinternal.azurecr.io/gateway-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-gatewayapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-gatewayapi-apikey",
"cpu": "${SERVICE_GATEWAYAPI_CPU=1.0}",
"memory": "${SERVICE_GATEWAYAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_GATEWAYAPI_REPLICAS}"
Expand All @@ -215,7 +215,7 @@
"hasIngress": true,
"image": "${SERVICE_LANGCHAINAPI_IMAGE=cropseastus2svinternal.azurecr.io/langchain-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FOUNDATIONALLM_APP_CONFIGURATION_URI",
"apiKeySecretName": "foundationallm-apis-langchainapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-langchainapi-apikey",
"cpu": "${SERVICE_LANGCHAINAPI_CPU=1.0}",
"memory": "${SERVICE_LANGCHAINAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_LANGCHAINAPI_REPLICAS}"
Expand Down Expand Up @@ -248,7 +248,7 @@
"hasIngress": true,
"image": "${SERVICE_ORCHESTRATIONAPI_IMAGE=cropseastus2svinternal.azurecr.io/orchestration-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-orchestrationapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-orchestrationapi-apikey",
"cpu": "${SERVICE_ORCHESTRATIONAPI_CPU=1.0}",
"memory": "${SERVICE_ORCHESTRATIONAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_ORCHESTRATIONAPI_REPLICAS}"
Expand All @@ -270,7 +270,7 @@
"hasIngress": true,
"image": "${SERVICE_SEMANTICKERNELAPI_IMAGE=cropseastus2svinternal.azurecr.io/semantic-kernel-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-semantickernelapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-semantickernelapi-apikey",
"cpu": "${SERVICE_SEMANTICKERNELAPI_CPU=1.0}",
"memory": "${SERVICE_SEMANTICKERNELAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_SEMANTICKERNELAPI_REPLICAS}"
Expand All @@ -281,7 +281,7 @@
"hasIngress": true,
"image": "${SERVICE_STATEAPI_IMAGE=cropseastus2svinternal.azurecr.io/state-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-stateapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-stateapi-apikey",
"cpu": "${SERVICE_STATEAPI_CPU=1.0}",
"memory": "${SERVICE_STATEAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_STATEAPI_REPLICAS}"
Expand All @@ -292,7 +292,7 @@
"hasIngress": true,
"image": "${SERVICE_VECTORIZATIONAPI_IMAGE=cropseastus2svinternal.azurecr.io/vectorization-api:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-vectorizationapi-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-vectorizationapi-apikey",
"cpu": "${SERVICE_VECTORIZATIONAPI_CPU=1.0}",
"memory": "${SERVICE_VECTORIZATIONAPI_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_VECTORIZATIONAPI_REPLICAS}"
Expand All @@ -303,7 +303,7 @@
"hasIngress": true,
"image": "${SERVICE_VECTORIZATIONJOB_IMAGE=cropseastus2svinternal.azurecr.io/vectorization-job:${FLLM_VERSION}}",
"appConfigEnvironmentVarName": "FoundationaLLM_AppConfig_ConnectionString",
"apiKeySecretName": "foundationallm-apis-vectorizationworker-apikey",
"apiKeySecretName": "foundationallm-apiendpoints-vectorizationworker-apikey",
"cpu": "${SERVICE_VECTORIZATIONJOB_CPU=1.0}",
"memory": "${SERVICE_VECTORIZATIONJOB_MEMORY=2.0Gi}",
"replicaCount": "${SERVICE_VECTORIZATIONJOB_REPLICAS}"
Expand Down
110 changes: 110 additions & 0 deletions deploy/quick-start/scripts/New-Backup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/usr/bin/env pwsh

Param(
[Parameter(Mandatory = $true)][string]$resourceGroup,
[Parameter(Mandatory = $true)][string]$destinationStorageAccount
)

Set-PSDebug -Trace 0 # Echo every command (0 to disable, 1 to enable)
Set-StrictMode -Version 3.0
$ErrorActionPreference = "Stop"

function Get-SearchServiceIndexes {
param(
[Parameter(Mandatory = $true)][string]$searchServiceName,
[Parameter(Mandatory = $true)][string]$pathPrefix
)

$serviceUri = "https://$searchServiceName.search.windows.net"
$uri = $serviceUri + "/indexes?api-version=2020-06-30&`$select=name"
$token = $(az account get-access-token --query accessToken --output tsv --scope "https://search.azure.com/.default")
$headers = @{"Authorization" = "Bearer $token"; "Accept" = "application/json"; "ContentType" = "application/json; charset=utf-8"}

$indexes = $(Invoke-RestMethod -Uri $uri -Method GET -Headers $headers).value.name
foreach ($index in $indexes) {
$uri = $serviceUri `
+ "/indexes/$index/docs/`$count?api-version=2020-06-30"
$req = [System.Net.WebRequest]::Create($uri)

$req.ContentType = "application/json; charset=utf-8"
$req.Accept = "application/json"
$req.Headers["Authorization"] = "Bearer $token"

$resp = $req.GetResponse()
$reader = new-object System.IO.StreamReader($resp.GetResponseStream())
$result = $reader.ReadToEnd()
$documentCount = [int]$result

$pageCount = [math]::ceiling($documentCount / 500)

$job = 1..$pageCount | ForEach-Object -Parallel {
$skip = ($_ - 1) * 500
$uri = $using:serviceUri + "/indexes/$($using:index)/docs?api-version=2020-06-30&search=*&`$skip=$($skip)&`$top=500&searchMode=all"
$outputPath = "$($using:index)_$($_).json"
Invoke-RestMethod -Uri $uri -Method GET -Headers $using:headers -ContentType "application/json" |
ConvertTo-Json -Depth 9 |
Set-Content $outputPath
"Output: $uri"
azcopy copy $outputPath "$($using:pathPrefix)/$($using:index)/"
} -ThrottleLimit 5 -AsJob
$job | Receive-Job -Wait
}
}

# Navigate to the script directory so that we can use relative paths.
Push-Location $($MyInvocation.InvocationName | Split-Path)
try {
# Create backups container
az storage container create -n backups --account-name $destinationStorageAccount

# Get main storage account
$sourceStorageAccountName = ""
foreach ($resourceId in (az storage account list -g $resourceGroup --query "@[].id" --output tsv)) {
if ((az tag list --resource-id $resourceId --query "contains(keys(@.properties.tags), 'azd-env-name')") -eq $true) {
$sourceStorageAccountName = $(az resource show --ids $resourceId --query "@.name" --output tsv)
Write-Host "Selecting $sourceStorageAccountName as the storage account"
break;
}
}

if ([string]::IsNullOrEmpty($sourceStorageAccountName)) {
throw "Could not find any storage accounts with the azd-env-name tag in $resourceGroup."
}

# Recursively copy storage account contents
$env:AZCOPY_AUTO_LOGIN_TYPE="AZCLI"
foreach ($container in (az storage container list --account-name $sourceStorageAccountName --query "@[].name" --auth-mode login -o tsv)) {
azcopy copy "https://$($sourceStorageAccountName).blob.core.windows.net/$container/" "https://$destinationStorageAccount.blob.core.windows.net/backups/$resourceGroup/" --recursive
}

$sourceSearchServiceName = ""
foreach ($resourceId in (az search service list -g $resourceGroup --query "@[].id" --output tsv)) {
if ((az tag list --resource-id $resourceId --query "contains(keys(@.properties.tags), 'azd-env-name')") -eq $true) {
$sourceSearchServiceName = $(az resource show --ids $resourceId --query "@.name" --output tsv)
Write-Host "Selecting $sourceSearchServiceName as the search service"
break;
}
}

if ([string]::IsNullOrEmpty($sourceSearchServiceName)) {
throw "Could not find any search services with the azd-env-name tag in $resourceGroup."
}

# Save Search Indexes
Get-SearchServiceIndexes -searchServiceName $sourceSearchServiceName -pathPrefix "https://$destinationStorageAccount.blob.core.windows.net/backups/$resourceGroup/data-sources/indexes"
}
catch {
if (Test-Path -Path "$env:HOME/.azcopy") {
$logFile = Get-ChildItem -Path "$env:HOME/.azcopy" -Filter "*.log" | `
Where-Object { $_.Name -notlike "*-scanning*" } | `
Sort-Object LastWriteTime -Descending | `
Select-Object -First 1
$logFileContent = Get-Content -Raw -Path $logFile.FullName
Write-Host $logFileContent
}
Write-Host $_.Exception.Message
}
finally {
Pop-Location
Set-PSDebug -Trace 0 # Echo every command (0 to disable, 1 to enable)
}
1 change: 1 addition & 0 deletions deploy/standard-hub/config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vpn
Loading

0 comments on commit 4df8a34

Please sign in to comment.