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 the Microsoft Azure Command-Line interface (CLI)

Use the Microsoft Azure Command-Line interface (CLI)

  • Last UpdatedNov 13, 2025
  • 1 minute read

You can migrate a PI AF database to Azure SQL Database or Azure Managed Instance using the Azure Command-Line interface (CLI).

  1. Download and install the Azure CLI utility. See Azure Command-Line Interface (CLI) documentation for install instructions.

  2. Open PowerShell in Administrative mode.

  3. At the command prompt, enter az login.

  4. Enter the following command and parameters:

    az account set --subscription <Subscription-id>

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

    az datamigration sql-service create --resource-group "MyResourceGroup" --sql-migration-service-name "MySqlMigrationService" --location "EastUS2"

    $authKey1 = az datamigration sql-service list-auth-key --resource-group "MyResourceGroup" --sql-migration-service-name "MySqlMigrationService" --query "authKey1"

    az datamigration register-integration-runtime  --auth-key $authKey1 --ir-path "C:\Users\user\Downloads\IntegrationRuntime.msi"

    az datamigration register-integration-runtime --auth-key $authKey1

  6. To initiate the database migration, enter the following commands:

    az datamigration sql-db create

Code example for Azure CLI

az datamigration sql-db create `

--migration-service "/subscriptions/MySubscriptionID/resourceGroups/MyGroup/providers/Microsoft.DataMigration/SqlMigrationServices/MyService" `

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

--source-database-name "AdventureWorks" `

--source-sql-connection authentication="SQLAuthentication" data-source="LABSERVER.MICROSOFT.COM" password="password" user-name="user" `

--target-sql-connection authentication="SQLAuthentication" data-source="labserver.database.windows.net" password="password" user-name="user" `

--resource-group "MyGroup" --sqldb-instance-name "labserver" --target-db-name AdventureWorksTarget

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