0
votes

I am working with classic resources in Azure. I am running Azure powershell version 2.0.1 (updated it to see if that solved the issue below). I was wanting to check my list of VIPS, and am running some script I had for this in powershell.

$deployment = Get-AzureDeployment -ServiceName servicenamehere
$deployment.VirtualIPs

I am now getting the error

Get-AzureDeployment : Account with name '​' does not exist.
Parameter name: accountName
At line:1 char:15
+ $deployment = Get-AzureDeployment -ServiceName servicenamehere
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzureDeployment], ArgumentException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand

A variety of other statements return with the same error "Account with name '' does not exist." This was all executed after logging in and selecting my subscription, which works fine:

Add-AzureAccount
Select-AzureSubscription -SubscriptionName "subscriptionnamehere"​

Any ideas on what is occurring on the statements that makes them fail with this accountName issue? Unsure if this has to do with resource manager changes or anything else new added in the last few months in Azure.

Other statements fail with the same error. Example

Add-AzureVirtualIP -VirtualIPName newvipname -ServiceName servicenamehere

Gives the same error

Add-AzureVirtualIP : Account with name '​' does not exist.
Parameter name: accountName
1
Try Select-AzureSubscription -SubscriptionName "subscriptionnamehere" -Account "accountidhere" (use Get-AzureAccount to find correct account id)Mathias R. Jessen
Great, that worked! Wonder why I needed that now. We had changed to using Azure AD a couple months back, not sure if related.Donald Kratt

1 Answers

0
votes

You need to add the qouteation mark when adding a string.

Select-AzureSubscription -SubscriptionName "subnamame" -Account "acname"

This is typically required, especially when you have more then 1 parameter.