你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzPostgreSqlConnectionString
根据客户端连接提供程序获取连接字符串。
语法
Get-AzPostgreSqlConnectionString
-Client <String>
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-DefaultProfile <PSObject>]
[<CommonParameters>]
Get-AzPostgreSqlConnectionString
-Client <String>
-InputObject <IServer>
[-DefaultProfile <PSObject>]
[<CommonParameters>]
说明
根据客户端连接提供程序获取连接字符串。
示例
示例 1:按资源组和服务器名称获取 PostgreSql 服务器连接字符串
Get-AzPostgreSqlConnectionString -Client ADO.NET -Name PostgreSqlTestServer -ResourceGroupName PostgreSqlTestRG
Server=postgresqltestserver.postgres.database.azure.com;Database={your_database};Port=5432;User Id=pwsh@postgresqltestserver;Password={your_password};Ssl Mode=Require;
此 cmdlet 按资源组和服务器名称获取 PostgreSql 服务器连接字符串。
示例 2:按标识获取 PostgreSql 服务器连接字符串
Get-AzPostgreSqlServer -ResourceGroupName PostgreSqlTestRG -ServerName PostgreSqlTestServer | Get-AzPostgreSqlConnectionString -Client PHP
host=postgresqltestserver.postgres.database.azure.com port=5432 dbname={your_database} user=pwsh@postgresqltestserver password={your_password} sslmode=require
此 cmdlet 按标识获取 PostgreSql 服务器连接字符串。
参数
-Client
客户端连接提供程序。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
要构造的连接字符串的服务器,请参阅 INPUTOBJECT 属性的 NOTES 部分并创建哈希表。
类型: | IServer |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
服务器的名称。
类型: | String |
别名: | ServerName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
包含资源的资源组的名称,可以从 Azure 资源管理器 API 或门户获取此值。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
标识 Azure 订阅的订阅 ID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |