acr icon indicating copy to clipboard operation
acr copied to clipboard

Updating task values doesn't work

Open cole-bishop opened this issue 4 years ago • 2 comments

Issue I'm unable to update the values in a scheduled task.

To Reproduce

  1. Create a trivial task such as:
az acr task create \
  --cmd "$Registry/hello-world:latest" \
  --name <random-task-name> \
  --registry <your-registry> \
  --resource-group <your-resource-group> \
  --schedule "*/3 * * * *" \
  --context /dev/null 
  1. Update that task:
az acr task update -n <random-task-name> -r <your-registry> --set 'foo=bar'

Expected behavior The output of the update should display the newly set value. That is, step.values[] should display it.

...
"step": {
...
     "values" : [
          {
             "isSecret": false,
             "name": "foo",
             "value": "bar"
          }
     ]
...
}
  • OS: Windows/WSL2
  • Azure CLI: 2.15.1
  • Docker version: 19.03.13, build 4484c46d9d

cole-bishop avatar Dec 10 '20 07:12 cole-bishop

The above acr task create command created a context-less encoded task. There are some limits in CLI command to update encoded task. But I agree we should fix it.

For now, you can rerun "az acr task create" with the additional --set parameters to update the task.

A related issue https://github.com/Azure/acr/issues/313

/cc: @rosanch @jaysterp

northtyphoon avatar Dec 10 '20 08:12 northtyphoon

@northtyphoon Bin, the solution that I came up with is to update the step with EncodedTaskStep if we are only updating the value of an EncodedTask. Will there be some scenario in which user created an encoded task, but later change to a FileTask and would like to change the values in the step?

wju-MSFT avatar Oct 13 '22 09:10 wju-MSFT

Closing as this has been inactive. Please open a support ticket with our team for assistance.

terencet-dev avatar Nov 17 '22 20:11 terencet-dev