Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 14, 2025

The CD pipeline eshoponweb-cd-webapp-code.yml was configured to download artifacts from the CI pipeline but was incorrectly using bicep files from the repository instead of the downloaded artifacts.

Problem

The pipeline had the following issues:

  • templateFile variable pointed to 'infra/webapp.bicep' (repository path)
  • csmFile used '$(templateFile)' which resolved to the repository file
  • This prevented demonstrating a workflow where bicep files could be modified during CI

Solution

Updated the pipeline to correctly reference artifact locations:

# Before (using repo files)
variables:
  templateFile: 'infra/webapp.bicep'
# ...
csmFile: '$(templateFile)'
packageForLinux: '$(Pipeline.Workspace)/**/Web.zip'

# After (using artifacts)
variables:
  templateFile: 'webapp.bicep'
# ...
csmFile: '$(Pipeline.Workspace)/Bicep/$(templateFile)'
packageForLinux: '$(Pipeline.Workspace)/Website/Web.zip'

Changes Made

  1. templateFile: Changed from 'infra/webapp.bicep' to 'webapp.bicep' (artifact filename only)
  2. csmFile: Changed from '$(templateFile)' to '$(Pipeline.Workspace)/Bicep/$(templateFile)' (uses downloaded artifact)
  3. packageForLinux: Changed from wildcard path to specific artifact path '$(Pipeline.Workspace)/Website/Web.zip'

Validation

  • ✅ CI pipeline correctly publishes 'Bicep' and 'Website' artifacts
  • ✅ CD pipeline now uses artifact paths for both bicep and web deployment
  • ✅ YAML syntax validation passed
  • ✅ Only affected pipeline that actually downloads artifacts

This enables the intended CI/CD workflow where bicep files can be processed during the CI stage and consumed by the CD pipeline from artifacts rather than always using static repository files.

Fixes #362.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.cdnjs.com
    • Triggering command: dotnet build eShopOnWeb.sln (dns block)
    • Triggering command: dotnet test tests/UnitTests/UnitTests.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] CD pipelines are not using the downloaded artifact bicep files but the files from the repo Fix CD pipeline to use downloaded bicep artifacts instead of repository files Jul 14, 2025
Copilot AI requested a review from LuizMacedo July 14, 2025 15:34
@LuizMacedo LuizMacedo marked this pull request as ready for review August 8, 2025 21:51
@LuizMacedo LuizMacedo merged commit 2c427c9 into main Aug 8, 2025
@LuizMacedo LuizMacedo deleted the copilot/fix-362 branch August 8, 2025 21:51
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.

CD pipelines are not using the downloaded artifact bicep files but the files from the repo

2 participants