Skip to content

Commit b2cf28f

Browse files
fixed latest plan auto-deployment, improved README
1 parent 6c84657 commit b2cf28f

File tree

4 files changed

+91
-36
lines changed

4 files changed

+91
-36
lines changed

README.md

Lines changed: 81 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Bicep Framework for deploying CBS on Azure
22

3+
The Bicep framework for CBS deployment comes with Bicep templates and bash scripts, combined from following modules:
4+
5+
- **Module #01 (Prerequisites)** - this module deploys all the resources required for CBS deployment, including Virtual Network, User-Managed Identity, Custom Role, and others.
6+
7+
- **Module #02 (CBS Managed App)** - this module deploys the CBS Managed App itself into the environment with all prerequisites met.
8+
9+
- **Module #03 (Test VM)** - This module provisions a test Virtual Machine (VM) of Windows Server 2019 with pre-installed MS SQL server and configures test volumes in CBS instance to mount them via iSCSI protocol.
10+
11+
- **Module #04 (E2E Demo Deployment) 🧪** - For hands-on/testing purposes, this module combines all modules #01-#03 (described above) and deploys all required resources, CBS Managed App and a test Virtual Machine in the single deployment script.
12+
313
## Prerequisites
414
- bash
515
- Docker or Windows (**WSL recommended**) / Linux<sup>[1]</sup> / MacOS<sup>[2]</sup>
@@ -31,38 +41,23 @@ You can also run all commands in this repo on your computer or in container usin
3141
### On local computer
3242

3343
1. Add permissions to execute scripts:
34-
```bash
35-
$ chmod +x 00-setup-machine.sh 01-deploy-prerequisities.sh 02-deploy-cbs.sh 03-deploy-test-vm.sh deploy-e2e-demo.sh
36-
```
44+
```bash
45+
$ chmod +x 00-setup-machine.sh 01-deploy-prerequisities.sh 02-deploy-cbs.sh 03-deploy-test-vm.sh deploy-e2e-demo.sh
46+
```
3747
1. Run the `00-setup-machine.sh` script to install all required tooling and log into Azure.
48+
```bash
49+
./00-setup-machine.sh
50+
```
3851

3952

4053
## Usage
4154

42-
### Option A - E2E DEMO Deployment
43-
44-
This repository contains a script `deploy-e2e-demo.sh` that combines all modules in the repository and enables easy testing and hands-on experience of the CBS (Pure Cloud Block Store) on Azure.
45-
With just one script, you can quickly set up and run a test environment to explore the features and capabilities of the CBS.
46-
47-
The script includes all required CBS resources and sets up a test Windows SQL Server VM with mounted CBS volumes via iSCSI.
48-
49-
![Deployed resources with deploy-e2e-demo.sh script](./static/deployed-resources.png)
50-
51-
To use this script:
52-
1. rename the file `e2e-demo-params.sh.example` to `e2e-demo-params.sh`
53-
1. enter the necessary values into the `e2e-demo-params.sh` file
54-
1. execute the script `./deploy-e2e-demo.sh`
55-
56-
57-
58-
### Option B - Bicep Modules
59-
60-
The repository also contains 3 modules for deploying CBS on Azure using infrastructure-as-code [Bicep](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview?tabs=bicep) templates.
55+
The repository contains 4 modules for deploying CBS on Azure using infrastructure-as-code [Bicep](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview?tabs=bicep) templates.
6156

6257
These modules can be customized and modified, for example, to be incorporated into your landing zone templates.
6358

6459

65-
#### Module #01 - CBS Prerequisites
60+
### Module #01 - CBS Prerequisites
6661

6762
The script `01-deploy-prerequisities.sh` (Bicep template file `prerequisities.bicep`) deploys all required resources for CBS.
6863

