Describe the bug
It seems that as of this morning the pipelines using variables created from the Terraform Output task are not being passed the value assigned to them into subsequent steps. Our last successful deployment was approx. 9 hours ago which was prior to the 0.6.24 release.
To Reproduce
Steps to reproduce the behavior:
- Setup pipeline as (include yaml configuration or screenshots of classic ui editor)
The first template has the Terraform Output task and the second template takes in a variable created by the Terraform Output task, in this case TF_OUT_BEDROCK_KEY_VAULT_NAME
- template: templates/deploy-infrastructure.yaml@commonPipeline
parameters:
Action: deploy
AzureServiceConnection: ${{parameters.AzureServiceConnection}}
AzureRegion: ${{parameters.AzureRegion}}
SubscriptionId: ${{parameters.SubscriptionId}}
Environment: ${{parameters.Environment}}
EnvironmentTier: ${{parameters.EnvironmentTier}}
OrganizationalPrefix: ${{parameters.OrganizationalPrefix}}
TerraformBackingStoreResourceGroupName: rg-terraform-${{parameters.Environment}}
TerraformBackingStoreResourceGroupLocation: $(bootstrapAzureRegion)
TerraformBackingStoreStorageAccountName: $(ArmOutputs.tfStateSAName)
TerraformBackingStoreContainerName: ${{parameters.TerraformBackingStoreContainerName}}
TerraformBackingStoreStateFileName: 'vantage-insight/terraform.tfstate'
WorkingPath: $(Agent.BuildDirectory)/self
InfrastructureRelativePath: iac/insight
- template: templates/retrieve-powerplatformpipelinecontext.yaml@commonPipeline
parameters:
AzureServiceConnection: ${{parameters.AzureServiceConnection}}
KeyVaultName: $(TF_OUT_BEDROCK_KEY_VAULT_NAME)
ClientIdSecretName: 'PowerPlatform--ClientId'
ClientSecretSecretName: 'PowerPlatform--ClientSecret'
ClientIdPipelineVariableName: 'POWER_PLATFORM_AZDO_CLIENT_ID'
ClientSecretPipelineVariableName: 'POWER_PLATFORM_AZDO_CLIENT_SECRET'
ScriptWorkingPath: $(Agent.BuildDirectory)/commonPipeline
The output variable is passed into another
- Execute pipeline
- See error
Expected behavior
The expected behavior would have been that the pipelines would have continued to work after the update.
Screenshots
If applicable, add screenshots to help explain your problem.
After Terraform Output task:
Terraform Output variable passed into powershell script:
Last successful deployment was 9 hours ago, right before the 0.6.24 release:
Pipeline Logs
Include logs that help demonstrate the problem. Please make sure to redact any sensitive info such as secrets.
2021-05-25T19:34:08.4185095Z ##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
2021-05-25T19:34:09.4957143Z ##[command]Clear-AzContext -Scope Process
2021-05-25T19:34:10.3671957Z ##[command]Connect-AzAccount -ServicePrincipal -Tenant *** -Credential System.Management.Automation.PSCredential -Environment AzureCloud @processScope
2021-05-25T19:34:12.7576259Z ##[command] Set-AzContext -SubscriptionId ************ -TenantId ***
2021-05-25T19:34:13.8896322Z VERBOSE: Leaving Initialize-AzModule.
2021-05-25T19:34:16.6017284Z ##[debug]Error record:
2021-05-25T19:34:16.6623742Z ##[debug]TF_OUT_BEDROCK_KEY_VAULT_NAME : The term 'TF_OUT_BEDROCK_KEY_VAULT_NAME' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2021-05-25T19:34:16.6637643Z ##[debug]At D:\a_temp\e531ed91-0558-4dd1-8c95-52d2dccbf8b8.ps1:37 char:91
2021-05-25T19:34:16.6652120Z ##[debug]+ ... eVariable.ps1' -KeyVaultName "$(TF_OUT_BEDROCK_KEY_VAULT_NAME)" -KeyV ...
2021-05-25T19:34:16.6666142Z ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-05-25T19:34:16.6679787Z ##[debug] + CategoryInfo : ObjectNotFound: (TF_OUT_BEDROCK_KEY_VAULT_NAME:String) [], ParentContainsErrorRecordExce ption
2021-05-25T19:34:16.6696055Z ##[debug] + FullyQualifiedErrorId : CommandNotFoundException
2021-05-25T19:34:16.6710445Z ##[debug]
2021-05-25T19:34:16.6732933Z ##[debug]Script stack trace:
2021-05-25T19:34:16.6782038Z ##[debug]at , D:\a_temp\e531ed91-0558-4dd1-8c95-52d2dccbf8b8.ps1: line 37
2021-05-25T19:34:16.6795742Z ##[debug]at , : line 1
2021-05-25T19:34:16.6817052Z ##[debug]Exception:
2021-05-25T19:34:16.6863659Z ##[debug]System.Management.Automation.ParentContainsErrorRecordException: The term 'TF_OUT_BEDROCK_KEY_VAULT_NAME' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2021-05-25T19:34:16.7055356Z ##[error]The term 'TF_OUT_BEDROCK_KEY_VAULT_NAME' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2021-05-25T19:34:16.7057151Z ##[debug]Processed: ##vso[task.logissue type=error]The term 'TF_OUT_BEDROCK_KEY_VAULT_NAME' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2021-05-25T19:34:16.7737768Z ##[debug]Exit code: 1
2021-05-25T19:34:16.7779954Z ##[debug]Leaving Invoke-VstsTool.
Agent Configuration
Agent name: 'Hosted Agent'
Current agent version: '2.186.1'
Operating System Microsoft Windows Server 2019
Terraform v0.13.3
AzureCLI 2.1.0
Additional context
It seems the problem started occurring after the 0.6.24 release of pipeline tasks