New-AzureQuickVM - InternalError : The server encountered an internal error. Ple

Hi, I am struggling since 2 days to make this simple command works, even I posted a thread to MSDN forums as I expected that it will be resolved or get hint to fix it but this is not the case (https://social.msdn.microsoft.com/Forums/azure/en-US/89ee1874-3753-4080-988f-8fb1b99f390e/newazurequickvm-internalerror-the-server-encountered-an-internal-error-please-retry-the?forum=WAVirtualMachinesforWindows)

I trying to create a VM as follows, using 2 different options but non is working always getting the error :
New-AzureQuickVM : InternalError : The server encountered an internal error. Please retry the request.
At line:1 char:1

  • New-AzureQuickVM -Windows -ImageName $imagename -InstanceSize “ExtraSmall” -Pass …
  •   + CategoryInfo          : CloseError: (:) [New-AzureQuickVM], CloudException
      + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.PersistentVMs.NewQuickVM
    
    

Here are the 2 scripts

$location = “North Europe”

$imagename = “a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201503.01-en.us-127GB.vhd”

CREATE A NEW VM IN A NEW CLOUD SERVICE

New-AzureQuickVM
-Windows
-ImageName $imagename
-InstanceSize “ExtraSmall”
-Location $location
-Password “myâssword”
-Name “sieracDevOps”
-ServiceName “sieracDevOpsPro”
-AdminUsername “myuser”

CREATE A NEW VM IN A EXISTING CLOUD SERVICE

New-AzureQuickVM
-Windows
-ImageName $imagename
-InstanceSize “ExtraSmall”
-Password “myâssword”
-Name “sieracDevOps2”
-ServiceName “sieracDevOpsPro”
-AdminUsername “myuser”

I even went to the Azure portal, created new VM successfully, then delet it and tried again with the same cloud service, now way, always the same error. What is really annoying is that it does not say what is the problem
Thanks for your help

Do your actual scripts have the parameters on their own lines like that? If so, you need to have backticks at the end of each line to indicate that the command continues on the next line. Many in the community tend to frown on that practice, though, and prefer either having all of the parameters on one line, or using splatting.

No Dave, In my ISE, they are all on 1 line, it is just a copy from the other thread

Hey there Salam,

Does it work if you replace the “Extra Small” stated in the instance size, with an instance listed on your service location? Like here are the instances available at the Central US location and the associated VM sizes.

Edit - Just saw that ExtraSmall is listed. Try taking it out of the quotes?

DisplayName : Central US
Name : Central US
AvailableServices : {Compute, Storage, PersistentVMRole, HighMemory}
WebWorkerRoleSizes : {A5, A6, A7, ExtraLarge, ExtraSmall, Large, Medium, Small, Standard_D1, Standard_D11, Standard_D12, Standard_D13,
Standard_D14, Standard_D2, Standard_D3, Standard_D4}
VirtualMachineRoleSizes : {A5, A6, A7, Basic_A0, Basic_A1, Basic_A2, Basic_A3, Basic_A4, ExtraLarge, ExtraSmall, Large, Medium, Small,
Standard_D1, Standard_D11, Standard_D12, Standard_D13, Standard_D14, Standard_D2, Standard_D3, Standard_D4}
StorageAccountTypes : {Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS}
OperationDescription : Get-AzureLocation
OperationId : c0bf54d8-897d-8bf9-a0b0-3cfe46e209b2
OperationStatus : Succeeded

I did, got the same error

Yeah. I was able to create the VMs using the same conditions. Is this your first time building a VM through PowerShell, or have you been able to do it successfully before?

Also, just a shot in the dark, but you might want to check and see if you’ve exceeded your usage limit. It appears other people have had similar errors when they blow over their allocated amount.

Hmmm…if Will is able to do it with the same script, i’d hazard a guess it’s to do with your subscription, as once that’s defined you don’t really need to refer to it much again (unless you have more than one subscription).

Have you created and assigned a default storage account to your subscription?

Also, can you give the details you get if you do :

Get-AzureSubscription

It is MSDN ultimate subscription I use since 1 year, I have never created any VM earlier. I do a lot of POcs around service buis and Biztalk services.

Here is the output of the command

SubscriptionName : Services de la plateforme Windows Azure pour Visual Studio Ultim
SubscriptionId : c9a25b0e-bbd2-4205-8b89-57f6ab387a16
ServiceEndpoint : https://management.core.windows.net/
ResourceManagerEndpoint : https://management.azure.com/
GalleryEndpoint : https://gallery.azure.com/
ActiveDirectoryEndpoint : https://login.windows.net/
ActiveDirectoryTenantId : e6df76-8fdb-4f16-ab6c-************
IsDefault : True
Certificate : [Subject]
CN=Windows Azure Tools

                        [Issuer]
                          CN=Windows Azure Tools
                        
                        [Serial Number]
                          **********88B9549F8972CF801A38C
                        
                        [Not Before]
                          01/02/2013 14:01:52
                        
                        [Not After]
                          01/02/2014 14:01:52
                        
                        [Thumbprint]
                          *****************F9E59516********

CurrentStorageAccountName : salam
ActiveDirectoryUserId :*************@free.fr
TokenProvider : Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication.AdalTokenProvider

“Have you created and assigned a default storage account to your subscription?”, Yes I have,

portalvhdscyskz2gkwj821 complete Online North Europe Services de la plateforme Windows Azure pour Visual Studio Ultim
salam complete Online North Europe Services de la plateforme Windows Azure pour Visual Studio Ultim
salamelias complete Online North Europe Services de la plateforme Windows Azure

salam and salamelias have been created long time ago for Blobs, queues and topics

portalvhdscyskz2gkwj821 , I think it was created today following the creation of the 1st VM with a new service name. My subscription is has “CurrentStorageAccountName : salam”, might this be the source of the error? because it is used for different things? If yes, what is the command to switch my subscription to another storage
Thanks

It is MSDN ultimate subscription I use since 1 year, I have never created any VM earlier. I do a lot of POcs around service buis and Biztalk services.

Here is the output of the command

[blockquote]SubscriptionName : Services de la plateforme Windows Azure pour Visual Studio Ultim
SubscriptionId : c9a25b0e-bbd2-4205-8b89-57f6ab387a16
ServiceEndpoint : https://management.core.windows.net/
ResourceManagerEndpoint : https://management.azure.com/
GalleryEndpoint : https://gallery.azure.com/
ActiveDirectoryEndpoint : https://login.windows.net/
ActiveDirectoryTenantId : e6df76-8fdb-4f16-ab6c-************
IsDefault : True
Certificate : [Subject]
CN=Windows Azure Tools

                        [Issuer]
                          CN=Windows Azure Tools
                        
                        [Serial Number]
                          **********88B9549F8972CF801A38C
                        
                        [Not Before]
                          01/02/2013 14:01:52
                        
                        [Not After]
                          01/02/2014 14:01:52
                        
                        [Thumbprint]
                          *****************F9E59516********

CurrentStorageAccountName : salam
ActiveDirectoryUserId :*************@free.fr
TokenProvider : Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication.AdalTokenProvider

[/blockquote]“Have you created and assigned a default storage account to your subscription?”, Yes I have,

portalvhdscyskz2gkwj821 complete Online North Europe Services de la plateforme Windows Azure pour Visual Studio Ultim
salam complete Online North Europe Services de la plateforme Windows Azure pour Visual Studio Ultim
salamelias complete Online North Europe Services de la plateforme Windows Azure

salam and salamelias have been created long time ago for Blobs, queues and topics

portalvhdscyskz2gkwj821 , I think it was created today following the creation of the 1st VM with a new service name. My subscription is has “CurrentStorageAccountName : salam”, might this be the source of the error? because it is used for different things? If yes, what is the command to switch my subscription to another storage
Thanks

Hey there Salam,

This can walk you through:

http://foxdeploy.azurewebsites.net/2013/12/07/azure-powershell-current-storage-account-error-when-making-a-new-vm/

Set-AzureSubscription -SubscriptionName %subscriptionname% -CurrentStorageAccountName (Get-AzureStorageAccount).Label -PassThru

I have seen this thread this morning. The
[blockquote][Get-AzureStorageAccount].Label
[/blockquote]
generates the following error

[blockquote]Set-AzureSubscription : Cannot convert ‘System.Object[]’ to the type ‘System.String’ required by parameter ‘CurrentStorageAccountName’. Specified
method is not supported.
[/blockquote]So I replaced it with the name of the new storgae name that was created 2 hours back when I created the 1st VM

Then I decided to do the following :
-declared 2 new variables
[blockquote]$subscriptionname = “Services de la plateforme Windows Azure pour Visual Studio Ultim”
$CurrentStorageAccountNameLabel = “portalvtttcyskz2gkwj821”
[/blockquote]
Rerun myscript, and HOOOOOOOOP everything worked like a charm and I have my VM now up and running. SO MANY thanks for all your help.

Question: From time to time, my PS session with azure gets expired in spite of the fact that I do Importpublishing file, I need always to od a add-account, enter email and password to continue working. Is there any possible way to enter credentials so whenever I fire ISE or PS I dont need to enter my credentials

Thanks again

Hi there Salam,

Can you verify that the certificate is installed on the machine and that the chain is showing as trusted?

Also, I haven’t tested these myself, but Sapien wrote up a promising blog on alternative methods for passing your credentials.

http://www.sapien.com/blog/2014/10/23/saving-passwords-for-add-azureaccount/

Let me know if that helps!

Will, which Certificate you are refering to?
Can you please let me know if possible in which part of Azure I can find it and download it?
Do you mean that if I have the certifciate chain, when opening a new PS window, I will not need to go through any login cmdlet

Thanks

Hey there Salam,

If you’re using the Import-AzurePublishSettingsFile method, it imports a certificate with your credentials. I was asking if you can verify that the certificate is actually installing?

I have done several times, Import-AzurePublishSettingsFile , especially yesterday. In my Certifciates >> personal >> certificates, I have 1 for my servicebus.biztalk.windows.net, a 2nd one called “Windows Azure Tools” (expired on Feb 2014, the 1st one is also in the local computer account personal certificates.
What should be the name of the certificate dispalyed in mmc?

Hey there Salam,

Just clarifying, did you say the Azure Tools certificate is expired?

Yes Sir, here is a snapshot

Will, I checked my azure portal, I have generated 1 year back a valid certificate which I used on another machine. I imported and installed the pfx fiile. However, when I run

Import-AzurePublishSettingsFile -SubscriptionDataFile ‘Ultim-3-30-2015-credentials.publishsettings’ (which I downloaded recently from Azure), I get

[blockquote]Import-AzurePublishSettingsFile : There is an error in XML document (2, 2).
At line:1 char:1

  • Import-AzurePublishSettingsFile -SubscriptionDataFile 'Ultim-3-30-2015-credentia …
  •   + CategoryInfo          : CloseError: (:) [Import-AzurePublishSettingsFile], InvalidOperationException
      + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.ImportAzurePublishSettingsCommand[/blockquote]
    
    

I tried
[blockquote]Import-AzurePublishSettingsFile -PublishSettingsFile[/blockquote]

it did not help neither

[blockquote]Import-AzurePublishSettingsFile : There is an error in XML document (0, 0).
At line:1 char:1

  • Import-AzurePublishSettingsFile -PublishSettingsFile Ultim-3-30-2015-credentials …[/blockquote]

[blockquote]{content}[/blockquote]

Hey there Salam. I’m doing some research on this and I’ll see if I can reach out to the rest of the team to get you a quick answer.

Will, I have the impression that Azure Powershell is not stable. This morning, I managed to do a
[blockquote]Add-AzureAccount - -SubscriptionDataFile Ultim-3-30-2015-credentials.publishsettings
[/blockquote]
which prompted me to enter my email and passwor for Azure and was able to work for a while (I don’t understand why I got prompted as I understood that providing credentials should allow me to not having the popup).

1 hour later as I am following a session on channel 9 “Transform Your IT Skills in a DevOps World”, I came across some stuff where I udnerstood that I need to get my hosing plan name and environments. My 2 machines, when I issued some cmdlets, like “:black_medium_small_square:Get-AzureWebHostingPlan” I got errors indicating that "The term blah blah is not recognized.

I downloaded and isntalled the latest version of azure powershell sdk using Web platform install, rebooted, and hoop, whenevr I issue the following command
[blockquote]Import-AzurePublishSettingsFile -SubscriptionDataFile “Mysub-3-30-2015-credentials.publishsettings” or
Import-AzurePublishSettingsFile -PublishSettingsFileMysub-3-30-2015-credentials.publishsettings[/blockquote]

I get

[blockquote]Import-AzurePublishSettingsFile : A parameter cannot be found that matches parameter name ‘SubscriptionDataFile’.
At line:1 char:33

  • Import-AzurePublishSettingsFile -SubscriptionDataFile "Ultim-3-30-201 …
  •                             ~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: [:] [Import-AzurePublishSettingsFile], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.WindowsAzure.Commands.Profile.ImportAzurePublishSettingsCommand
      [/blockquote]
      Or

[blockquote]Import-AzurePublishSettingsFile : There is an error in XML document [1, 1].
At line:1 char:1

  • Import-AzurePublishSettingsFile -PublishSettingsFile Ultim-3-30-2015- …
  •   + CategoryInfo          : CloseError: [:] [Import-AzurePublishSettingsFile], InvalidOperationException
      + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.ImportAzurePublishSettingsCommand
    

[/blockquote]
I was able to connect, as I said with add-azureaccount, running a command

[blockquote]Get-AzureWebHostingPlan
[/blockquote]was successful and got the details for 1 plan .

I am looking forward for your feedback. By the way, when creating a new resource using the command “New-AzureResourceGroup”, it seems that I need to provide value for “Environment”, when I do
Get-AzureEnvironment
I get a couple of items, with names “AzureChinaCloud”, “AzureCloud”, so should it be one of those values that I need to enter?