Closed antsok closed 5 months ago
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Is this repo being watched by the ACR team?
You already specify agentPoolName
to defaultPool
when you create task
resource. You don't need to pass it again in acrTaskRun
request as the error pointed it out.
You can try remove agentPoolName
from acrTaskRun
and see if it works.
resource acrTaskRun 'Microsoft.ContainerRegistry/registries/taskRuns@2019-06-01-preview' = if(doTaskRun) {
name: name
parent: acr
location: location
properties: {
forceUpdateTag: forceUpdateTag
runRequest:{
isArchiveEnabled: true
type: 'TaskRunRequest'
taskId: acrTask.id
}
}
}
The agent pool configuration is defined at the task level, and once a task has been designated to run on a specific agent pool, it should not be re-specified for individual task runs.
@antsok I've noticed you mentioned "However when taskrun is executing it is not using the custom agent pool defined for task". Are you certain about that? To verify, you can use the "az acr task show-run" command and examine whether the agent pool name for the task run is null. Additionally, providing us with the registry name and task run ID will enable us to investigate whether the task run indeed executed on your designated custom agent pool.
The agent pool configuration is defined at the task level, and once a task has been designated to run on a specific agent pool, it should not be re-specified for individual task runs.
This explanation needs to find its way in removing the agentPool property from the taskRun resource
@antsok I've noticed you mentioned "However when taskrun is executing it is not using the custom agent pool defined for task". Are you certain about that? To verify, you can use the "az acr task show-run" command and examine whether the agent pool name for the task run is null. Additionally, providing us with the registry name and task run ID will enable us to investigate whether the task run indeed executed on your designated custom agent pool.
The problem was reported 6 months ago. I no loger have those resources deployed, and logs are not retained for that long.
This explanation needs to find its way in removing the agentPool property from the taskRun resource
For a quick Run (without the creation of a Task resource), the agentPoolName property is necessary to specify where it should be run.
Likewise, when using Azure CLI, you can request a quick Run on an Agentpool by "az acr build --agent-pool", or you can create a Task configured with an Agentpool by "az acr task create --agent-pool" and subsequently execute this Task by "az acr task run". However, "az acr task run --agent-pool" will result in an error "You cannot set the agent pool name in the task run request. Please set the name on the task".
I understand your point, and I agree that the Bicep templates can be misleading. It should be documented that if the Agentpool is configured for a Task resource, the agentPoolName property should be removed for a Run resource. Thank you for your suggestion; we will assess how to enhance the user experience in this regard.
Thank you for agreeing to consider updating the documentation. It would help avoid the confusion indeed.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.
Describe the bug Azure gives an error when deploying taskRun with Bicep, despite that bicep documentation for taskRun states that it is possible to specify agent pool. See https://learn.microsoft.com/en-us/azure/templates/microsoft.containerregistry/registries/taskruns?pivots=deployment-language-bicep#resource-format
At the same time, CLI does allow to specify agent pool.
To Reproduce Steps to reproduce the behavior:
task.bicep
main.bicep
Error:
If I leave out this parameter and configure agentPool only on task level then taskRun deploys successfully. However when taskrun is executing it is not using the custom agent pool defined for task.
Expected behavior I would expect the behavior of Azure RM to match the documentation, so that agent pool parameter is accepted. I would also expect that task runs to respect the agent pool configured on the task.
Any relevant environment information
Additional context Add any other context about the problem here.
If any information is a concern to post here, you can create a support ticket or send an email to acrsup@microsoft.com.