Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ PI Server Installation and Configuration (PI Server 2024 R2)

Use Windows PowerShell

  • Last UpdatedSep 09, 2025
  • 1 minute read

You can migrate a PI AF database to Azure SQL Database or Azure Managed Instance using Windows PowerShell.

  1. Run PowerShell in Administrative mode.

  2. At the command prompt, enter the following parameters:

    Connect-AzAccount -Subscription <Subscription-id>

  3. Enter the following commands to set the subscription ID:

    Set-AzContext -Subscription <Subscription-id>

  4. Optional: If you do not have a pre-configured database migration service set up and a self-hosted Integration Runtime agent, enter the following commands to configure the service and agent:

    New-AzDataMigrationSqlService -ResourceGroupName "MyResourceGroup" -Name "MySqlMigrationService" -Location "EastUS2"

    $authKeys = Get-AzDataMigrationSqlServiceAuthKey -ResourceGroupName "MyResourceGroup" -SqlMigrationServiceName "MySqlMigrationService"

    Register-AzDataMigrationIntegrationRuntime -AuthKey $authKeys.AuthKey1 -IntegrationRuntimePath "C:\Users\user\Downloads\IntegrationRuntime.msi"

    Register-AzDataMigrationIntegrationRuntime -AuthKey $authKeys.AuthKey1

  5. To initiate the database migration, run the following command:

    New-AzDataMigrationToSqlDb

Code example for PowerShell

New-AzDataMigrationToSqlDb `

-ResourceGroupName MyGroup `

-SqlDbInstanceName labserver `

-Kind "SqlDb" `

-TargetDbName AdventureWorksTarget `

-SourceDatabaseName AdventureWorks `

-SourceSqlConnectionAuthentication SQLAuthentication `

-SourceSqlConnectionDataSource LABSERVER.MICROSOFT.COM `

-SourceSqlConnectionUserName user `

-SourceSqlConnectionPassword $sourcePass `

-Scope "/subscriptions/MySubscriptionID/resourceGroups/MyGroup/providers/Microsoft.Sql/servers/labserver" `

-TargetSqlConnectionAuthentication SQLAuthentication `

TitleResults for “How to create a CRG?”Also Available in