-
Notifications
You must be signed in to change notification settings - Fork 668
Fix Azure Container Apps deployment failure with uppercase resource names #9752
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
Conversation
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
@copilot the container app name is being lowercased multiple times, we want to do it once. Also the host name calculated in ProcessEndpoints also uses the resource name (which maps to the container app name). Let's have a single property that represents the normalized container app name that will be used as the EndpointMapping host name and the name of the container app. Also remove setting the container app name multiple times. |
Address feedback from @davidfowl to eliminate multiple ToLowerInvariant() calls and create a single NormalizedContainerAppName property that is used consistently for both Bicep identifiers and endpoint mapping host names. Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
I've refactored the code to address your feedback. The changes include:
The normalized container app name is now used consistently for both the Bicep resource identifier and endpoint mapping host names as requested. Commit: 4cb15cf |
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Problem
Adding project references with uppercase names (e.g.,
"WebFrontEnd"
) would work fine locally but cause deployment failures when publishing to Azure Container Apps:Root Cause
While the Container App's
Name
property was being set to lowercase, the Bicep resource identifier was still using the original uppercase name. Azure Container Apps require lowercase names, but the generated Bicep template contained uppercase identifiers, causing deployment failures.Solution
Updated
ContainerAppContext.cs
to ensure both the Bicep resource identifier and container names are lowercase:Line 59: Fixed Bicep identifier creation to use lowercase name:
Line 104: Fixed container name to use lowercase:
Testing
ContainerAppWithUppercaseName_ShouldUseLowercaseInManifest
Developer Experience
This approach is consistent with existing Azure naming patterns throughout the codebase where automatic lowercase conversion is commonly used.
Fixes #4505.
💡 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.