Azure-Player / azure.datafactory.tools

Tools for deploying Data Factory (v2) in Microsoft Azure
https://azureplayer.net/adftools
MIT License
219 stars 70 forks source link

Error when deleting credentials #403

Open cberthold opened 4 months ago

cberthold commented 4 months ago

Describe the bug An error is generated, using version 1.9.1, for missing variable $adfi when trying to remove a credential that is no longer in config files.

It appears on line 16 $adfi should be $adfInstance which then generates the error inside of Remove-AdfObject.ps

https://github.com/Azure-Player/azure.datafactory.tools/blob/517d2f0e1c2a8a3aa9e4205845170bde875aed57/private/Remove-AdfObjectRestAPI.ps1#L16

Exception: /home/runner/.local/share/powershell/Modules/azure.datafactory.tools/1.9.1/private/Remove-AdfObject.ps1:134
Line |
 134 |          throw $ErrorMessage
     |          ~~~~~~~~~~~~~~~~~~~
     | The variable '$adfi' cannot be retrieved because it has not been set.
Error: Process completed with exit code 1.

To Reproduce Your script to reproduce the behaviour:

1. Create credential
2. Deploy nothing
3. See error

Expected behaviour Credential was deleted

Screenshots If applicable, add screenshots to help explain your problem.

Version of PowerShell module of:

Provide all files to reproduce the issue

NowinskiK commented 2 months ago

To be precise: Is this happening when you use DeleteNotInSource flag enabled?