0
votes

I'm unable to run Azure Powershell commands, as of now I'm trying to assign a static local IP to my VM by doing so:

Get-AzureVM -ServiceName XenApp-Azure -Name XenApp-Azure | Set-AzureStaticVNetIP -IPAddress 10.0.0.4 | Update-AzureVM

This command tells me

No default subscription has been designated. Use Select-AzureSubscription -Default to set the default subscription.

To which I've tried both below

Select-AzureSubscription -SubscriptionName Pay-As-You-Go

Select-AzureSubscription -Default Pay-As-You-Go

Both command tell me that subscription doesn't not exist, even though this:

Login-AzureRmAccount

Returns this after a successful login:

Account          : [email protected]
SubscriptionName : Pay-As-You-Go
SubscriptionId   : guid
TenantId         : guid
Environment      : AzureCloud

To which I've tried:

Add-AzureAccount

Which returns:

No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Login-AzureRmAccount?

Which is non sense because I created the VM through the Azure portal and I have enough access to be remoted in through RDP. I am owner of this "non-existing" subscription.

What is happening here ?

1
Are you able to go on : manage.windowsazure.com and view the machine ? Are you in the Service administrator and/or co-administrator group of your subscription ? You might be global administrator on the portal.azure.com user interface but if you did not have at all a classic subscription tied to your account or not enough right, this could happens. This happened to me. Can you confirm you can access to manage.windowsazure.com go in the settings and see you listed as Service administrator and/or co-administrator ?Sage Pourpre
Try Select-AzureRMSubscription instead of the Select-AzureSubscription after Login-AzureRMAccount. The non-RM version of the cmdlet are for the classic interfaces / resources. Also, is your VM a classic or ARM deployment ?Sage Pourpre
Which version of your Azure PowerShell? please run this command to check it. Get-Module -ListAvailable -Name Azure -Refresh.Jason Ye
Does this issue solved? please let me know if you need more help:)Jason Ye

1 Answers

0
votes

You will have to be the Admin or Co-admin for the subscription. Ask the admin to add you as co-admin and then try running the scripts.