Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test-AdfLinkedService Class - Object issue cannot be found on this object #382

Open
aam-a opened this issue Feb 10, 2024 · 11 comments
Open
Assignees
Labels
question Further information is requested

Comments

@aam-a
Copy link

aam-a commented Feb 10, 2024

Currently trying to build a Powershell script to test connection of ADF Linked Services -using the Test-AdfLinkedService class for one of the two examples:

$params = @{
  DataFactoryName = 'xxxxxx'
  ResourceGroupName = 'xxxxxxx'
  SubscriptionID = 'xxxxxxx'
}

Example 1

$LinkedServiceName = 'LinkedServiceName'
$r = Test-AdfLinkedService @params -LinkedServiceName $LinkedServiceName
$r | Format-Table

Example 2

$LinkedServiceName = 'LinkedServiceName' # Comma-separated list
$r = Test-AdfLinkedService @params -LinkedServiceName $LinkedServiceName
$r.Report

Both failure due to The property 'succeeded' cannot be found on this object. Verify that the property exists.

Error:

The property 'succeeded' cannot be found on this object. Verify that the property exists.

At C:\...\...\Documents\WindowsPowerShell\Modules\azure.datafactory.tools\1.8.0\public\Test-AdfLinkedService.ps1:79 char:13
+         if ($null -ne $r -and $r.succeeded) {
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
@aam-a aam-a added the triage Issue is under investigation label Feb 10, 2024
@NowinskiK NowinskiK self-assigned this Feb 13, 2024
@NowinskiK
Copy link
Member

Did you check what your StrictMode is?
Try Set-StrictMode -Off and rerun the code.

@NowinskiK NowinskiK added question Further information is requested and removed triage Issue is under investigation labels Feb 13, 2024
@aam-a
Copy link
Author

aam-a commented Feb 14, 2024

Thank for the feedback - set , Set-StrictMode -Off
I am getting the same error

@aam-a
Copy link
Author

aam-a commented Mar 12, 2024

Does anyone have any suggestion of this issue?

@NowinskiK
Copy link
Member

Hi @aam-a , can you provide more information, for example, log from Azure DevOps agent?

@aam-a
Copy link
Author

aam-a commented Mar 14, 2024

@NowinskiK - Thank you for the response, -there general no logs to pull. Ultimately I run this via Powershell.
Can I confirm this Test-AdfLinkedService class actually working ?

@NowinskiK
Copy link
Member

Yes, it's working and has unit tests cover this command + I checked that on my local machine recently.

@aam-a
Copy link
Author

aam-a commented Mar 22, 2024

Thank you for the feedback, following your confirmation it is working. I have built new test environment, in which it is working accordingly, when run for individual ADF Service. I will now test again in my LIVE environment.

Noted - Same error is generated for all but the first one, if I do multiple ADF Services (separated by comma).

@NowinskiK
Copy link
Member

What do you mean by "ADF Service" here? Is ADF Service = ADF instance (cloud) or ADF Linked Service? (I hope the latter one).
Can you attach the log? Even if you run via PowerShell & Azure DevOps agent - you can download log content.

@aam-a
Copy link
Author

aam-a commented Mar 24, 2024

To confirm,, as per the class I am using, I meant ADF Linked Service(s).
Though it is a test env. There is still some sensitive data attached, will double check the full content of the logs, I will then attach accordingly if possible , thank you for the feedback

@NowinskiK
Copy link
Member

Of course, remove all sensitive information before sharing.
Alternatively, you can prepare PowerShell script along with additional files which run all required steps to prove what's wrong/happening, including: deploy ADF with objects, run tests.

@aam-a
Copy link
Author

aam-a commented Apr 10, 2024

As discussed there are no additional logs.
When trying to run the script separating the LinkedServices with comma, i.e.

$LinkedServiceName = 'LinkedServiceName', 'LinkedServiceName1', 'LinkedServiceName2'
$r = Test-AdfLinkedService @params -LinkedServiceName $LinkedServiceName
$r | Format-Table

It generates the following error:

Test-AdfLinkdedService: Cannot process argument transformation on paramter 'LinkedServiceName'. Cannot convert value to type System.String
At C:....... ps1:28 char:55
= ... = Test-AdfLinkdedService @paramas -LinkedServiceName $LinkedServiceName
      + CategoryInfo : InvalidData: (:) [Test-AdfLinkdedService], ParameterBindingArgumentTransformationException
      + FullyQualifiedErrorId : ParameterBindingArgumentTransformationException,Test-AdfLinkdedService

**Please note the script work fine, if do each LinkedService individually ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants