Skip to content

Publish-AdfV2FromJson unable to delete resources on edge cases #473

Closed

Description

@jikuja

Describe the bug
Get-AzDatafactoryV2 Cmdlet calls might fail because Azure Management API is returning data that is not compatible with SDK being used by CmdLets. Examples here: Azure/azure-powershell#12550

Hidden error on our use case:

ExceptionDepth      : 0
Message             : Unable to deserialize the response.
ScriptStackTrace    : at Get-AdfFromService, /home/vsts/work/1/s/powershellmodules/azure.datafactory.tools/1.13.0/public/Get-AdfFromService.ps1: line 44
                      at Publish-AdfV2FromJson, /home/vsts/work/1/s/powershellmodules/azure.datafactory.tools/1.13.0/public/Publish-AdfV2FromJson.ps1: line 280
                      at <ScriptBlock>, /home/vsts/work/1/s/.azure-pipelines/Deploy.ps1: line 139
                      at <ScriptBlock>, /home/vsts/work/_temp/123f0676-be83-4bd6-830b-157d88b8d8c2.ps1: line 5
                      at <ScriptBlock>, <No file>: line 1
ExceptionType       : Microsoft.Rest.SerializationException
ExceptionStackTrace :    at Microsoft.Azure.Management.DataFactory.LinkedServicesOperations.ListByFactoryWithHttpMessagesAsync(String resourceGroupName, String factoryName, Dictionary`2 customHeaders,
                       CancellationToken cancellationToken)
                         at Microsoft.Azure.Management.DataFactory.LinkedServicesOperationsExtensions.ListByFactoryAsync(ILinkedServicesOperations operations, String resourceGroupName, String factoryN
                      ame, CancellationToken cancellationToken)
                         at Microsoft.Azure.Management.DataFactory.LinkedServicesOperationsExtensions.ListByFactory(ILinkedServicesOperations operations, String resourceGroupName, String factoryName)
                         at Microsoft.Azure.Commands.DataFactoryV2.DataFactoryClient.ListLinkedServices(AdfEntityFilterOptions filterOptions)
                         at Microsoft.Azure.Commands.DataFactoryV2.DataFactoryClient.FilterPSLinkedServices(AdfEntityFilterOptions filterOptions)
                         at Microsoft.Azure.Commands.DataFactoryV2.GetAzureDataFactoryLinkedServiceCommand.ExecuteCmdlet()
                         at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()

In this case Get-AdfFromService does not get any linked services with Get-AzDataFactoryV2LinkedService as a result Publish-AdfV2FromJson / $adfIns does not contain any linked service information and therefore linked services are not removed from service even if they should be removes

Also Publish-AdfV2FromJson print error message but does not explain where it comes and what is caused by that:

Image

To Reproduce

Linked issue has example of Amazon S3 linked service setup.

Expected behaviour

Get-AdfFromService should return all resources for further use

Version of PowerShell module of:

  • ver 1.13.0

Potential fixes

  • Maintain own version of CmdLets instead of relying on Az.Datafactory
  • Check if CmdLet errored. Is there even different signaling for Linked services not found and Cmdlet had internal issues
  • TBD

Activity

  1. added
    triage
    on Dec 4, 2025
  2. self-assigned this
    on May 27, 2026
  3. added
    defect
    and removed
    triage
    on May 27, 2026
  4. NowinskiK commented on May 27, 2026

    @NowinskiK
    Member

    Preview version, which includes the fix is released as 1.16.0-preview (https://www.powershellgallery.com/packages/azure.datafactory.tools/1.16.0-preview)

  5. linked a pull request that will close this issueFixed #480 (preview) #489on May 27, 2026
  6. added this to the v1.17 milestone on Jun 9, 2026
  7. NowinskiK commented on Jun 30, 2026

    @NowinskiK
    Member

    This issue should be resolved by #480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

defect

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions