Azure Pipeline resources.containers referencing in script doesn't work anymore

Lippy 65 Reputation points
2024-08-22T06:03:17.84+00:00

Referencing resources.containers via script doesn't work anymore today. I just suddenly stopped working today. The below are from official Azure documentation:

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/resources?view=azure-devops

 resources:
  containers:
  - container: mycontainer
    type: ACR
    azureSubscription: arm-connection
    resourceGroup: rg-storage-eastus
    registry: mycontainerregistry
    repository: hello-world
    trigger:
      tags:
      - latest

steps:
- script: echo |
    echo $(resources.container.mycontainer.type)
    echo $(resources.container.mycontainer.registry)
    echo $(resources.container.mycontainer.repository)
    echo $(resources.container.mycontainer.tag)
    echo $(resources.container.mycontainer.digest)
    echo $(resources.container.mycontainer.URI)
    echo $(resources.container.mycontainer.location)

Output:

Starting: CmdLine2
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.237.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
echo | echo $(resources.container.mycontainer.type) echo $(resources.container.mycontainer.registry) echo $(resources.container.mycontainer.repository) echo $(resources.container.mycontainer.tag) echo $(resources.container.mycontainer.digest) echo $(resources.container.mycontainer.URI) echo $(resources.container.mycontainer.location)
========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh
/azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh: line 1: resources.container.mycontainer.type: command not found
/azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh: line 1: resources.container.mycontainer.registry: command not found
/azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh: line 1: resources.container.mycontainer.repository: command not found
/azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh: line 1: resources.container.mycontainer.tag: command not found
/azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh: line 1: resources.container.mycontainer.digest: command not found
/azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh: line 1: resources.container.mycontainer.URI: command not found
/azp/_work/_temp/11182f8b-6bc4-4823-b4d8-54139b639573.sh: line 1: resources.container.mycontainer.location: command not found
echo echo echo echo echo echo

Finishing: CmdLine2

Also, today I noticed KubernetesManifest@0 is deprecated. Could it be something was changed when this is deprecated?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,592 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Ryan Hill 27,686 Reputation points Microsoft Employee
    2024-08-22T13:53:44.9633333+00:00

    @Lippy @Chris B you can report this issue over on the DevOps community forum, https://developercommunity.visualstudio.com/AzureDevOps/report. I checked https://learn.microsoft.com/en-us/azure/devops/release-notes/2024/pipelines/sprint-243-update and didn't see anything related to resources functionality so there could be a bug of some kind. Reporting it will provide the team with the necessary telemetry to determine the cause.


    @Lippy thank you posting https://developercommunity.visualstudio.com/t/Variables-are-missing-in-pipelines-conta/10727248. It appears there was a platform issue that has now been resolved.


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.