Azure / container-apps-deploy-pipelines-task

Azure Pipelines Task (Release Candidate) for building and deploying Azure Container Apps
MIT License
6 stars 10 forks source link

Azure Container app deploy container to existing app not working #32

Open GaurangRLB opened 1 year ago

GaurangRLB commented 1 year ago

Hi

I am trying to use AzureContainerApps task as mentioned on https://learn.microsoft.com/en-us/azure/container-apps/azure-pipelines to deploy a new container image in the existing container app. But got the error "Error: Unable to create Container App Environment."

We are using a self-hosted Linux agent. Below is YAML

steps:
- task: AzureContainerApps@0
  displayName: 'Azure Container Apps Deploy'
  inputs:
    azureSubscription: 'OUR_SUBSCRIPTION'
    imageToDeploy: 'XXX.azurecr.io/rlb-pulse-api/:$(Build.BuildId)'
    containerAppName: 'conatainer_app_name'
    resourceGroup: 'resource_group_name'
    disableTelemetry: false

We are not creating a new environment, not sure why this task tries to create an environment. However, as per the logs it seems that it it getting wrong location of the resource group. Our current resource group is in Australiaeast instead of westus.

2023-05-26T06:52:28.7898458Z [command]/usr/bin/az provider show -n Microsoft.App --query resourceTypes[?resourceType=='containerApps'].locations[] | [0]
2023-05-26T06:52:29.3898822Z "West US 2"
cormacpayne commented 1 year ago

@GaurangRLB Hey there, apologies for the delayed response -- the error you're receiving is interesting, I'm wondering if it's because it's attempting to create the Container Apps environment in a region that isn't australiaeast? One thing you can try is using the location argument that we have provided for the task to specify australiaeast as the location that you want to use for your Container App resources. I believe the AzureContainerApps@0 task should have this argument exposed, but if not, you may want to update to use the AzureContainerApps@1 task instead.

Please feel free to let me know if you have any additional questions or comments!