@@ -76,39 +71,70 @@ The script `01-deploy-prerequisities.sh` (Bicep template file `prerequisities.bi
7671

7772
To use this module:
7873
1. rename the file `01-prereq.bicepparam.example` to `01-prereq.bicepparam`
74+
```bash
75+
$ mv 01-prereq.bicepparam.example 01-prereq.bicepparam
76+
```
7977
1. enter the necessary values into the `01-prereq.bicepparam` file
80-
1. execute the script `./01-deploy-prerequisities.sh`
78+
79+
1. execute the script
80+
```bash
81+
./01-deploy-prerequisities.sh
82+
```
8183

8284

83-
#### Module #02 - CBS Managed App
85+
86+
### Module #02 - CBS Managed App
8487

8588
The script `02-deploy-cbs.sh` (Bicep template file `cbs-managed-app.bicep`) deploys CBS managed application itself.
8689

8790
To use this module:
8891
1. rename the file `02-cbs.bicepparam.example` to `02-cbs.bicepparam`
92+
```bash
93+
$ mv 02-cbs.bicepparam.example 02-cbs.bicepparam
94+
```
8995

9096
1. enter the necessary values into the `02-cbs.bicepparam` file<br>
91-
<em><small>Remember that these Bicep modules are separate from each other. If you want to run them one after the other, you'll need to pass some output values from the `01-deploy-prerequisities.sh` script into the `02-cbs.bicepparam` parameter file. </small></em>
97+
<em><small>Remember that these Bicep modules are isolated from each other.<br>
98+
If you want to run them one after the other, you'll need to pass some output values from the `01-deploy-prerequisities.sh` script into the `02-cbs.bicepparam` parameter file. </small></em>
99+
100+
1. execute the script
101+
```bash
102+
./02-deploy-cbs.sh
103+
```
92104
93-
1. execute the script `./02-deploy-cbs.sh`
94105
95106
96107
97108
> [!NOTE]
98109
> If you intend to use only a Bicep template for the programmatic deployment of CBS, you must also accept the Azure Marketplace license for the given product/plan. Since Azure does not support accepting licenses via Bicep templates, you must accept the license using PowerShell or Azure CLI before executing the Bicep deployment.
99110
100-
#### Module #03 - Test VM
111+
### Module #03 - Test VM
101112
102113
The script `03-deploy-test-vm.sh` deploys a test Windows Server VM with MS SQL server installed.
103114
104115
It automatically creates 3 volumes in the CBS array, and mount them on the VM via iSCSI to be used by SQL server.
105116
117+
To use this module:
118+
1. rename the file `03-test-vm.bicepparam.example` to `03-test-vm.bicepparam`
119+
```bash
120+
$ mv 03-test-vm.bicepparam.example 03-test-vm.bicepparam
121+
```
106122
107-
##### Using the Test VM
123+
1. enter the necessary values into the `03-test-vm.bicepparam` file<br>
124+
<em><small>Remember that these Bicep modules are isolated from each other.<br>
125+
If you want to run them one after the other, you'll need to pass some output values from the `02-deploy-cbs.sh` script into the `03-test-vm.bicepparam` parameter file. </small></em>
126+
127+
1. execute the script
128+
```bash
129+
./03-deploy-test-vm.sh
130+
```
131+
132+
#### Using the Test VM
108133

109134
The Test VM is configured to accept standard RDP connections from your public IP address.
110135

111-
In WSL, the deployment script should automatically open an RDP session to the VM.
136+
In WSL, the deployment script should automatically open an RDP session to the VM.<br>
137+
112138
If not, use a command:
113139
```bash
114140
$ mstsc.exe /v:<<public IP address>>
@@ -123,13 +149,37 @@ Password: *pureuser*
123149
124150
**Please change these credentials immediately.**
125151
152+
<br><br>
153+
154+
### Module #04 - E2E DEMO Deployment
155+
156+
This repository contains a script `deploy-e2e-demo.sh` that combines all modules in the repository and enables easy testing and hands-on experience of the CBS (Pure Cloud Block Store) on Azure.
157+
With just one script, you can quickly set up and run a test environment to explore the features and capabilities of the CBS.
158+
159+
The script includes all required CBS resources and sets up a test Windows SQL Server VM with mounted CBS volumes via iSCSI.
160+
161+
![Deployed resources with deploy-e2e-demo.sh script](./static/deployed-resources.png)
162+
163+
To use this script:
164+
1. rename the file `e2e-demo-params.sh.example` to `e2e-demo-params.sh`
165+
```bash
166+
$ mv e2e-demo-params.sh.example e2e-demo-params.sh
167+
```
168+
1. enter the necessary values into the `e2e-demo-params.sh` file
169+
1. execute the script
170+
```bash
171+
$ ./deploy-e2e-demo.sh
172+
```
173+
174+
175+
126176
127177
## Limitations / Troubleshooting
128178
129179
130180
### Common Deployment vNET
131181
132-
The prerequisites module only supports a single virtual network scenario where all required subnets are deployed within one common vNET, as this is considered best practice. The use of multiple vNETs that are peered with each other is not supported by this framework.
182+
The prerequisites (Module #01) only supports a single virtual network scenario where all required subnets are deployed within one common vNET, as this is considered best practice. The use of multiple vNETs that are peered with each other is not supported by this framework.
133183
134184
However, the vNET does not have to be deployed within the same vNET. You can use the optional `vnetRGName` (for Module #02) parameter to specify the resource group for the vNET.
135185

deploy-e2e-demo.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ echo -e "
2222

2323

2424
echo -e "${C_BLUE3}${C_GREY85}
25-
[Step #1] Deploying required infrastructure in subscription $subscriptionId:${NO_FORMAT}"
25+
[Step #1] Deploying required infrastructure in subscription xxxxxxxx-xxxx-xxxx-xxx-xxxxxxxxxxxx:${NO_FORMAT}"
2626
echo "
2727
RG name: $resourceGroupName
2828
Location: $location
@@ -88,7 +88,8 @@ latestPlan=`(echo '{"plans":[';curl 'https://catalogapi.azure.com/offers/puresto
8888

8989
AZURE_MARKETPLACE_PLAN_NAME=`echo $latestPlan | jq -r .planId`
9090
AZURE_MARKETPLACE_PUBLISHER=`echo $bicep_raw | jq -r .templateJson | jq -r .parameters.azureMarketPlacePlanPublisher.defaultValue`
91-
AZURE_MARKETPLACE_PLAN_OFFER=`echo $latestPlan | jq -r .planVersion`
91+
AZURE_MARKETPLACE_PLAN_OFFER=`echo $bicep_raw | jq -r .templateJson | jq -r .parameters.azureMarketPlacePlanOffer.defaultValue`
92+
AZURE_MARKETPLACE_PLAN_VERSION=`echo $latestPlan | jq -r .planVersion`
9293

9394
enablementOutput=$(az vm image terms accept \
9495
--subscription $subscriptionId \
@@ -127,7 +128,11 @@ output=$(az deployment group create \
127128
alertRecipients=$alertRecipients \
128129
cbsModelSku=$cbsModelSku \
129130
orgDomain=$orgDomain \
130-
availabilityZone=$availabilityZone
131+
availabilityZone=$availabilityZone \
132+
azureMarketPlacePlanVersion=$AZURE_MARKETPLACE_PLAN_VERSION \
133+
azureMarketPlacePlanName=$AZURE_MARKETPLACE_PLAN_NAME \
134+
azureMarketPlacePlanPublisher=$AZURE_MARKETPLACE_PUBLISHER \
135+
azureMarketPlacePlanOffer=$AZURE_MARKETPLACE_PLAN_OFFER
131136
)
132137

133138
cbsmanagementLbIp=`echo $output | jq -r '.properties.outputs.cbsmanagementLbIp.value'`

e2e-demo-params.sh.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ alertRecipients='<< email address >>'
1717

1818
# test VM size
1919

20-
virtualMachineSize='Standard_D2s_v5'
20+
virtualMachineSize='Standard_D4s_v5'
2121

2222
# test VM credentials
2323
adminUsername='<< test VM admin username >>'

script-modules/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
CLI_VERSION='1.0'
3+
CLI_VERSION='1.0.1'
44

55

66
# terminal colors

0 commit comments

Comments
 (0)