Share via


使用 Azure CLI 來部署 Active Directory 整合式已啟用 Azure Arc 的 PostgreSQL

本文說明如何搭配使用 Azure CLI 搭配 Active Directory (AD) 驗證來部署已啟用 Azure Arc 的 PostgreSQL 伺服器。

如需特定指示,請參閱下列文章:

必要條件

繼續之前,請安裝下列工具:

若要深入了解如何設定 OU 和 AD 帳戶的進一步詳細資料,請移至在 Active Directory 驗證中部署已啟用 Azure Arc 的資料服務 - 必要條件

重要

使用 Active Directory 時,預設帳戶必須命名為 "postgres" 才能成功連線。

部署和更新 Active Directory 整合式已啟用 Azure Arc 的 PostgreSQL 伺服器

客戶自控金鑰表模式

建立已啟用 Azure Arc 的 PostgreSQL 伺服器

若要檢視已啟用 Azure Arc 的 PostgreSQL 伺服器建立命令的可用選項,請使用下列命令:

az postgres server-arc create --help

若要建立 SQL 受控執行個體,請使用 az postgres server-arc create。 請參閱下列範例:

az postgres server-arc create 
--name < PostgreSQL server name >  
--k8s-namespace < namespace > 
--ad-connector-name < your AD connector name > 
--keytab-secret < PostgreSQL server keytab secret name >  
--ad-account-name < PostgreSQL server AD user account >  
--dns-name < PostgreSQL server primary endpoint DNS name > 
--port < PostgreSQL server primary endpoint port number >
--use-k8s

範例:

az postgres server-arc create 
--name contosopg 
--k8s-namespace arc 
--ad-connector-name adarc 
--keytab-secret arcuser-keytab-secret
--ad-account-name arcuser 
--dns-name arcpg.contoso.local
--port 31432
--use-k8s

更新已啟用 Azure Arc 的 PostgreSQL 伺服器

若要更新已啟用 Arc 的 PostgreSQL 伺服器,請使用 az postgres server-arc update。 請參閱下列範例:

az postgres server-arc update 
--name < PostgreSQL server name >  
--k8s-namespace < namespace > 
--keytab-secret < PostgreSQL server keytab secret name >  
--use-k8s

範例:

az postgres server-arc update 
--name contosopg 
--k8s-namespace arc 
--keytab-secret arcuser-keytab-secret
--use-k8s
  • 立即試用。在 Azure Kubernetes Service (AKS)、AWS Elastic Kubernetes Service (EKS)、Google Cloud Kubernetes Engine (GKE) 或 Azure VM 中快速開始使用 Azure Arc 快速入門