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

Invalid template error when deploying via Azure Devops #2222

Open
thomasholknielsen opened this issue Dec 11, 2024 · 2 comments
Open

Invalid template error when deploying via Azure Devops #2222

thomasholknielsen opened this issue Dec 11, 2024 · 2 comments

Comments

@thomasholknielsen
Copy link

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Configure the solution to use containerapps
  2. Use azd up to deploy the infrastructure, backend and frontend succesfully from local machine
  3. Use 'azd pipeline config --provider azdo' to configure the repos and pipeline in Azure Devops
  4. The Pipeline run fails the proviosning step with the invalid template error below.

Any log messages given by the failure

InvalidTemplate: Deployment template validation failed: 'The template resource 'my-resourcegroup-aca-env' at line '1' and column '14747' is not valid: The language expression property array index '2' is out of bounds.. Please see https://aka.ms/arm-functions for usage details.'.

Expected/desired behavior

That the pipeline performs all tasks succesfully

OS and Version?

Windows 11 Enterprise 23H2

azd version?

1.11.0 both locally and on azure devops

Mention any other details that might be useful

@pamelafox
Copy link
Collaborator

Are you deploying to container apps or app service?
This looks like #2146 - at least its the same error - which seems to be related to app service vs container apps deployments.

@thomasholknielsen
Copy link
Author

Hi @pamelafox,

I’m deploying to Container Apps and encountered an issue.

While the error resembles the one described in #2146, I’m not entirely sure the underlying cause is the same. That said, the discussions in #2146 were helpful for further debugging. Based on my findings, it seems the Azure DevOps pipeline doesn’t add the "Log Analytics Workspace Resource ID" to the deployment template for the Container Apps resource.

Steps to Reproduce

  1. Local Deployment:

    • Running azd up from my local machine works perfectly, with a 100% success rate.
    • When I check the Azure portal, I can confirm the "container-apps" resource is successfully deployed in the resource group.
    • Additionally, I’m able to redeploy the resource from the Azure UI without any issues.
    • During the redeployment process, I copied the "Log Analytics Workspace Resource ID" from the deployment template for use in step 3.
  2. Pipeline Configuration:

    • I used the command azd pipeline config --provider azdo to set up the Azure DevOps repositories and pipeline.
  3. Pipeline Deployment:

    • When the Azure DevOps pipeline runs the provision step, everything deploys successfully except the "container-apps" resource.
    • If I then attempt to redeploy this resource from the Azure portal, I receive a notification prompting me to provide the "Log Analytics Workspace Resource ID." I’m unable to deploy the resource until I manually supply the value I copied in step 1.

Let me know if additional information or logs would help diagnose this issue further.

Thanks,
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants