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

[Issue] Deployment of Azure Container Apps with Terraform as Infrastructure Provider fails #1662

Closed
1 task done
lechnerc77 opened this issue Mar 4, 2023 · 5 comments · Fixed by #1989
Closed
1 task done
Assignees
Labels
aca Azure Container Apps customer-reported identify a customer issue enhancement question terraform

Comments

@lechnerc77
Copy link
Contributor

Output from azd version

azd version 0.6.0-beta.2 (commit c4a201e)

Describe the bug

Scenario is to azd up an Azure Container app using Terraform as IaC Provider. The provisioning of the infrastructure via azd provision works as expected and all components are set up successfully.

The deployment of the Azure Container App via azd deploy fails after the push of the image to the Azure container registry with the error message:

ERROR: deploying service: deploying service sender package: planning provisioning: planning infrastructure provisioning: creating template: failed to compile bicep template: failed running bicep build: exit code: 1, stdout: , stderr: An error occurred reading file. Could not find file 'C:\Users\drchr\sandbox\tf-aca\infra\sender.bicep'.
 (exit status 1)

It seems that the deployment command does not consider the configuration of the infrastructure provider defined in the azure.yaml

To Reproduce

  • Clone the repo https://github.com/lechnerc77/tf-aca/
  • Switch to the branch tf-apps-reduced
  • Create a blob storage for state management as described in the README.md
  • Execute azd provision
  • Execute azd deploy --debug

Expected behavior

The deployment of the Azure Container App when using Terraform as IaC provider should deploy the app.

Environment
Information on your environment:
* Terraform v1.3.7
* Docker Desktop 4.16.3 (96739)

Additional context

@ghost ghost added needs-triage For new issues customer-reported identify a customer issue question labels Mar 4, 2023
@ghost ghost removed the needs-triage For new issues label Mar 6, 2023
@wbreza
Copy link
Contributor

wbreza commented Apr 20, 2023

@lechnerc77 - We're in the process of updating our Container Apps deployment implementation to use the Azure SDKs instead of spawning a new partial provisioning.

Please try out the PR build of azd from this PR @ #1989

I've also gone ahead and forked the referenced repo to use as a Terraform use case. The only modifications were to remove the bicep modules you had in there and include the ACA apps as part of the main terraform deployment.

@lechnerc77
Copy link
Contributor Author

That's great news. I will try it out in the next couple of days

@lechnerc77
Copy link
Contributor Author

Unfortunately I cannot retest it as there seems to be an issue with container apps and pay-as-you.go subscriptions:

microsoft/azure-container-apps#729

Seems to be happening since the last days few days

@KaiWalter
Copy link

@wbreza I need some guidance; with the adapted version https://github.com/KaiWalter/tf-aca/tree/tf-apps and your azd PR version I managed to get infra create.
Question: how would I need to shape Terraform files so that sender and receiver are built with up?

@wbreza wbreza linked a pull request Apr 24, 2023 that will close this issue
3 tasks
@wbreza
Copy link
Contributor

wbreza commented Apr 24, 2023

@KaiWalter - take a look at my fork @ https://github.com/KaiWalter/tf-aca/blob/tf-apps/infra/main.tf#L77

Here I just make sure that the sender & receiver modules are also included in main.tf. This will ensure that all your infra is created in any azd provision or azd up call.

Does this answer your question? Let me know if you meant something different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aca Azure Container Apps customer-reported identify a customer issue enhancement question terraform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants