Skip to content

Commit 35af676

Browse files
Merge pull request #252076 from KimForss/main
Control plane script updates
2 parents 883e49c + 0eeddc1 commit 35af676

File tree

2 files changed

+88
-38
lines changed

2 files changed

+88
-38
lines changed

articles/sap/automation/bash/prepare-region.md

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
---
2-
online version: https://github.com/Azure/sap-hana
2+
online version: https://github.com/Azure/SAP-automation
33
schema: 2.0.0
44
author: kimforss
55
ms.author: kimforss
66
ms.reviewer: kimforss
7-
ms.date: 10/21/2021
7+
ms.date: 09/19/2023
88
ms.topic: reference
99
ms.service: sap-on-azure
1010
ms.subservice: sap-automation
11-
title: Prepare region
11+
title: Deploy Control Plane
1212
description: Deploys the control plane (deployer, SAP library) using a shell script.
1313
---
1414

1515
# deploy_controlplane.sh
1616

1717
## Synopsis
18-
The `deploy_controlplane.sh` script deploys the control plane, including the deployer VM, Azure Key Vault, and the SAP library.
18+
The `deploy_controlplane.sh` script deploys the control plane, including the deployer VMs, Azure Key Vault, and the SAP library.
1919

20-
The deployer VM has installations of Ansible and Terraform. This VM deploys the SAP artifacts.
20+
The deployer VM has installations of Ansible and Terraform. This VM is used to deploy the SAP systems.
2121

2222
## Syntax
2323

2424
```bash
25-
prepare_region.sh [ --deployer_parameter_file ] <String> [ --library_parameter_file ] <String>
25+
26+
deploy_controlplane.sh [ --deployer_parameter_file ] <String> [ --library_parameter_file ] <String>
2627
[[ --subscription] <String>] [[ --spn_id ] <String>] [[ --spn_secret ] <String>] [[ --tenant_id ] <String>]
2728
[[ --storageaccountname] <String>] [ --force ] [ --auto-approve ]
2829
```
@@ -37,33 +38,55 @@ Deploys the control plane, which includes the deployer VM and the SAP library. F
3738
This example deploys the control plane, as defined by the parameter files. The process prompts you for the SPN details.
3839

3940
```bash
40-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/prepare_region.sh \
41-
--deployer_parameter_file DEPLOYER/MGMT-WEEU-DEP00-INFRASTRUCTURE/MGMT-WEEU-DEP00-INFRASTRUCTURE.tfvars \
42-
--library_parameter_file LIBRARY/MGMT-WEEU-SAP_LIBRARY/MGMT-WEEU-SAP_LIBRARY.tfvars
41+
export ARM_SUBSCRIPTION_ID="<subscriptionId>"
42+
export ARM_CLIENT_ID="<appId>"
43+
export ARM_CLIENT_SECRET="<password>"
44+
export ARM_TENANT_ID="<tenantId>"
45+
export env_code="MGMT"
46+
export region_code="WEEU"
47+
export vnet_code="DEP01"
48+
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
49+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
50+
51+
az logout
52+
az login --service-principal -u "${ARM_CLIENT_ID}" -p="${ARM_CLIENT_SECRET}" --tenant "${ARM_TENANT_ID}"
53+
54+
sudo ${SAP_AUTOMATION_REPO_PATH}/deploy/scripts/deploy_controlplane.sh \
55+
--deployer_parameter_file "${CONFIG_REPO_PATH}/DEPLOYER/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars" \
56+
--library_parameter_file "${CONFIG_REPO_PATH}/LIBRARY/${env_code}-${region_code}-SAP_LIBRARY/${env_code}-${region_code}-SAP_LIBRARY.tfvars"
4357
```
4458

4559
### Example 2
4660

4761
This example deploys the control plane, as defined by the parameter files. The process adds the deployment credentials to the deployment's key vault.
4862

4963
```bash
50-
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES
64+
65+
export ARM_SUBSCRIPTION_ID="<subscriptionId>"
66+
export ARM_CLIENT_ID="<appId>"
67+
export ARM_CLIENT_SECRET="<password>"
68+
export ARM_TENANT_ID="<tenantId>"
69+
export env_code="MGMT"
70+
export region_code="WEEU"
71+
export vnet_code="DEP01"
72+
73+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
74+
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
5175

5276
az logout
53-
az login
54-
55-
export subscriptionId=<subscriptionID>
56-
export appId=<appID>
57-
export spnSecret="<password>"
58-
export tenantId=<tenantID>
59-
60-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/prepare_region.sh \
61-
--deployer_parameter_file DEPLOYER/MGMT-WEEU-DEP00-INFRASTRUCTURE/MGMT-WEEU-DEP00-INFRASTRUCTURE.tfvars \
62-
--library_parameter_file LIBRARY/MGMT-WEEU-SAP_LIBRARY/MGMT-WEEU-SAP_LIBRARY.tfvars \
63-
--subscription $subscriptionId \
64-
--spn_id $appId \
65-
--spn_secret $spnSecret \
66-
--tenant_id $tenantId
77+
az login --service-principal -u "${ARM_CLIENT_ID}" -p="${ARM_CLIENT_SECRET}" --tenant "${ARM_TENANT_ID}"
78+
79+
80+
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES
81+
82+
83+
sudo ${SAP_AUTOMATION_REPO_PATH}/deploy/scripts/deploy_controlplane.sh \
84+
--deployer_parameter_file "${CONFIG_REPO_PATH}/DEPLOYER/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars" \
85+
--library_parameter_file "${CONFIG_REPO_PATH}/LIBRARY/${env_code}-${region_code}-SAP_LIBRARY/${env_code}-${region_code}-SAP_LIBRARY.tfvars" \
86+
--subscription "${ARM_SUBSCRIPTION_ID}" \
87+
--spn_id "${ARM_CLIENT_ID}" \
88+
--spn_secret "${ARM_CLIENT_SECRET}" \
89+
--tenant_id "${ARM_TENANT_ID}"
6790
```
6891

