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

[az containerapp compose create] Docker Compose seems like not understand special variable: $AZURE_CONTAINERAPPS_ENV_DEFAULT_DOMAIN #7631

Open
vienleidl opened this issue May 17, 2024 · 3 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

vienleidl commented May 17, 2024

Describe the bug

After run the az container compose create command with the following docker-compose file, the value of SERVER_HOST environment var hasn't been applied correctly. The result is SERVER_HOST => nginx. in Container App's environment variables.

version: '3.4'
services:
  app:
    image: 'ACR_NAME.azurecr.io/Repo_Name/Image_Name:Tag_Name'
    environment:
      - HOST=0.0.0.0
      - PORT=8080
      - SERVER_PROTOCOL=HTTP
      - SERVER_HOST=nginx.$AZURE_CONTAINERAPPS_ENV_DEFAULT_DOMAIN
      - SERVER_PORT=80
      - SERVER_PATH=/app

If it's updated as nginx.$$AZURE_CONTAINERAPPS_ENV_DEFAULT_DOMAIN => the result will be SERVER_HOST => nginx.$

Related command

az container compose create

Errors

##[error]time="2024-05-17T05:09:11Z" level=warning msg="The \"AZURE_CONTAINERAPPS_ENV_DEFAULT_DOMAIN\" variable is not set. Defaulting to a blank string."

Issue script & Debug output

##[error]time="2024-05-17T05:09:11Z" level=warning msg="The \"AZURE_CONTAINERAPPS_ENV_DEFAULT_DOMAIN\" variable is not set. Defaulting to a blank string."

Expected behavior

template:
    containers:
    - env:
      - name: HOST
        value: 0.0.0.0
      - name: PORT
        value: '8080'
      - name: SERVER_PROTOCOL
        value: HTTP
      - name: SERVER_HOST
        value: nginx.xxxxxxxx-xxxxxxxx.southeastasia.azurecontainerapps.io
      - name: SERVER_PORT
        value: '80'
      - name: SERVER_PATH
        value: /app

Environment Summary

{
  "azure-cli": "2.60.0",
  "azure-cli-core": "2.60.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "aks-preview": "3.0.0b13",
    "azure-devops": "1.0.0",
    "containerapp": "0.3.50"
  }
}

Additional context

Reference: https://techcommunity.microsoft.com/t5/apps-on-azure-blog/accelerating-azure-container-apps-with-the-azure-cli-and-compose/ba-p/3516636#:~:text=There%20are%20also%20two%20special%20environment%20variables%20available%20at%20the%20time%20of%20evaluation%20that%20are%20specific%20to%20Azure%20Container%20Apps.%C2%A0%20AZURE_CONTAINERAPPS_ENV_DEFAULT_DOMAIN%C2%A0contains%20the%20default%20domain%20name%20for%20a%20Container%20Apps%20environment.

@vienleidl vienleidl added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label May 17, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label May 17, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented May 17, 2024

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

@microsoft-github-policy-service microsoft-github-policy-service bot added 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 May 17, 2024
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 May 17, 2024
@Greedygre
Copy link
Contributor

Greedygre commented May 30, 2024

Hi @vienleidl

Thanks for asking this question.
You can try: CONTAINER_APP_ENV_DNS_SUFFIX
For example:
SERVER_HOST=nginx.$(CONTAINER_APP_ENV_DNS_SUFFIX)
Where did you get ##[error]time="2024-05-17T05:09:11Z" level=warning msg="The \"AZURE_CONTAINERAPPS_ENV_DEFAULT_DOMAIN\" variable is not set. Defaulting to a blank string."?
Please try CONTAINER_APP_ENV_DNS_SUFFIX and check if this error still there.

Thanks!

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