aws-toolkit-azure-devops icon indicating copy to clipboard operation
aws-toolkit-azure-devops copied to clipboard

Credentials are not working in inline powershell script

Open fivanec opened this issue 4 years ago • 1 comments

Hi, I added the "AWS Tools for Windows PowerShell Script" task to my Azure DevOps pipeline, then I added my valid AWS credentials using AWS Service Connection (input AccessKeyID and SecretAccessKey in popup window), then choose "Inline Script" option and input my powershell script: New-CFInvalidation -DistributionId 'XXXXX' -Paths_Item ' /*'

When I trigger my pipeline I got the following error: New-CFInvalidation : No credentials specified or obtained from persisted/shell defaults. At C:\agent_work_temp\e6ffb344-ff94-47e4-b5b8-2d5801faab61.ps1:5 char:11

$result = New-CFInvalidation -DistributionId 'XXXX' -Paths_Item ' /*

  • CategoryInfo : InvalidOperation: (Amazon.PowerShe...alidationCmdlet:NewCFInvalidationCmdlet) [New-CFInv

alidation], InvalidOperationException

  • FullyQualifiedErrorId : InvalidOperationException,Amazon.PowerShell.Cmdlets.CF.NewCFInvalidationCmdlet

The AWS Service Connection works if I use it for "AWS CLI" task in my pipeline.

Regards, Alexander

fivanec avatar Aug 16 '19 11:08 fivanec

HI @fivanec , can you tell us these things: Your Environment

  • VSTS or Azure Devops (on-prem or cloud based?):
  • VSTS or Azure Devops version:
  • AWS VSTS Tools version:

hunterwerlla avatar Aug 16 '19 15:08 hunterwerlla