6992
## Parameters

articles/sap/automation/bash/remove-region.md

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
---
2-
online version: https://github.com/Azure/sap-hana
2+
online version: https://github.com/Azure/SAP-automation
33
schema: 2.0.0
44
author: kimforss
55
ms.author: kimforss
66
ms.reviewer: kimforss
7-
ms.date: 12/10/2021
7+
ms.date: 09/19/2023
88
ms.topic: reference
99
ms.service: sap-on-azure
1010
ms.subservice: sap-automation
11-
title: Remove_region.sh
11+
title: remove_controlplane.sh
1212
description: Removes the SAP Control Plane (Deployer, Library) using a shell script.
1313
---
1414

15-
# Remove_region.sh
15+
# remove_controlplane.sh
1616

1717
## Synopsis
1818

19-
Removes the control plane, including the deployer VM and the SAP library. It is important to remove the terraform deployed artifacts using Terraform to ensure that the removals are done correctly.
19+
Removes the control plane, including the deployer VM and the SAP library. It's important to remove the terraform deployed artifacts using Terraform to ensure that the removals are done correctly.
2020

2121
## Syntax
2222

2323
```bash
2424

25-
remove_region.sh [-d or --deployer_parameter_file ] <String> [-l or --library_parameter_file ] <String>
25+
remove_controlplane.sh [-d or --deployer_parameter_file ] <String> [-l or --library_parameter_file ] <String>
2626
```
2727

2828
## Description
@@ -32,18 +32,45 @@ Removes the SAP control plane, including the deployer VM and the SAP library.
3232

3333
### Example 1
3434
```bash
35-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/remove_region.sh \
36-
--deployer_parameter_file DEPLOYER/MGMT-WEEU-DEP00-INFRASTRUCTURE/MGMT-WEEU-DEP00-INFRASTRUCTURE.tfvars \
37-
--library_parameter_file LIBRARY/MGMT-WEEU-SAP_LIBRARY/MGMT-WEEU-SAP_LIBRARY.tfvars
35+
export ARM_SUBSCRIPTION_ID="<subscriptionId>"
36+
export ARM_CLIENT_ID="<appId>"
37+
export ARM_CLIENT_SECRET="<password>"
38+
export ARM_TENANT_ID="<tenantId>"
39+
export env_code="MGMT"
40+
export region_code="WEEU"
41+
export vnet_code="DEP01"
42+
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
43+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
44+
45+
az logout
46+
az login --service-principal -u "${ARM_CLIENT_ID}" -p="${ARM_CLIENT_SECRET}" --tenant "${ARM_TENANT_ID}"
47+
48+
sudo ${SAP_AUTOMATION_REPO_PATH}/deploy/scripts/remove_controlplane.sh.sh \
49+
--deployer_parameter_file "${CONFIG_REPO_PATH}/DEPLOYER/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars" \
50+
--library_parameter_file "${CONFIG_REPO_PATH}/LIBRARY/${env_code}-${region_code}-SAP_LIBRARY/${env_code}-${region_code}-SAP_LIBRARY.tfvars"
51+
3852
```
3953

4054
### Example 2
4155
```bash
42-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/remove_region.sh \
43-
--deployer_parameter_file DEPLOYER/MGMT-WEEU-DEP00-INFRASTRUCTURE/MGMT-WEEU-DEP00-INFRASTRUCTURE.tfvars \
44-
--library_parameter_file LIBRARY/MGMT-WEEU-SAP_LIBRARY/MGMT-WEEU-SAP_LIBRARY.tfvars \
45-
--subscription xxxxxxxxxxx
46-
--storage_account mgmtweeutfstate###
56+
export ARM_SUBSCRIPTION_ID="<subscriptionId>"
57+
export ARM_CLIENT_ID="<appId>"
58+
export ARM_CLIENT_SECRET="<password>"
59+
export ARM_TENANT_ID="<tenantId>"
60+
export env_code="MGMT"
61+
export region_code="WEEU"
62+
export vnet_code="DEP01"
63+
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
64+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
65+
66+
az logout
67+
az login --service-principal -u "${ARM_CLIENT_ID}" -p="${ARM_CLIENT_SECRET}" --tenant "${ARM_TENANT_ID}"
68+
69+
sudo ${SAP_AUTOMATION_REPO_PATH}/deploy/scripts/remove_controlplane.sh.sh \
70+
--deployer_parameter_file "${CONFIG_REPO_PATH}/DEPLOYER/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars" \
71+
--library_parameter_file "${CONFIG_REPO_PATH}/LIBRARY/${env_code}-${region_code}-SAP_LIBRARY/${env_code}-${region_code}-SAP_LIBRARY.tfvars"
72+
--subscription xxxxxxxxxxx
73+
--storage_account mgmtweeutfstate###
4774
```
4875

4976
## Parameters

0 commit comments

Comments
 (0)