Skip to content
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

Environment vars aren't applied correctly to some containers as stated in docker-compose file #7543

Closed
vienleidl opened this issue Apr 23, 2024 · 6 comments
Labels
Auto-Assign Auto assign by bot ContainerApp customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@vienleidl
Copy link

Describe the bug

The environment vars aren't applied correctly to some containers in the docker-compose file, which is like below:
version: '3.4'
services:
server:
image: 'AcrName.azurecr.io/AcrRepoName/server:tag'
expose:
- 8080
deploy:
resources:
reservations:
cpus: '1'
memory: 2gb

spcheck:
image: 'AcrName.azurecr.io/AcrRepoName/spcheck:tag'
environment:
- spcheck.languages=en-US
expose:
- 8080

php:
image: 'AcrName.azurecr.io/AcrRepoName/php:tag'
expose:
- 8080

customer:
image: 'AcrName.azurecr.io/AcrRepoName/customer:tag'
expose:
- 8080
deploy:
resources:
reservations:
cpus: '1'
memory: 2gb

proxy:
image: 'AcrName.azurecr.io/AcrRepoName/proxy:tag'
expose:
- 8080
environment:
- FOO=BAR
deploy:
resources:
reservations:
cpus: '1'
memory: 2gb

scheme:
image: 'AcrName.azurecr.io/AcrRepoName/scheme:tag'
expose:
- 8080

==> The result is that the spcheck's environment variable is not applied to spcheck container app only, but also applied to the php and customer container apps. It has the same issue with the scheme container app is sticked with the proxy's environment variable (FOO=BAR).

Related command

az containerapp compose create -g ResourceGroupName --environment ContainerAppEnvName --location southeastasia --compose-file-path "./docker-compose.yml" --registry-server acrname.azurecr.io --registry-username acrusername--registry-password acrpassword****

Errors

Environment vars are not applied correctly to some containers as stated in docker-compose file.

Issue script & Debug output

cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: {"id":"/subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.App/containerapps/php","name":"php","type":"Microsoft.App/containerApps","location":"West US 2","systemData":{"createdBy":"me","createdByType":"User","createdAt":"2024-04-23T03:43:14.5545272","lastModifiedBy":"her","lastModifiedByType":"User","lastModifiedAt":"2024-04-23T04:09:36.3043964"},"properties":{"provisioningState":"Succeeded","runningStatus":"Running","managedEnvironmentId":"/subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.App/managedEnvironments/containerAppEnvironmentName","environmentId":"/subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.App/managedEnvironments/containerAppEnvironmentName","workloadProfileName":"Consumption","outboundIpAddresses":["0.0.0.0"],"latestRevisionName":"php--replica","latestReadyRevisionName":"php--replica","latestRevisionFqdn":"php--replica.internal.xxx-xxx.westus2.azurecontainerapps.io","customDomainVerificationId":"customDomainVerificationId","configuration":{"secrets":[{"name":"acr-secret"}],"activeRevisionsMode":"Single","ingress":{"fqdn":"php.internal.xxx-xxx.westus2.azurecontainerapps.io","external":false,"targetPort":8080,"exposedPort":0,"transport":"Auto","traffic":[{"weight":100,"latestRevision":true}],"customDomains":null,"allowInsecure":false,"ipSecurityRestrictions":null,"corsPolicy":null,"clientCertificateMode":null,"stickySessions":null,"additionalPortMappings":null,"targetPortHttpScheme":null},"registries":[{"server":"acrName.azurecr.io","username":"acrName","passwordSecretRef":"acrNameazurecrio-acrName","identity":""}],"dapr":null,"maxInactiveRevisions":null,"service":null},"template":{"revisionSuffix":"","terminationGracePeriodSeconds":null,"containers":[{"image":"acrName.azurecr.io/acrrepo/php:tag","name":"php","env":[{"name":"spcheck.languages","value":"en-US"}],"resources":{"cpu":1,"memory":"2Gi","ephemeralStorage":"4Gi"}}],"initContainers":null,"scale":{"minReplicas":null,"maxReplicas":10,"rules":null},"volumes":null,"serviceBinds":null},"eventStreamEndpoint":"https://westus2.azurecontainerapps.dev/subscriptions/subId/resourceGroups/resourceGroupName/containerApps/php/eventstream","delegatedIdentities":[]},"identity":{"type":"None"}}
cli.azext_containerapp.containerapp_decorator:
Container app created. Access your app at https://php.internal.xxx.xxx.westus2.azurecontainerapps.io/

Expected behavior

Environment variables should be applied correctly to the expected Container Apps, based on the pre-defined docker-compose file.

Environment Summary

azure-cli 2.59.0
core 2.59.0
telemetry 1.1.0

Extensions:
aks-preview 3.0.0b5
azure-devops 1.0.0
containerapp 0.3.50

Dependencies:
msal 1.27.0
azure-mgmt-resource 23.1.0b2

Additional context

No response

@vienleidl vienleidl added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Apr 23, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot ContainerApp Service Attention This issue is responsible by Azure service team. labels Apr 23, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 23, 2024

Thank you for opening this issue, we will look into it.

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @calvinsID.

@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Apr 23, 2024
@Greedygre
Copy link
Contributor

Hi @vienleidl

Thanks for reporting this issue. I will take a look for it.

@vienleidl
Copy link
Author

Hi @vienleidl

Thanks for reporting this issue. I will take a look for it.

Hi @Greedygre , i've just found that the scheme container app also inherits the specs of CPU and Memory from proxy

deploy:
      resources:
        reservations:
          cpus: '1.0'
          memory: 2gb

@Greedygre
Copy link
Contributor

Hi @vienleidl
Thanks for reporting this issue. I will take a look for it.

Hi @Greedygre , i've just found that the scheme container app also inherits the specs of CPU and Memory from proxy

deploy:
      resources:
        reservations:
          cpus: '1.0'
          memory: 2gb

Hi @vienleidl
This also has been fixed with PR Azure/azure-cli#28922
This fix will be included in version 2.61.0 of azure-cli.

@vienleidl
Copy link
Author

Hi @vienleidl
Thanks for reporting this issue. I will take a look for it.

Hi @Greedygre , i've just found that the scheme container app also inherits the specs of CPU and Memory from proxy

deploy:
      resources:
        reservations:
          cpus: '1.0'
          memory: 2gb

Hi @vienleidl This also has been fixed with PR Azure/azure-cli#28922 This fix will be included in version 2.61.0 of azure-cli.

Awesome & thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot ContainerApp customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants