none
SQL RP install - PowerShell error - 1809 RRS feed

  • Question

  • Team.

    Following these instructions after a fresh install of 1809.

    https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-sql-resource-provider-deploy

    I am receiving this error below. PowerShell required version compatibility? 1809 requires 1.5. The SQL RP requires 1.4.

    Please advise.

    Import-Module : The following error occurred while loading the extended type data file: Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer": The TypeConverter 
    was ignored because it already occurs.
    Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer": The member SerializationDepth is already present.
    Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache": The member PropertySerializationSet is already present.
    Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache": The member SerializationMethod is already present.
    Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache": The member PropertySerializationSet is already present.
    Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache": The member SerializationMethod is already present.
    Error in TypeData "Microsoft.Azure.Commands.Profile.Models.PSAzureContext": The member SerializationDepth is already present.
    Error in TypeData "Microsoft.Azure.Commands.Profile.Models.PSAzureProfile": The member SerializationDepth is already present.
    At line:2 char:1
    + . $tempDir\DeploySQLProvider.ps1 `
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
        + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand


    RFSonders

    Monday, October 29, 2018 3:30 PM

Answers

  • Hi Robert, 

    I’m able to repro the error you’ve posted only when the PowerShell uninstall/removal steps actually failed.

    An example of such failures would be:

    PS C:\WINDOWS\system32> Get-Module -Name Azure* -ListAvailable | Uninstall-Module -Force

    WARNING: The version '4.1.1' of module 'Azure.Storage' is currently in use. Retry the operation after closing the applications.

    PackageManagement\Uninstall-Package : Module 'Azure.Storage' is in currently in use or you don't have the required permissions.

    At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2194 char:21

    + ...        $null = PackageManagement\Uninstall-Package @PSBoundParameters

    +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : InvalidOperation: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninstall-Package], Exception

        + FullyQualifiedErrorId : ModuleIsInUse,Uninstall-Package,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

    In my case, I closed my Visual Studio Code and retried and then succeeded.

    You could check this folder “C:\Program Files\WindowsPowerShell\Modules” to ensure all “azs*” and “azure*” folders are deleted before you proceed.

    Also, the cmdlet you’ve posted doesn’t work for me:

    Get-Module-ListAvailable|where-Object($_.Name-like "Azure*")|Uninstall-Module

    I am using these two instead:

    Get-Module -Name Azs.* -ListAvailable | Uninstall-Module -Force

    Get-Module -Name Azure* -ListAvailable | Uninstall-Module -Force

    That is also the format used by the document: https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-powershell-install#3-uninstall-existing-versions-of-the-azure-stack-powershell-modules

     

    So in a nutshell, the following should work:

    # Close other applications which might be using PowerShell modules: e.g. PowerShell ISE, Visual Studio Code

    Get-Module -Name Azs.* -ListAvailable | Uninstall-Module -Force

    Get-Module -Name Azure* -ListAvailable | Uninstall-Module -Force

    # Ensure C:\Program Files\WindowsPowerShell\Modules doesn’t contain folders patterned “AzS.*” or “Azure*” as names

     

    # Install the AzureRM.Bootstrapper module, set the profile and install the AzureStack module

    Install-Module -Name AzureRm.BootStrapper -Force

    Use-AzureRmProfile -Profile 2017-03-09-profile

    Install-Module  -Name AzureStack -RequiredVersion 1.4.0

      

    .\DeploySQLProvider.ps1

     

     

    In addition, we’re to ship the next release of the RPs soon. The new version will use the latest recommended PS profile 2018-03-01-hybrid.

    Will let you know once it’s rolled out.


    • Edited by Qun Ying Wednesday, October 31, 2018 4:10 AM
    • Marked as answer by Robert F Sonders Wednesday, October 31, 2018 12:20 PM
    Wednesday, October 31, 2018 4:05 AM

All replies

  • Hello.

    Do we have a response here? I feel there a profile and PS difference between 1809 requirements and the SQL RP.

    1809 requirements:

    # Install and import the API Version Profile required by Azure Stack into the current PowerShell session.
    Use-AzureRmProfile -Profile 2018-03-01-hybrid -Force
    
    # Install Azure Stack Module Version 1.5.0.
    Install-Module -Name AzureStack -RequiredVersion 1.5.0

    SQL RP Requirements

    Use-AzureRmProfile -Profile 2017-03-09-profile
    
    Install-Module  -Name AzureStack -RequiredVersion 1.4.0
    Do we know when a SQL RP fix will be made available?



    RFSonders


    Tuesday, October 30, 2018 3:00 AM
  • Hi Robert, the updated SQL RP bits are coming soon to address this issue. I do not have a firm ETA on when they will ship yet though.

    As a workaround, you can uninstall Azure Stack PowerShell and install the 1804 version to allow SQL RP installation to succeed.

    Install-Module -Name AzureRm.BootStrapper Use-AzureRmProfile -Profile 2017-03-09-profile -Force Install-Module -Name AzureStack -RequiredVersion 1.2.11

    Hope this helps,
    ~Jeff


    Jeff Gilbert, Azure Stack docs team lead


    Tuesday, October 30, 2018 6:30 PM
  • Hello.

    I do not feel this workaround is valid. Same error.

    Per this link, 1.4 is required for the SQL RP. Which did work with 1808. However, I did follow your recommendation of 1.2.11.

    https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-sql-resource-provider-deploy

    Here are the steps I have just followed. I experienced the exact same SQL RP install failure.

    # Install the AzureRM.Bootstrapper module and set the profile.
    Install-Module -Name AzureRm.BootStrapper -Force
    
    Use-AzureRmProfile -Profile 2017-03-09-profile -Force
    
    ### Check/Uninstall incompatable AzureStack Modules & Install/Import correct version 1.2.10 
    Get-Module -ListAvailable | where-Object ($_.Name -like "Azure*") | Uninstall-Module 
    Remove-Item  $PSHome\modules\Azure* -Force 
    dir $PSHome\modules\Azure* 
    Remove-Item 'C:\Program Files (x86)\WindowsPowerShell\Modules\Azure*' -Force 
    dir 'C:\Program Files (x86)\WindowsPowerShell\Modules\Azure*' 
    
    #Per MSFT instructions, install 1.2.11
    Install-Module  -Name AzureStack -RequiredVersion 1.2.11 -AllowClobber
    Import-Module -Name  AzureStack -RequiredVersion  1.2.11 

    We need a more prescriptive recommended solve from MSFT.

    Thoughts?

    I am quite sure others are experiencing the same issue.


    RFSonders

    Tuesday, October 30, 2018 6:58 PM
  • Hi Robert, 

    I’m able to repro the error you’ve posted only when the PowerShell uninstall/removal steps actually failed.

    An example of such failures would be:

    PS C:\WINDOWS\system32> Get-Module -Name Azure* -ListAvailable | Uninstall-Module -Force

    WARNING: The version '4.1.1' of module 'Azure.Storage' is currently in use. Retry the operation after closing the applications.

    PackageManagement\Uninstall-Package : Module 'Azure.Storage' is in currently in use or you don't have the required permissions.

    At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2194 char:21

    + ...        $null = PackageManagement\Uninstall-Package @PSBoundParameters

    +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : InvalidOperation: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninstall-Package], Exception

        + FullyQualifiedErrorId : ModuleIsInUse,Uninstall-Package,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

    In my case, I closed my Visual Studio Code and retried and then succeeded.

    You could check this folder “C:\Program Files\WindowsPowerShell\Modules” to ensure all “azs*” and “azure*” folders are deleted before you proceed.

    Also, the cmdlet you’ve posted doesn’t work for me:

    Get-Module-ListAvailable|where-Object($_.Name-like "Azure*")|Uninstall-Module

    I am using these two instead:

    Get-Module -Name Azs.* -ListAvailable | Uninstall-Module -Force

    Get-Module -Name Azure* -ListAvailable | Uninstall-Module -Force

    That is also the format used by the document: https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-powershell-install#3-uninstall-existing-versions-of-the-azure-stack-powershell-modules

     

    So in a nutshell, the following should work:

    # Close other applications which might be using PowerShell modules: e.g. PowerShell ISE, Visual Studio Code

    Get-Module -Name Azs.* -ListAvailable | Uninstall-Module -Force

    Get-Module -Name Azure* -ListAvailable | Uninstall-Module -Force

    # Ensure C:\Program Files\WindowsPowerShell\Modules doesn’t contain folders patterned “AzS.*” or “Azure*” as names

     

    # Install the AzureRM.Bootstrapper module, set the profile and install the AzureStack module

    Install-Module -Name AzureRm.BootStrapper -Force

    Use-AzureRmProfile -Profile 2017-03-09-profile

    Install-Module  -Name AzureStack -RequiredVersion 1.4.0

      

    .\DeploySQLProvider.ps1

     

     

    In addition, we’re to ship the next release of the RPs soon. The new version will use the latest recommended PS profile 2018-03-01-hybrid.

    Will let you know once it’s rolled out.


    • Edited by Qun Ying Wednesday, October 31, 2018 4:10 AM
    • Marked as answer by Robert F Sonders Wednesday, October 31, 2018 12:20 PM
    Wednesday, October 31, 2018 4:05 AM
  • Thank you, Qun. I can report your uninstall/reinstall does work. We may add an additional step of removing the Azure* and Azs* modules again after the RP's are installed.

    Resetting back to the 1809 requirements.

    # Install and import the API Version Profile required by Azure Stack into the current PowerShell session.
    Use-AzureRmProfile -Profile 2018-03-01-hybrid -Force
    
    # Install Azure Stack Module Version 1.5.0.
    Install-Module -Name AzureStack -RequiredVersion 1.5.0


    RFSonders


    Wednesday, October 31, 2018 12:20 PM
  • Keeping this thread alive as it is still valid

    This page was updated 5/5/2019. Note the build numbers and build dates of the files.

    https://docs.microsoft.com/en-us/azure-stack/operator/azure-stack-sql-resource-provider-11300

    This page, note yet updated, notice the build numbers.

    https://docs.microsoft.com/en-us/azure-stack/operator/azure-stack-sql-resource-provider-deploy#prerequisites

    This pages should be in sync.


    RFSonders

    Sunday, May 12, 2019 3:15 PM