Set the authentication method in GO.bat for Microsoft Azure
- Last UpdatedNov 13, 2025
- 2 minute read
- PI System
- PI Server 2024 R2
- PI Server
If you plan to use Microsoft Azure SQL Database or Microsoft Azure Managed Instance to deploy and manage your PI AF database, you will need to edit the GO.bat batch file and set the preferred authentication method for connections.
Go-sqlcmd utility
To enable the newer authentication methods for Azure SQL Database, you need to install the go-sqlcmd version of the sqlcmd utility. For more information, see the Microsoft topic: sqlcmd utility.
Overview of command-line options
There are two command-line options used to specify the allowed authentication method for Azure SQL client and user connections:
-
-G: Enables Microsoft Entra authentication with Azure SQL.
-
-auth: Specifies which authentication mode is used (Microsoft Entra, system-assigned or user-assigned managed identity).
Note: Microsoft Entra is the new name for Azure Active Directory (Azure AD), but Azure AD is still referenced in cmdlets.
For more information on these command-line options, see Authenticate with Microsoft Entra ID in sqlcmd.
Code examples: -G option
The -G option enables Microsoft Entra users to authenticate with Azure SQL Database using default Microsoft Entra authentication or a Microsoft Entra user ID and password:
-
Example 1--Authenticate with default Microsoft Entra authentication:
go.bat -G MyAzureSQL PIFD
Note: Depending on the machine's configuration and the user or client who requests authentication, the first example attempts to use either Microsoft Entra ID Integrated or system-assigned managed identity.
-
Example 2--Authenticate with a Microsoft Entra user ID and password:
go.bat -G MyAzureSQL PIFD <User> <Password>
Code examples: -auth option
The -auth option enables you to select which authentication method to use.
-
Example 1--Authenticate with default Microsoft Entra authentication:
go.bat -auth ActiveDirectoryDefault MyAzureSQL PIFD
-
Example 2--Authenticate with a system-assigned managed identity:
go.bat -auth ActiveDirectoryManagedIdentity MyAzureSQL PIFD
-
Example 3--Authenticate with user-assigned managed identity:
go.bat -auth ActiveDirectoryManagedIdentity MyAzureSQL PIFD <User Id>