-
Notifications
You must be signed in to change notification settings - Fork 4
refactor(guides): reduce variables from 7 to 4 using data sources #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
MegaLinter is graciously provided by OX Security |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR significantly simplifies the Terraform configuration for the AI Foundry function integration by implementing automatic resource discovery. It reduces required input variables from 7 to 3 by parsing resource IDs and using data sources to discover related resources.
Key changes:
- Reduced variables from 7 to 3 using automatic resource discovery
- Added ID parsing logic to extract resource names from Azure resource IDs
- Updated tests to validate parsing and discovery functionality
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
guides/implement_ai_foundry_basic_with_azure_function_integration/terraform/variables.tf |
Reduced variables from 7 to 3 with validation |
guides/implement_ai_foundry_basic_with_azure_function_integration/terraform/main.tf |
Added resource ID parsing and data source discovery |
guides/implement_ai_foundry_basic_with_azure_function_integration/terraform/function.tf |
Updated to use parsed values instead of input variables |
guides/implement_ai_foundry_basic_with_azure_function_integration/terraform/providers.tf |
Removed unused azapi provider |
guides/implement_ai_foundry_basic_with_azure_function_integration/terraform/tests/*.tftest.hcl |
Updated tests to use new variable structure and validate parsing |
guides/implement_ai_foundry_basic_with_azure_function_integration/terraform/terraform.tfvars.example |
Simplified example configuration |
guides/implement_ai_foundry_basic_with_azure_function_integration/scripts/configure-local-settings.sh |
Updated to parse terraform state instead of using outputs |
guides/implement_ai_foundry_basic_with_azure_function_integration/README.md |
Updated documentation to reflect simplified configuration |
transparency-note.md |
Fixed spelling and markdown formatting |
guides/implement_ai_foundry_basic_with_azure_function_integration/terraform/main.tf
Outdated
Show resolved
Hide resolved
...plement_ai_foundry_basic_with_azure_function_integration/scripts/configure-local-settings.sh
Outdated
Show resolved
Hide resolved
…ion/scripts/configure-local-settings.sh Co-authored-by: Copilot <[email protected]>
📥 Pull Request
❓ What are you trying to address
The function layer terraform configuration requires 7 manual input variables from foundry_basic deployment, making configuration verbose and error-prone. Users must manually copy resource group names, AI Foundry names, project names, and Application Insights names from foundry_basic outputs.
✨ Description of new changes
Reduced required variables from 7 to 4 by implementing automatic resource discovery:
foundry_ai_foundry_id
,foundry_ai_foundry_project_id
,foundry_application_insights_id
,foundry_log_analytics_workspace_id
terraform output
commands instead of state parsing with jq (72% code reduction, removed jq dependency)This reduces configuration complexity (43% fewer variables) while following terraform best practices.
☑️ Checklist