Skip to content

Commit df62aff

Browse files
authored
Merge pull request #192 from ali92hm/master
1.7.2 upgrade script
2 parents 26a0c5b + 8efe382 commit df62aff

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

blockchain-workbench/latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.1
1+
1.7.2

blockchain-workbench/scripts/upgrade/azureBlockchainWorkbenchUpgradeTov1_7_1.ps1 renamed to blockchain-workbench/scripts/upgrade/azureBlockchainWorkbenchUpgradeToLatest.ps1

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<#
22
.SYNOPSIS
33
4-
Upgrades Azure Blockchain Workbench to version 1.7.1.
4+
Upgrades Azure Blockchain Workbench to version 1.7.2.
55
66
77
.DESCRIPTION
88
9-
Upgrades Azure Blockchain Workbench to version 1.7.1.
9+
Upgrades Azure Blockchain Workbench to version 1.7.2.
1010
1111
.PARAMETER SubscriptionID
1212
SubscriptionID to create or locate all resources.
@@ -32,8 +32,8 @@ C:\tmp> .\azureBlockchainWorkbenchUpgradeTov1_7_1.ps1 -SubscriptionID "<subscrip
3232
param(
3333
[Parameter(Mandatory = $true)][string]$SubscriptionID,
3434
[Parameter(Mandatory = $true)][string]$ResourceGroupName,
35-
[Parameter(Mandatory = $false)][string]$TargetDockerTag = "1.7.1",
36-
[Parameter(Mandatory = $false)][string]$ArtifactsRoot = "https://catalogartifact.azureedge.net/publicartifacts/microsoft-azure-blockchain.azure-blockchain-workbench-2746f4b9-2c06-4718-91e2-429c235dce07-azure-blockchain-workbench/Artifacts",
35+
[Parameter(Mandatory = $false)][string]$TargetDockerTag = "1.7.2",
36+
[Parameter(Mandatory = $false)][string]$ArtifactsRoot = "https://catalogartifact.azureedge.net/publicartifacts/microsoft-azure-blockchain.azure-blockchain-workbench-c92dd56c-382d-4a3d-9d9b-0d74fd3fa2e4-azure-blockchain-workbench/Artifacts",
3737
[Parameter(Mandatory = $false)][string]$DockerRepository = "blockchainworkbenchprod.azurecr.io",
3838
[Parameter(Mandatory = $false)][string]$DockerLogin = $null,
3939
[Parameter(Mandatory = $false)][string]$DockerPw = $null,
@@ -76,9 +76,7 @@ elseif ($TestEnv -And (Get-Module -ListAvailable -Name AzureRM)) {
7676
Set-Alias -Name Get-AzServiceBusNamespace -Value Get-AzureRmServiceBusNamespace
7777
Set-Alias -Name Get-AzEventGridTopic -Value Get-AzureRmEventGridTopic
7878
Set-Alias -Name Get-AzEventGridTopicKey -Value Get-AzureRmEventGridTopicKey
79-
Set-Alias -Name Get-AzServiceBusQueue -Value Get-AzureRmServiceBusQueue
8079
Set-Alias -Name New-AzServiceBusQueue -Value New-AzureRmServiceBusQueue
81-
Set-Alias -Name Get-AzServiceBusTopic -Value Get-AzureRmServiceBusTopic
8280
Set-Alias -Name New-AzServiceBusTopic -Value New-AzureRmServiceBusTopic
8381
Set-Alias -Name Remove-AzVmssExtension -Value Remove-AzureRmVmssExtension
8482
Set-Alias -Name Add-AzVmssExtension -Value Add-AzureRmVmssExtension
@@ -153,12 +151,19 @@ if (-Not $uiWebsite) {
153151
$uiWebsite = Get-AzWebApp -ResourceGroupName $ResourceGroupName -Name $uiWebsite.Name
154152

155153
# Locate the service bus
156-
$serviceBusNs = Get-AzServiceBusNamespace -ResourceGroupName $ResourceGroupName -ErrorAction SilentlyContinue
154+
$serviceBusNs = (Get-AzServiceBusNamespace -ResourceGroupName $ResourceGroupName -ErrorAction SilentlyContinue)[0]
157155
if (-Not $serviceBusNs) {
158156
throw "Could not locate Service Bus within the resource group $ResourceGroupName. Is this a Blockchain Workbench deployment?"
159157
}
160158

161-
$eventGrid = (Get-AzEventGridTopic -ResourceGroupName $ResourceGroupName).PsTopicsList
159+
# Discrepancy between Az and AzureRM
160+
if ($TestEnv) {
161+
$eventGrid = (Get-AzEventGridTopic -ResourceGroupName $ResourceGroupName)[0]
162+
}
163+
else {
164+
$eventGrid = (Get-AzEventGridTopic -ResourceGroupName $ResourceGroupName).PsTopicsList
165+
}
166+
162167
if (-Not $eventGrid) {
163168
throw "Could not locate EventGrid within the resource group $ResourceGroupName. Is this a Blockchain Workbench deployment?"
164169
}
@@ -304,7 +309,7 @@ Write-Progress -Id $logID -Activity "Pre-Requisites" -Status "Checking for servi
304309

305310
# Create the Service Bus queue "ingressQueue", "internalQueue" and topic "egressTopic" if they don't exist
306311
$queueName = "internalQueue"
307-
$queue = Get-AzServiceBusQueue -ResourceGroupName $ResourceGroupName -Namespace $serviceBusNs -Name $queueName -ErrorAction SilentlyContinue
312+
$queue = Get-AzServiceBusQueue -ResourceGroupName $ResourceGroupName -Namespace $serviceBusNs.Name -Name $queueName -ErrorAction SilentlyContinue
308313
if (-Not $queue) {
309314
Write-Progress -Id $logID -Activity "Pre-Requisites" -Status "Checking for service bus queue..." -PercentComplete 35
310315

@@ -325,7 +330,7 @@ if (-Not $queue) {
325330
}
326331

327332
$queueName = "ingressQueue"
328-
$queue = Get-AzServiceBusQueue -ResourceGroupName $ResourceGroupName -Namespace $serviceBusNs -Name $queueName -ErrorAction SilentlyContinue
333+
$queue = Get-AzServiceBusQueue -ResourceGroupName $ResourceGroupName -Namespace $serviceBusNs.Name -Name $queueName -ErrorAction SilentlyContinue
329334
if (-Not $queue) {
330335
Write-Progress -Id $logID -Activity "Pre-Requisites" -Status "Checking for service bus queue..." -PercentComplete 35
331336

@@ -346,7 +351,7 @@ if (-Not $queue) {
346351
}
347352

348353
$topicName = "egressTopic"
349-
$topic = Get-AzServiceBusTopic -ResourceGroupName $ResourceGroupName -Namespace $serviceBusNs -Name $topicName -ErrorAction SilentlyContinue
354+
$topic = Get-AzServiceBusTopic -ResourceGroupName $ResourceGroupName -Namespace $serviceBusNs.Name -Name $topicName -ErrorAction SilentlyContinue
350355
if (-Not $topic) {
351356
Write-Progress -Id $logID -Activity "Pre-Requisites" -Status "Checking for service bus topic..." -PercentComplete 35
352357

@@ -579,5 +584,4 @@ if ($TestApi) {
579584
# Script exit
580585
#############################################
581586

582-
Write-Output "Azure Blockchain Workbench in Resource Group $ResourceGroupName was successfully updated to version 1.7.1."
583-
Write-Warning "Important: If you are upgrading from a version older than 1.5.0 you will need to upgrade your AAD application registration as well. Please visit https://aka.ms/workbenchAADUpgrade to perform the necessary updates."
587+
Write-Output "Azure Blockchain Workbench in Resource Group $ResourceGroupName was successfully updated to version 1.7.2."

blockchain-workbench/scripts/upgrade/readme.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Overview
55
=================
6-
An existing deployment of Azure Blockchain Workbench can be upgraded to the latest version. This PowerShell script automates the upgrade of your Azure Blockchain Workbench deployment.
6+
An existing deployment of Azure Blockchain Workbench can be upgraded to the latest version. This PowerShell script automates the upgrade of your Azure Blockchain Workbench deployment.
77

88
To learn what's new in this release, please check our [release notes](releasenotes.md).
99

@@ -14,22 +14,22 @@ To run this script you need to have the cross-platform [Azure PowerShell](https:
1414
We recommend using [Azure CloudShell](https://shell.azure.com/powershell) since it comes with with all dependencies installed, however, you can run this script on any operating system that has [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6) and [Az PowerShell](https://docs.microsoft.com/en-us/powershell/azure/install-az-ps) installed.
1515

1616

17-
1. Open [Azure CloudShell](https://shell.azure.com/powershell) and select the tenant Workbench is deployed to.
17+
1. Open [Azure CloudShell](https://shell.azure.com/powershell) and select the tenant Workbench is deployed to.
1818

1919
![CloudShell open](./media/cloudshell-open.png)
2020

2121
2. Download the script. You can download the upgrade script automatically by using the command bellow, or you can download it from this repository manually
2222

2323
```powershell
24-
cd; Invoke-WebRequest -Uri https://aka.ms/workbenchUpgradeScript -OutFile azureBlockchainWorkbenchUpgradeTov1_7_0.ps1
24+
cd; Invoke-WebRequest -Uri https://aka.ms/workbenchUpgradeScript -OutFile azureBlockchainWorkbenchUpgradeToLatest.ps1
2525
2626
```
2727

2828
3. Locate your Azure subscription ID, and the resource group name where you deployed Azure Blockchain Workbench and Execute the script.
2929

3030

3131
```powershell
32-
./azureBlockchainWorkbenchUpgradeTov1_7_0.ps1 -SubscriptionID <subscription_id> -ResourceGroupName <workbench-resource-group-name>
32+
./azureBlockchainWorkbenchUpgradeToLatest.ps1 -SubscriptionID <subscription_id> -ResourceGroupName <workbench-resource-group-name>
3333
3434
```
3535

@@ -38,9 +38,7 @@ cd; Invoke-WebRequest -Uri https://aka.ms/workbenchUpgradeScript -OutFile azureB
3838
When the upgrade completes, you will see the following message:
3939

4040
```powershell
41-
Azure Blockchain Workbench in Resource Group $ResourceGroupName was successfully updated to version 1.7.0.
42-
43-
WARNING: Important: If you are upgrading from a version older than 1.5.0 you will need to upgrade your AAD application registration as well. Please visit https://aka.ms/workbenchAADUpgrade to perform the necessary updates.
41+
Azure Blockchain Workbench in Resource Group $ResourceGroupName was successfully updated to version 1.7.2.
4442
4543
```
4644

0 commit comments

Comments
 (0)