Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.12k stars 3.76k forks source link

[Az.StreamAnalytics] wrong property used in Get-AzStreamAnalyticsDefaultFunctionDefinition.ps1 #25090

Open YanaXu opened 1 month ago

YanaXu commented 1 month ago

Description

Meet the error when run Get-AzStreamAnalyticsDefaultFunctionDefinition -Name 'txkcamvmzp' -JobName 'wsuxycmjxg' -ResourceGroupName 'otfqujpkad' -BindingType 'Microsoft.MachineLearning/WebService' -Endpoint 'omreptvhau' -UdfType 'Scalar'

InvalidOperation: C:\Users\abc\Documents\PowerShell\Modules\Az.StreamAnalytics\2.0.1\StreamAnalytics.Autorest\custom\Get-AzStreamAnalyticsDefaultFunctionDefinition.ps1:164
Line |
 164 |            $functionRetrieveDefaultDefinition.BindingRetrievalProperty …
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'BindingRetrievalPropertyEndpoint' cannot be found on this object. Verify that the property exists and can be set.

The source code:

$functionRetrieveDefaultDefinition = [Microsoft.Azure.PowerShell.Cmdlets.StreamAnalytics.Models.Api20170401Preview.AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters]::New()
$functionRetrieveDefaultDefinition.BindingType = $BindingType
$functionRetrieveDefaultDefinition.BindingRetrievalPropertyEndpoint = $Endpoint
$functionRetrieveDefaultDefinition.BindingRetrievalPropertyUdfType = $UdfType

Reproduce it like below.

PS D:> $functionRetrieveDefaultDefinition = [Microsoft.Azure.PowerShell.Cmdlets.StreamAnalytics.Models.Api20170401Preview.AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters]::New()
PS D:> $functionRetrieveDefaultDefinition

BindingType
-----------

PS D:\code\test\api_cov> $functionRetrieveDefaultDefinition | fl

BindingRetrievalPropertyExecuteEndpoint :
BindingRetrievalPropertyUdfType         :
BindingType                             :

PS D:> $functionRetrieveDefaultDefinition.BindingRetrievalPropertyEndpoint = 'abc'
InvalidOperation: The property 'BindingRetrievalPropertyEndpoint' cannot be found on this object. Verify that the property exists and can be set.

Issue script & Debug output

In description

Environment data

N/A

Module versions

Latest source code.

Error output

No response

microsoft-github-policy-service[bot] commented 4 weeks ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @atpham256.

microsoft-github-policy-service[bot] commented 4 weeks ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @atpham256.