Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

PrePostDeploymentScript.ps1 is using Powershell session instead of Azure CLI #24

Open
IliyanKostov9 opened this issue Nov 13, 2023 · 0 comments

Comments

@IliyanKostov9
Copy link

IliyanKostov9 commented Nov 13, 2023

Problem:

We have migrated from using Azure Pipelines to Github actions. The workflow is required to authenticate to the Azure Platform via SPN by using azure/login@v1 action.
The SPN has Contribution access to the Data Factory IAM access.
However the pipeline is failing to complete the pre-deployment step to retrieve all of the active triggers at PrePostDeploymentScript.ps1

Logs:

Getting triggers
Get-AzDataFactoryV2Trigger: /home/runner/work/_actions/Azure/data-factory-deploy-action/v1.2.0/PrePostDeploymentScript.ps1:92
Line |
  92 |  … $triggers = Get-AzDataFactoryV2Trigger -ResourceGroupName $ResourceGr …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Run Connect-AzAccount to login.

Error: Process completed with exit code 1.

Possible root cause

Azure CLI has a separate logging session than Powershell, therefore the shell session in PrePostDeploymentScript.ps1 Is not authenticated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant