Skip to content

AzurePS 0.8.13 :: Azure Virtual Machine commands silently fail #115

@pcgeek86

Description

@pcgeek86

Say, for instance, you are running:

  • Windows 8.1
  • Windows Management Framework Core 5.0 November 2014 Preview (PowerShell 5.0)
  • Microsoft Azure PowerShell module version 0.8.13.

And you have the following configuration:

  • You authenticate to Azure using the Add-AzureAccount command from PowerShell, with the -Credential parameter, using an Azure Active Directory (AAD) Organizational Account.
  • The account you authenticate to Azure with has co-administrator access to more than one Azure platform subscription.
  • One of your two subscriptions has a cloud service with an Azure virtual machine provisioned, and running, inside of it.

Finally, you perform the following steps:

  1. You use the Select-AzureSubscription command to select the Azure subscription that does not have the cloud service / virtual machine in it.
  2. You call the Stop-AzureVM or Export-AzureVM commands against the cloud service / virtual machine. (eg. Stop-AzureVM -ServiceName mycloudsvc -Name vm01 -Force;)
  3. No error / exception is thrown, and the command silently returns.
  4. You add the -Verbose parameter to either command, and still, no output is emitted.
  5. You somehow (magically) realize that you have the wrong subscription selected.
  6. You begin ripping your hair out.
  7. You select the correct Azure subscription and proceed normally.

Given the previous scenario, is it possible to thrown an exception when the specified cloud service / virtual machine is not found, for all of the VM-related commands? It seems like poor design to silently fail, without notifying the end user (me) what is [not] occurring in the background, and why, and how to resolve it.

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell
http://twitter.com/pcgeek86
http://trevorsullivan.net

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions