Skip to content

Credentials are not working in inline powershell script #287

Open
@fivanec

Description

@fivanec

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-responseWaiting on additional info and feedback from GitHub community.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions