This repository demonstrates the Index Table Pattern on Azure, which uses Azure Table Storage to store data and Azure AI Search for efficient indexing and searching of that data. The architecture is designed for scenarios where quick and scalable search capabilities are needed over structured data.
The Index Table Pattern architecture consists of the following components:
- Azure Function: Handles data updates and triggers indexing in Azure AI Search.
- Azure Table Storage: Stores the data in a scalable, low-cost NoSQL store.
- Azure AI Search: Indexes the data stored in Azure Table Storage for fast search capabilities.
- Application Insights: Monitors and collects telemetry data from the Azure Function.
graph TD
Client["Client"] -->|Data Update Request| AzureFunction["Azure Function"]
Client -->|Search Request| AzureFunction
AzureFunction -->|Updates| AzureTableStorage["Azure Table Storage"]
AzureFunction -->|Indexes| AzureCognitiveSearch["Azure Cognitive Search"]
AzureFunction -->|Search| AzureCognitiveSearch
AzureCognitiveSearch -->|Returns Results| AzureFunction
subgraph Monitoring
AppInsights["Application Insights"]
end
AzureFunction -->|Logs & Telemetry| AppInsights
/index-table-pattern
│
├── README.md # Root README with architecture overview and getting started
├── LICENSE # MIT License
│
├── infrastructure
│ ├── README.md # README for Infrastructure deployment
│ ├── azure-resources.bicep # Bicep template for all Azure resources
│ └── .github/workflows/deploy-bicep.yml # GitHub Action to deploy Azure resources
│
└── azure-functions
├── README.md # README for Index Table Function
├── IndexTableFunction.csproj # C# project file for Index Table Function
├── IndexTableFunction.cs # Main code for Index Table Function
└── .github/workflows/deploy-index-function.yml # GitHub Action to deploy Index Table Function
-
Navigate to the
infrastructure
Folder:- Go to the
infrastructure
folder and follow the instructions in the Infrastructure README to deploy the required Azure resources using the Bicep template and GitHub Actions.
- Go to the
-
Run the GitHub Action:
- The GitHub Actions workflow
deploy-bicep.yml
will automatically deploy the Azure resources defined in the Bicep template.
- The GitHub Actions workflow
-
Verify Deployment:
- After the deployment completes, verify that the Azure resources (Storage Account, Function App, AI Search, Application Insights) are properly created in your Azure subscription.
-
Navigate to the
azure-functions
Folder:- Go to the
azure-functions
folder and follow the instructions in the Function README to deploy the Azure Function using GitHub Actions.
- Go to the
-
Run the GitHub Action:
- The GitHub Actions workflow
deploy-index-function.yml
will automatically build and deploy the Azure Function.
- The GitHub Actions workflow
- Use Postman or Any HTTP Client:
- Follow the testing instructions in the Function README to send HTTP POST requests to the Azure Function to update data and verify that it is correctly stored in Azure Table Storage and indexed in Azure AI Search.
-
Data Update:
- The Azure Function receives HTTP POST requests with JSON data, updates the data in Azure Table Storage, and then triggers indexing in Azure AI Search.
-
Search Capabilities:
- Azure AI Search provides search capabilities over the data stored in Azure Table Storage, enabling quick and efficient searches.
-
Monitoring:
- Application Insights collects telemetry data from the Azure Function, allowing you to monitor its performance, track errors, and gain insights into usage patterns.
- Environment Variables: Ensure all required environment variables are properly set in your Azure Function App:
AzureWebJobsStorage
: Connection string for the Azure Storage Account.AzureAISearchEndpoint
: Endpoint URL for your Azure AI Search service.AzureAISearchApiKey
: API key for your Azure AI Search service.
- Monitor with Application Insights: Check Application Insights to monitor the function's execution and gather telemetry data.
This repository uses Azure Application Insights to monitor and collect telemetry data from the Azure Function. Application Insights helps to:
- Track request rates, response times, and failure rates.
- Monitor the performance of the Azure Function.
- Diagnose failures and exceptions.
- Gain insights into the usage patterns and overall health of the system.
- Go to the Azure Portal.
- Navigate to Application Insights and select the
indexTableAppInsights
resource. - Use the available tools to explore logs, requests, failures, dependencies, and custom metrics.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or suggestions.