azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

IOTHub - Proper error message not shown when sku is missing while creating a new IotHub using New-AzureRmResource

Open rajaprad opened this issue 10 years ago • 6 comments

Hi,

Am trying to create IOTHub with the following command. Please look into the same.

New-AzureRmResource -ResourceName "IotHubSample1" -ResourceType Microsoft.Devices/Iothubs -ResourceGroupName Poc -Location "East US" -Properties @{ Location="East US"}

Confirm Are you sure you want to create the following resource: /subscriptions/xxxxxxxxxxxx/resourceGroups/Poc/providers/Microsoft.Devices/Iothubs/IotHubSample1 [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y New-AzureRmResource : The pipeline has been stopped. At line:1 char:1

  • New-AzureRmResource -ResourceName "IotHubSample1" -ResourceType Microsoft.Device ...
  • - CategoryInfo          : CloseError: (:) [New-AzureRmResource], PipelineStoppedException
    - FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet
    
    

New-AzureRmResource : A task was canceled. At line:1 char:1

  • New-AzureRmResource -ResourceName "IotHubSample1" -ResourceType Microsoft.Device ...
  • - CategoryInfo          : CloseError: (:) [New-AzureRmResource], TaskCanceledException
    - FullyQualifiedErrorId : A task was canceled.,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet
    
    

Thanks, Pradebban Raja

rajaprad avatar Mar 17 '16 13:03 rajaprad

@Pradebban - If I specify a Sku for the IOT hub, the hub gets created successfully. New-AzureRmResource -ResourceName IotHubSample111 -ResourceType Microsoft.Devices/IotHubs -ResourceGroupName test111 -Location EastUs -Properties @{Location="EastUS"} -SkuObject @{name="s1"; tier="standard"; capacity="1"} -Debug

ravbhatnagar avatar Apr 07 '16 18:04 ravbhatnagar

@ravbhatnagar - Thanks, But the error is misleading and has no mention that the -SkuObject missing

rajaprad avatar Apr 07 '16 19:04 rajaprad

Agreed that the error message is not helpful. I will see what we can do to improve in this scenario. II will update the title to accurately reflect what needs to be fixed.

More info - SkuObject is not a required parameter and so the cmdlet does not fail for that reason. It happens that the Sku seems to be required when creating a resource of this type. In most cases we should return the error we get back from the resource provider. It looks like an issue of the resource provider not giving back an appropriate error message. We will investigate.

ravbhatnagar avatar Apr 07 '16 21:04 ravbhatnagar

@tianoMs - please see if we can improve the message in this case? Why is it showing a Task was cancelled message. Are we not getting a better error from the RP?

ravbhatnagar avatar May 27 '16 23:05 ravbhatnagar

Fixed for July release

ravbhatnagar avatar Jun 17 '16 20:06 ravbhatnagar

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

ghost avatar Aug 14 '19 19:08 ghost