Skip to content

Conversation

davidfowl
Copy link
Member

@davidfowl davidfowl commented Oct 23, 2024

Backport of #6442 to release/9.0

Customer Impact

Using docker files with container app customization does not work currently.

Testing

Unit tests, and manual testing with azd.

Risk

Low.

Regression?

No

Microsoft Reviewers: Open in CodeFlow

- We were not detecting containers with the build annotation and reading the image name from a parameter. Instead, it was using the runtime image name which is incorrect.
- Expose DockerfileBuildAnnotation to make this possible.
- Added test and updated the playground with a docker file sample
template: {
containers: [
{
image: pythonapp_containerimage
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the key change.

Comment on lines +131 to +152
var resource = target?.DeploymentTarget as AzureProvisioningResource;

Assert.NotNull(resource);

var (manifest, bicep) = await ManifestUtils.GetManifestWithBicep(resource);

var m = manifest.ToString();

var expectedManifest =
"""
{
"type": "azure.bicep.v0",
"path": "api.module.bicep",
"params": {
"outputs_azure_container_registry_managed_identity_id": "{.outputs.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID}",
"outputs_managed_identity_client_id": "{.outputs.MANAGED_IDENTITY_CLIENT_ID}",
"outputs_azure_container_apps_environment_id": "{.outputs.AZURE_CONTAINER_APPS_ENVIRONMENT_ID}",
"outputs_azure_container_registry_endpoint": "{.outputs.AZURE_CONTAINER_REGISTRY_ENDPOINT}",
"api_containerimage": "{api.containerImage}"
}
}
""";
Copy link
Member

Choose a reason for hiding this comment

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

Should we be baselining the entire resource's manifest? And not just the deployment section?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could but it's not really relevant for this test.

Copy link
Member

Choose a reason for hiding this comment

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

    "pythonapp": {
      "type": "container.v1",
      "build": {
        "context": "AppWithDocker",
        "dockerfile": "AppWithDocker/Dockerfile"
      },

I don't understand how that part isn't relevant. Seems pretty important for the scenario to work.

@davidfowl davidfowl merged commit 6489c6e into release/9.0 Oct 23, 2024
9 checks passed
@davidfowl davidfowl deleted the davidfowl/bp-6442 branch October 23, 2024 15:18
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2024
@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants