Azure / Azure/azure-powershell
New-AzAutoscaleRule command's rule parameters cannot be empty.
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
New-AzAutoscaleProfile command's rule parameters cannot be empty.
So, New-AzAutoscaleProfile command cannot create Auto Scaling for 'Scale to a specific instance count'.
### Issue script & Debug output
```PowerShell
Related Issue.
https://github.com/Azure/azure-powershell/issues/12903
$Profile = New-AzAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -StartTimeWindow 2015-03-05T14:00:00 -EndTimeWindow 2015-03-05T14:30:00 -TimeWindowTimeZone GMT -Name "Sample" -Rule $Empty
Error↓
New-AzAutoscaleProfile : Parameters 'Unable to verify Rule argument. The argument is null. Please specify a valid value for the argument and rerun the command.
$Profile = New-AzAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -StartTimeWindow 2015-03-05T14:00:00 -EndTimeWindow 2015-03-05T14:30:00 -TimeWindowTimeZone GMT -Name "Sample" -Rule $null
Error↓
New-AzAutoscaleProfile : Parameters 'Unable to verify Rule argument. The argument is null. Please specify a valid value for the argument and rerun the command.
```
### Environment data
```PowerShell
Name Value
---- -----
PSVersion 5.1.19041.1320
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1320
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```
### Module versions
```PowerShell
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.7.2 Az.Accounts {Add-AzEnvironment, Clear-AzContext, Clear-AzDefault, Connect-AzAccount...}
Script 3.0.0 Az.Monitor {Add-AzAutoscaleSetting, Add-AzLogProfile, Add-AzMetricAlertRule, Add-AzMetricAlertRuleV2...}
```
### Error output
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.