IntelliTect / IntelliTect/PSToolbox
New-AzureRMVirtualMachine Requires Bettter Error Handling
- Dominant language
- PowerShell
- Stars
- 10
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
When executing the New-AzureRMVirtualMachine command and filling in all the information, the script executed, output an error, then reported Success:
`
...
Creating new storage account
Creating new virtual network
Creating security group and rule
Creating new public IP address WITHOUT domain name
Creating new network interface
Creating VM configuration
Creating the VM ... this will take some time ...
New-AzureRmVM : The platform image 'MicrosoftVisualStudio:Windows:10-Enterprise-N:latest' is not available. Verify that all fields in the storage profile are correct.
ErrorCode: ImageNotFound
ErrorMessage: The platform image 'MicrosoftVisualStudio:Windows:10-Enterprise-N:latest' is not available. Verify that all fields in the storage profile are correct.
StatusCode: 404
ReasonPhrase: Not Found
OperationID : 1a477195-2bab-406a-bcbe-2115eae7bfe6
At C:\Program Files\WindowsPowerShell\Modules\IntelliTect.AzureRm\1.3.3.0\IntelliTect.AzureRm.psm1:235 char:5
- New-AzureRmVM -ResourceGroupName $Inputs.ResourceGroupName -Locat ...
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : CloseError: (:) [New-AzureRmVM], ComputeCloudException
- FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand
VM Created successfully
`
The script needs to have better error handling.
Contributor guide
Assessment
This issue has not been assessed yet.