Skip to content

Deleting unecessary app settings that replace existing infra app sett… - #2494

Merged
PothieuG merged 4 commits into
mainfrom
2456-Rule_Metadata_not_visible
Mar 10, 2026
Merged

Deleting unecessary app settings that replace existing infra app sett…#2494
PothieuG merged 4 commits into
mainfrom
2456-Rule_Metadata_not_visible

Conversation

@PothieuG

@PothieuG PothieuG commented Mar 2, 2026

Copy link
Copy Markdown
Member

Description

PBI - #2456

What happened:

  • bicep redeploys App Service with only base settings
  • these base settings contains only 4 settings
  • while redeploying the ressource, bicep replaces the entire appSettings collection with these above 4 values, wipping all the other environements variables.

After investigation, those 4 settings are not mandatory there:

  • DOCKER_REGISTRY_SERVER_URL: redundant when acrUseManagedIdentityCreds: true is set.
  • WEBSITES_PORT: defaults to 80. Can be set at any point before the container starts.
  • WEBSITES_ENABLE_APP_SERVICE_STORAGE: defaults to true. Setting it to false is a best practice for containers but the app still works either way.
  • APPLICATIONINSIGHTS_CONNECTION_STRING: only needed at runtime for telemetry.

They are all runtime configuration and not a prerequisite for infrastructure.

So I deleted them from the appService.bicep file and managed them directly in the pipeline via az webapp config appsettings set (which merges instead of replacing like in the bicep file).

…ings in the appService.bicep + set those app settings as variable in build & deploy pipeline
@PothieuG
PothieuG marked this pull request as draft March 2, 2026 12:36
@PothieuG
PothieuG requested a review from Copilot March 2, 2026 12:36
@PothieuG
PothieuG marked this pull request as ready for review March 2, 2026 12:36
@PothieuG

PothieuG commented Mar 2, 2026

Copy link
Copy Markdown
Member Author

/deploy

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes App Service siteConfig.appSettings management from the Bicep module to prevent infrastructure deployments from overwriting (replacing) runtime/app secrets that are merged in via CI/CD, and shifts the essential baseline settings into the deployment workflows.

Changes:

  • Remove APPLICATIONINSIGHTS_CONNECTION_STRING parameter/appSettings from infra/modules/appService.bicep.
  • Stop passing the App Insights connection string into the App Service module from infra/main.bicep.
  • Add baseline App Service settings (storage, port, AI connection string, docker registry URL) to the GitHub Actions deployment workflows.

Reviewed changes

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

File Description
infra/modules/appService.bicep Removes siteConfig.appSettings to avoid ARM “replace” behavior wiping pipeline-managed env vars.
infra/main.bicep Removes now-unused module parameter wiring for app settings.
.github/workflows/pr-deploy.yml Sets baseline app settings via az webapp config appsettings set for PR slots.
.github/workflows/build-and-deploy.yml Sets baseline app settings via az webapp config appsettings set for staging/prod deployments.

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

Comment thread .github/workflows/pr-deploy.yml Outdated
Comment thread .github/workflows/build-and-deploy.yml Outdated
Comment on lines 161 to 166
--settings
"WEBSITES_ENABLE_APP_SERVICE_STORAGE=false"
"DOCKER_REGISTRY_SERVER_URL=https://${{ needs.infrastructure.outputs.acrName }}.azurecr.io"
"WEBSITES_PORT=3000"
"APPLICATIONINSIGHTS_CONNECTION_STRING=${{ needs.infrastructure.outputs.appInsightsConnectionString }}"
"TINA_WEBHOOK_SECRET=${{ secrets.TINA_WEBHOOK_SECRET }}"

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

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

The base App Service settings (WEBSITES_ENABLE_APP_SERVICE_STORAGE, WEBSITES_PORT, APPLICATIONINSIGHTS_CONNECTION_STRING, etc.) are now duplicated across multiple workflows. Consider centralizing these shared settings into a reusable composite action or a repo script so future changes don’t drift between PR previews and main deployments.

Copilot uses AI. Check for mistakes.
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

PR Preview Deployed

Preview URL https://app-sswrules-staging-pr-2494.azurewebsites.net/rules
Slot Name pr-2494
Branch 2456-Rule_Metadata_not_visible
Commit 2081fb6dab3f83b3b52abe07b7a9685fc4a79f24

This preview will be automatically deleted when the PR is closed.

@Calinator444

Copy link
Copy Markdown
Contributor

@PothieuG Just check the comment I left. Otherwise this looks fine.

PothieuG and others added 2 commits March 9, 2026 09:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@PothieuG

PothieuG commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

/deploy

@PothieuG PothieuG changed the title WIP - Deleting unecessary app settings that replace existing infra app sett… Deleting unecessary app settings that replace existing infra app sett… Mar 10, 2026
@PothieuG
PothieuG enabled auto-merge (squash) March 10, 2026 06:35
@PothieuG
PothieuG merged commit ae19451 into main Mar 10, 2026
1 check passed
@PothieuG
PothieuG deleted the 2456-Rule_Metadata_not_visible branch March 10, 2026 12:24
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.

4 participants