Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Oct 14, 2024
1 parent 8a5ed92 commit e6c4e15
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion services/headless-lms/chatbot/src/azure_datasources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,25 @@ pub async fn create_azure_datasource(
anyhow::anyhow!("Azure search configuration is missing from the Azure configuration")
})?;

let blob_storage_config = azure_config.blob_storage_config.as_ref().ok_or_else(|| {
anyhow::anyhow!("Blob storage configuration is missing from the Azure configuration")
})?;

let mut url = search_config.search_endpoint.clone();
url.set_path(&format!("datasources/{}", datasource_name));
url.set_query(Some(&format!("api-version={}", API_VERSION)));

let datasource_definition = json!({
"name": datasource_name,
"type": "azureblob",

"container": {
"name": container_name,
"query": query,
},
"credentials": {
"accountName": blob_storage_config.storage_account.clone(),
"accountKey": blob_storage_config.access_key.clone(),
},
});

let response = REQWEST_CLIENT
Expand Down

0 comments on commit e6c4e15

Please sign in to comment.