SAP 自動化架構中的工作負載區域部署

SAP 應用程式通常會有多個開發層。 例如,您可能有開發、品質保證和生產層。 SAP 部署自動化架構會將這些層級稱為工作負載區域

您可以在多個 Azure 區域中使用工作負載區域。 然後每個工作負載區域都有專用的 Azure 虛擬網路執行個體。

SAP 工作負載區域會提供下列服務:

  • 虛擬網路包括子網路和網路安全性群組
  • 適用於系統認證的 Azure Key Vault 執行個體
  • 用於開機診斷的 Azure 儲存體帳戶
  • 雲端見證的儲存體帳戶
  • Azure NetApp Files 帳戶和容量集區 (選擇性)
  • Azure 檔案儲存體 NFS 共用 (選擇性)

Diagram that shows an SAP workload zone.

工作負載區域通常會部署在中樞和輪輻架構的輪輻中。 可能位於本身的訂閱內。

從控制平面或可設定的來源支援私人 DNS。

核心設定

下列範例參數檔案只會顯示必要的參數。

# The environment value is a mandatory field, it is used for partitioning the environments, for example (PROD and NP)
environment="DEV"

# The location value is a mandatory field, it is used to control where the resources are deployed
location="westeurope"

# The network logical name is mandatory - it is used in the naming convention and should map to the workload virtual network logical name
network_name="SAP01"

# network_address_space is a mandatory parameter when an existing virtual network is not used
network_address_space="10.110.0.0/16"

# admin_subnet_address_prefix is a mandatory parameter if the subnets are not defined in the workload or if existing subnets are not used
admin_subnet_address_prefix="10.110.0.0/19"

# db_subnet_address_prefix is a mandatory parameter if the subnets are not defined in the workload or if existing subnets are not used
db_subnet_address_prefix="10.110.96.0/19"

# app_subnet_address_prefix is a mandatory parameter if the subnets are not defined in the workload or if existing subnets are not used
app_subnet_address_prefix="10.110.32.0/19"

# The automation_username defines the user account used by the automation
automation_username="azureadm"

準備工作負載區域部署認證

在執行部署時,SAP 部署自動化架構會使用服務主體。 若要為工作負載部署建立服務主體,請使用具有建立服務主體權限的帳戶。

az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/<subscriptionID>" --name="<environment>-Deployment-Account"

重要

服務主體的名稱必須是唯一的。

記錄命令的輸出值:

  • appId
  • password
  • tenant

將正確的存取權限指派給服務主體。

az role assignment create --assignee <appId> \
    --scope /subscriptions/<subscriptionID> \
    --role "User Access Administrator"

部署 SAP 工作負載區域

工作負載區域設定檔範例 DEV-WEEU-SAP01-INFRASTRUCTURE.tfvars 位於 ~/Azure_SAP_Automated_Deployment/samples/Terraform/WORKSPACES/LANDSCAPE/DEV-WEEU-SAP01-INFRASTRUCTURE 資料夾中。

執行下列命令以部署 SAP 工作負載區域。

從部署器執行這項工作。

您可以複製設定檔範例,以開始測試部署自動化架構。

cd ~/Azure_SAP_Automated_Deployment

cp -R sap-automation/samples/WORKSPACES config


export  ARM_SUBSCRIPTION_ID="<subscriptionId>"
export        ARM_CLIENT_ID="<appId>"
export    ARM_CLIENT_SECRET="<password>"
export        ARM_TENANT_ID="<tenantId>"
export             env_code="DEV"
export          region_code="<region_code>"
export            vnet_code="SAP02"
export deployer_environment="MGMT"


export DEPLOYMENT_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/config/WORKSPACES"
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"

az login --service-principal -u "${ARM_CLIENT_ID}" -p="${ARM_CLIENT_SECRET}" --tenant "${ARM_TENANT_ID}"


cd "${CONFIG_REPO_PATH}/LANDSCAPE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE"
parameterFile="${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars"

$SAP_AUTOMATION_REPO_PATH/deploy/scripts/install_workloadzone.sh   \
    --parameterfile "${parameterFile}"                             \
    --deployer_environment "${deployer_environment}"               \ 
    --subscription "${ARM_SUBSCRIPTION_ID}"                        \
    --spn_id "${ARM_CLIENT_ID}"                                    \
    --spn_secret "${ARM_CLIENT_SECRET}"                            \
    --tenant_id "${ARM_TENANT_ID}"
    

提示

如果指令碼無法執行,有時候移除 ~/.sap_deployment_automation/~/.terraform.d/ 目錄後再執行指令碼,有助於清除本機快取檔案。

後續步驟