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

This topic contains 28 replies, has 5 voices, and was last updated by Profile photo of Salam Elias Salam Elias 1 year, 8 months ago.

  • Author
    Posts
  • #23781
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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

  • #23782
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    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.

  • #23783
    Profile photo of Salam Elias
    Salam Elias
    Participant

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

  • #23784
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    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

  • #23785
    Profile photo of Salam Elias
    Salam Elias
    Participant

    I did, got the same error

  • #23786
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    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.

  • #23788
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    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
    
  • #23792
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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

  • #23793
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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

  • #23794
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    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

  • #23800
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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

  • #23811
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    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.

    Let me know if that helps!

  • #23814
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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

  • #23817
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    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?

  • #23818
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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?

  • #23828
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    Hey there Salam,

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

  • #23830
    Profile photo of Salam Elias
    Salam Elias
    Participant

    Yes Sir, here is a snapshot

  • #23846
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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]

  • #23850
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    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.

  • #23851
    Profile photo of Salam Elias
    Salam Elias
    Participant

    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 "◾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?

  • #23852
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    Hi there Salam,

    I'm getting the impression that your azure profile locally is likely corrupted. I'm assuming that this is the only machine that you're experiencing the issue? You might want to look into whether running Clear-AzureProfile and then Get-AzurePublishSettingsFile to retrieve a new file and importing that to see if it resolves your issue.

  • #23853
    Profile photo of Salam Elias
    Salam Elias
    Participant

    Will, after writing my last response, I played with the following command as as test

    New-AzureResourceGroup `
    -hostingEnvironment AzureCloud `
    -Name galleryARMdemo4-Rg `
    -Location "North Europe" `
    -serverLocation "North Europe" `
    -GalleryTemplateIdentity Microsoft.WebSiteSQLDatabase.0.2.14-preview `
    -siteName TestSiteDavidTesarCh9 `
    -databaseName armffdb6 `
    -administratorLogin myuser
    -administratorLoginPassword mypassword

    In spite of the fact that I got resource group created as well as the database, I had the 2 strange things, especially ther 2nd error for not recognizing -administratorLoginPassword parameter

    ew-AzureResourceGroup : 2:44:01 PM – Resource Microsoft.Web/serverFarms 'Default1' failed with message 'The specified location '"North Europe"' is invalid. A
    location must consist of characters, whitespace, digit, or following symbols '(,)'.'

    Then

    ResourceGroupName : galleryARMdemo4-Rg
    Location : northeurope
    ProvisioningState : Succeeded
    Tags :
    Permissions :
    Actions NotActions
    ======= ==========
    *

    Resources :
    Name Type Location
    =================== =============================== ===========
    ffarmdemoserverlive Microsoft.Sql/servers northeurope
    armffdb6 Microsoft.Sql/servers/databases northeurope

    ResourceId : /subscriptions/abcdesr0-5bd2-4205-8b89-57f6ab375a16/resourceGroups/galleryARMdemo4-Rg

    Then

    -administratorLoginPassword : The term '-administratorLoginPassword' is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:10 char:5
    + -administratorLoginPassword yazi*gopep1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (-administratorLoginPassword:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    Do you think I still need to do a clear Clear-AzureProfile ?

  • #23857
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    Hi there Salam,

    I think we're working on two (possibly three) issues in this thread. 🙂

    For your last post, I see backticks on all of the lines except the ones you're having issues with. You might want to add the backticks so those lines are recognized as parameters and not separate commands.

    As for the profile issue you're having, if you feel the issue is resolved, then no. But if you're still having problems importing the publish settings, then you may want to look into it.

  • #23859
    Profile photo of Stephen Owen
    Stephen Owen
    Participant

    Hi Salam,

    Will Pinged me about your problems. You absolutely have to fix your cert problems before going on. The issues you're seeing with them and the AzurePublishSettings file are huge warning signs.

    I would delete your current certs and also remove your subscription, then reimport the settings. Use the Cmdlets Remove-AzureSubscription and then Import-AzurePublishSettingsFile again to see if this resolves some problems.

  • #23860
    Profile photo of Salam Elias
    Salam Elias
    Participant

    Ok, I will do this and let you know

  • #23864
    Profile photo of Salam Elias
    Salam Elias
    Participant

    Stephen, by "delete your current certs ", do you mean from local store as well as in Azure portal which is a valid cert

  • #23865
    Profile photo of Salam Elias
    Salam Elias
    Participant

    Stephen, following the command (on another machine)
    Get-AzureSubscription -Subscriptionid and -SubscriptionName
    to be sure that I am using the right value, I get a succesful response as follows

    SubscriptionId : **********-5bd2-********-8b89-**********75att
    SubscriptionName : Services de la plateforme Windows Azure pour Visual Studio Ultim
    Environment : AzureCloud
    SupportedModes : AzureServiceManagement,AzureResourceManager
    ....
    ....

    I issue as per your recommandation the command Remove-AzureSubscription , I get

    [blockquote]Remove-AzureSubscription : The subscription name Services de la plateforme Windows Azure pour Visual Studio Ultim doesn't exist.
    Parameter name: name
    At line:1 char:1
    + Remove-AzureSubscription -SubscriptionName "Services de la plateforme Windows Az ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : CloseError: (:) [Remove-AzureSubscription], ArgumentException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.RemoveAzureSubscriptionCommand[/blockquote]

    I issue Import-AzurePublishSettingsFile -PublishSettingsFile **************path to my publishingsettings, I get

    [blockquote]Import-AzurePublishSettingsFile : There is an error in XML document (2, 2).
    At line:1 char:1
    + Import-AzurePublishSettingsFile -PublishSettingsFile "E:\Salam\Dev\Azure Account ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : CloseError: (:) [Import-AzurePublishSettingsFile], InvalidOperationException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.ImportAzurePublishSettingsCommand[/blockquote]

  • #23866
    Profile photo of Salam Elias
    Salam Elias
    Participant

    I forgot to mention that I did not delete any certificate for the moment as I am waiting for your confirmation

  • #23879
    Profile photo of Salam Elias
    Salam Elias
    Participant

    Here some feedback.
    In fact, the non-recognition of Azure commands in ISE was due to the fact that ISE 64 bit can not import the module Azure using "Import-Module Azure". I discovered this after firing "Windows Azure Powershell" Shell and I was able to create a new Web site, new storage account, sql database, new firewall rules.
    This thread helped me understand this
    [blockquote]http://serverfault.com/questions/568257/import-module-azure-fails, I did
    Import-Module "C:\Program Files [x86]\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1"
    [/blockquote]and I was able to do the same thing from ISE.

    One note to Stephen, in my scripts, I am using thmbnails and the certificate as follows

    [blockquote]$subscriptionID = $s.SubscriptionId
    $testthumbprint = "tgfdvcfe4e52fc**************9bbf3b923*****0"
    $cert = Get-ChildItem Cert:\CurrentUser\My\$testthumbprint
    Invoke-RestMethod -Method POST -Uri $queryString -Certificate $cert.....................
    [/blockquote]
    which works fine like a charm. So I am not sure if I have any issue with the certificate.

    Still when I issue Import-AzurePublishSettingsFile, I get "Import-AzurePublishSettingsFile : There is an error in XML document (1, 1)."

You must be logged in to reply to this topic.