Azure / Azure/azure-powershell
[Az.StreamAnalytics] wrong property used in Get-AzStreamAnalyticsDefaultFunctionDefinition.ps1
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
Meet the error when run `Get-AzStreamAnalyticsDefaultFunctionDefinition -Name 'txkcamvmzp' -JobName 'wsuxycmjxg' -ResourceGroupName 'otfqujpkad' -BindingType 'Microsoft.MachineLearning/WebService' -Endpoint 'omreptvhau' -UdfType 'Scalar'`
```powershell
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:
```powershell
$functionRetrieveDefaultDefinition = [Microsoft.Azure.PowerShell.Cmdlets.StreamAnalytics.Models.Api20170401Preview.AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters]::New()
$functionRetrieveDefaultDefinition.BindingType = $BindingType
$functionRetrieveDefaultDefinition.BindingRetrievalPropertyEndpoint = $Endpoint
$functionRetrieveDefaultDefinition.BindingRetrievalPropertyUdfType = $UdfType
```
Reproduce it like below.
```powershell
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
```PowerShell
In description
```
### Environment data
```PowerShell
N/A
```
### Module versions
```PowerShell
Latest source code.
```
### Error output
_No response_
Contributor guide
Research direction
Start in custom/Get-AzStreamAnalyticsDefaultFunctionDefinition.ps1 at line 164 and inspect the AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters properties shown in the report. Reproduce the command or instantiate the parameter object in PowerShell, then correct the mismatched property reference and verify that the cmdlet accepts the Endpoint and UdfType values without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100