Azure / Azure/container-apps-deploy-action
"az containerapp create" missing `--registry-server` parameter
- Dominant language
- TypeScript
- Stars
- 94
- Forks
- 51
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 1
Description
I'm trying to deploy an application, and I keep getting an error:
```
(InvalidParameterValueInContainerTemplate) The following field(s) are either invalid or missing. Field 'template.containers.appName-fe.image' is invalid with details: 'Invalid value: "[acr].azurecr.io/full-name-fe:aca-deploy": GET https:?scope=repository%3Afull-name-fe%3Apull&service=[acr].azurecr.io: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information.';.
```
The command used is:
```bash
az containerapp create \
-n appName-fe \
-i [acr].azurecr.io/full-name-fe:aca-deploy \
--environment appName-dev \
--ingress external \
--target-port 3000
```
The login used is successful:
```
CA_GH_ACTION_ACR_ACCESS_TOKEN=$(az acr login --name [acrName] --output json --expose-token | jq -r '.accessToken')
echo "CA_GH_ACTION_ACR_ACCESS_TOKEN=${CA_GH_ACTION_ACR_ACCESS_TOKEN}" >> $GITHUB_ENV
docker login [acr].azurecr.io -u 00000000-0000-0000-0000-000000000000 -p $CA_GH_ACTION_ACR_ACCESS_TOKEN
CA_GH_ACTION_REGISTRY_URL=[acr].azurecr.io
echo "CA_GH_ACTION_REGISTRY_URL=${CA_GH_ACTION_REGISTRY_URL}" >> $GITHUB_ENV
WARNING: You can perform manual login using the provided access token below, for example: 'docker login loginServer -u 00000000-0000-0000-0000-000000000000 -p accessToken'
WARNING! Using -*** the CLI is insecure. Use --password-stdin.
Login Succeeded
```
I have validated locally there is a missing parameter:
```bash
➜ full-name-fe git:(aca-deploy) ✗ az containerapp create \
-g appName-dev \
-n appName-fe \
-i [acr].azurecr.io/full-name-fe:aca-deploy \
--environment appName-api-dev \
--ingress external \
--target-port 3000
(InvalidParameterValueInContainerTemplate) The following field(s) are either invalid or missing. Field 'template.containers.appName-fe.image' is invalid with details: 'Invalid value: "[acr].azurecr.io/full-name-fe:aca-deploy": GET https:?scope=repository%3Afull-name-fe%3Apull&service=[acr].azurecr.io: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information.';.
➜ full-name-fe git:(aca-deploy) ✗ az containerapp create \
-g appName-dev \
-n appName-fe \
-i [acr].azurecr.io/full-name-fe:aca-deploy \
--environment appName-api-dev \
--ingress external \
--target-port 3000 \
--registry-server [acr].azurecr.io
No credential was provided to access Azure Container Registry. Trying to look up credentials...
Adding registry password as a secret with name "ecrazurecrio-ecrname"
/ Running ..^C
➜ full-name-fe git:(aca-deploy) ✗
```
All I did was add ` --registry-server [acr].azurecr.io` to the CLI command.
I can't find anywhere to get this action to also add this parameter. `acrName` and `registryUrl` cannot be used together. Is there some `registryServer` variable not documented?
The Azure setup is two resource groups; I'll use RG-A and RG-B.
* RG-A contain the [acrName] registry
* RG-B is the deployment target resource group
* The action parameters uses `resourceGroup:` RG-B.
* Github login is done via federated credentials, and logs in successfully in a previous step in the same job workflow.
Action Definition:
```yaml
- name: ACA Deploy
uses: azure/container-apps-deploy-action@v1
with:
acrName: [acrName]
# registryUrl: ${{ vars.REGISTRY_LOGIN_SERVER }}
imageToDeploy: [..] # [acr].azurecr.io/full-name-fe:aca-deploy from cli above
resourceGroup: [..] # "RG-B" mentioned above
containerAppName: appName-fe
environmentVariables: # {junk stuff I'm leaving out}
targetPort: 3000
containerAppEnvironment: appName-dev
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.