Skip to content

refactor: Refactor codebase by removing unused scripts and configurations#899

Closed
Kanchan-Microsoft wants to merge 7 commits into
devfrom
psl-US-41954
Closed

refactor: Refactor codebase by removing unused scripts and configurations#899
Kanchan-Microsoft wants to merge 7 commits into
devfrom
psl-US-41954

Conversation

@Kanchan-Microsoft
Copy link
Copy Markdown
Contributor

@Kanchan-Microsoft Kanchan-Microsoft commented May 6, 2026

Purpose

This pull request makes several updates to the infrastructure code, focusing on improving documentation, aligning network and security configurations, and cleaning up unused or redundant code. The changes also update the Bicep-to-ARM template output and remove some previously required parameters and outputs.

Key changes include:

Documentation and Clarity Improvements:

  • Added detailed comments to the infra/main.bicep file for AVM telemetry, Azure Bastion Host, and Jumpbox VM sections, explaining their purpose and deployment scenarios.

Networking and Security Configuration:

  • Updated the Azure Search service configuration to respect the deployment-wide private networking setting (enablePrivateNetworking parameter). When private networking is enabled, public access is disabled and private endpoints are created.
  • Removed unused subnet outputs (such as bastionSubnetResourceId and deploymentScriptsSubnetResourceId) from the ARM template output, streamlining the generated infrastructure.

AI Services and Parameters Cleanup:

  • Removed the aiFoundryAIservicesEnabled variable and related conditional logic, always deploying the AI Foundry AI Services module and cleaning up related parameters.
  • Removed the unused existingOpenAIEndpoint variable.

Scalability and Redundancy Configuration:

  • Simplified the skuCapacity parameter for the App Service Plan to always use a value of 1, regardless of scalability settings.

Template and Metadata Updates:

  • Updated the Bicep compiler version and template hashes in the generated main.json file, reflecting the latest code generation.
  • Added DNS zone entries for privatelink.azurewebsites.net and webApp to support additional private networking scenarios.

These changes improve maintainability, security, and clarity of the deployment templates.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL119614088% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
141 0 💤 0 ❌ 0 🔥 5.937s ⏱️

@Kanchan-Microsoft Kanchan-Microsoft changed the title refactor:Refactor codebase by removing unused scripts and configurations refactor: Refactor codebase by removing unused scripts and configurations May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 aims to refactor/trim the codebase by removing unused helper code, tests, scripts, and infrastructure configuration outputs, plus simplifying some frontend/runtime configuration handling and updating the compiled infra template artifacts.

Changes:

  • Removes unused Python helper modules/tests (API helpers/utils.py, helpers/streaming_helper.py) and related test files.
  • Removes frontend runtime config loader + bundled public/config/config.json, and prunes several frontend npm dependencies.
  • Cleans up infra: deletes infra/resources.bicep, removes various module outputs, updates infra/main.bicep/infra/main_custom.bicep, and refreshes the compiled infra/main.json.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/tests/api/helpers/test_utils.py Deleted tests for removed API helper utilities.
src/tests/api/helpers/test_streaming_helper.py Deleted tests for removed streaming helper.
src/tests/api/common/config/test_config.py Removes an unused env var from the config test fixture.
src/App/src/configs/Utils.tsx Removes unused loadConfig() utility.
src/App/public/config/config.json Deletes a previously bundled UI config file.
src/App/package.json Removes several npm deps; dependency graph updated (but see review comments on lockfile/overrides).
src/api/requirements.txt Removes unused Python deps (aiohttp, openai).
src/api/helpers/utils.py Deletes an unused API helper module.
src/api/helpers/streaming_helper.py Deletes an unused API streaming helper module.
next-steps.md Updates infra documentation to reflect infra/main.bicep as the primary template.
infra/scripts/index_scripts/00_create_sample_data_files.py Deletes a sample/export script.
infra/resources.bicep Removes a large legacy infra template file.
infra/modules/web-sites.config.bicep Removes unused outputs from the module.
infra/modules/web-sites.bicep Removes unused outputs from the module.
infra/modules/virtualNetwork.bicep Removes unused subnet output(s).
infra/modules/role-assignment.bicep Removes unused output from the module.
infra/modules/ai-services.bicep Removes unused outputs from the module.
infra/main.json Refreshes compiled ARM template output (includes some behavioral + formatting deltas).
infra/main.bicep Updates infra template (notably Search module params and added comments/telemetry notes).
infra/main_custom.bicep Updates custom infra template; removes some parameters and aligns with other infra changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/App/package.json
Comment thread infra/main.bicep Outdated
Comment thread infra/main_custom.bicep Outdated
Comment thread infra/main_custom.bicep
Comment thread src/App/package.json
Comment thread infra/main.json
Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.

Comment thread src/App/package.json
Comment thread src/App/package.json
Comment thread infra/main.bicep
Comment thread infra/main_custom.bicep
Copilot AI review requested due to automatic review settings May 8, 2026 04:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.

Comment thread infra/main.json Outdated
Comment on lines +38518 to +38522
@@ -38599,6 +38519,7 @@
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
Comment thread infra/main.bicep
Comment on lines +769 to +776
// Respect the deployment-wide private networking setting for Search as well.
publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
privateEndpoints: enablePrivateNetworking
? [
{
name: 'pep-search-${solutionSuffix}'
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
privateDnsZoneGroup: {
Comment thread infra/main_custom.bicep
Comment on lines +752 to +759
// Respect the deployment-wide private networking setting for Search as well.
publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
privateEndpoints: enablePrivateNetworking
? [
{
name: 'pep-search-${solutionSuffix}'
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
privateDnsZoneGroup: {
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.

2 participants