Skip to content

Conversation

changjian-wang
Copy link
Collaborator

This pull request introduces several improvements to how integration tests interact with Azure Blob Storage for training and reference data. The main change is the shift from using static SAS URLs to dynamically generating them using storage account and container names, which enhances security and flexibility. The workflows are also updated to support these changes and to use more consistent environment variable names.

Integration with Azure Blob Storage:

  • Added GetTrainingContainerSasUrlAsync and GetReferenceContainerSasUrlAsync methods to the IAnalyzerTrainingService interface and its implementation, allowing dynamic SAS URL generation for specified containers and permissions. (AnalyzerTraining/Interfaces/IAnalyzerTrainingService.cs, AnalyzerTraining/Services/AnalyzerTrainingService.cs, [1] [2] [3]

  • Refactored integration tests (AnalyzerTrainingIntegrationTest and FieldExtractionProModeIntegrationTest) to use account and container names from environment variables, and to request SAS URLs via the new service methods instead of relying on static SAS URL strings. (AzureAiContentUnderstanding.Tests/AnalyzerTrainingIntegrationTest.cs, AzureAiContentUnderstanding.Tests/FieldExtractionProModeIntegrationTest.cs, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Workflow and environment updates:

  • Replaced .github/workflows/run_integration_test.yml with .github/workflows/Run Integration Test.yml, updating triggers, environment variables, and secrets to match the new dynamic SAS URL approach and use more consistent naming. (.github/workflows/Run Integration Test.yml, .github/workflows/run_integration_test.yml, [1] [2]

Dependency and configuration improvements:

  • Updated service and test initialization to validate that required storage account and container names are provided, and to fail fast if missing. (AzureAiContentUnderstanding.Tests/AnalyzerTrainingIntegrationTest.cs, AzureAiContentUnderstanding.Tests/FieldExtractionProModeIntegrationTest.cs, [1] [2]

Azure SDK usage:

  • Added missing Azure SDK imports (Azure.Identity, Azure.Storage.Sas) to support the new SAS URL generation logic. (AnalyzerTraining/Interfaces/IAnalyzerTrainingService.cs, AnalyzerTraining/Services/AnalyzerTrainingService.cs, ContentUnderstanding.Common/AzureContentUnderstandingClient.cs, [1] [2] [3]

Test reliability and flexibility:

These changes collectively make integration tests more secure, flexible, and maintainable by removing hardcoded secrets and improving configuration management.

Changjian Wang added 2 commits September 15, 2025 16:24
Implement methods in IAnalyzerTrainingService and IFieldExtractionProModeService to generate Shared Access Signature (SAS) URLs with specified permissions and expiry times. Update integration tests to utilize these methods for dynamic SAS URL creation based on environment variables. Modify AzureContentUnderstandingClient to encapsulate SAS URL generation logic. Ensure necessary namespaces are included for Azure Storage functionality. These changes enhance secure access to Azure Blob Storage for analyzer training and field extraction services.
…DPOINT and AZURE_APIVERSION across multiple services and tests
… and documents folder within RunAsync method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant