Azure / Azure/container-apps-deploy-pipelines-task

Error when creating the container app

Open
#33 9 comments 0 reactions 1 assignee Claimed by @cormacpayne View on GitHub
Dominant language
TypeScript
Stars
6
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Hi,

I've got an error when using the task and if the application container is not already created. These are the inputs for the task:
```
- task: AzureContainerApps@1
inputs:
azureSubscription: ${{ parameters.service_connection }}
acrName: $(acr_name)
appSourcePath: '$(System.DefaultWorkingDirectory)'
dockerfilePath: docker/conf/Dockerfile
imageToBuild: '$(acr_name).azurecr.io/$(conf):$(build.buildid)'
containerAppName: $(conf)
resourceGroup: $(resource_group)
containerAppEnvironment: $(container_app_environment)
location: $(location)
ingress: external
environmentVariables: 'OPENAI_API_BASE=$(OPENAI_API_BASE)'
```

The error comes when the task tries to execute the following command:
```
[command]/usr/bin/az containerapp create -n conf -g rg-i xxx.azurecr.io/conf:222173 --environment conf_environment --target-port 8080
ERROR: (InvalidParameterValueInContainerTemplate) The following field(s) are either invalid or missing. Field 'template.containers.conf.image' is invalid with details: 'Invalid value: "xxx.azurecr.io/conf:222173": GET https:?scope=repository%3Aconf%3Apull&service=xxx.azurecr.io: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information.';.
##[error]Error Code: [1]
##[error]Error: Unable to create Azure Container App via 'az containerapp create' command.
```

I tested the command on my dev machine, and I got the same result. But I've got it working when adding the parameter `--registry-server` to the command:
```
az containerapp create -n conf -g rg -i xxx.azurecr.io/conf:222173 --environment conf_environment --ingress external --target-port 8080 --env-vars OPENAI_API_BASE=https://api.com/ --registry-server xxx.azurecr.io
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.