Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AzureBasicLoadBalancerUpgrade'

# Version number of this module.
ModuleVersion = '2.5.38'
ModuleVersion = '2.5.39'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -107,7 +107,7 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = 'Add note for -multiLBConfig internal LB outbound connectivity warning.'
ReleaseNotes = 'Improve NAT Rule migration logging and error handling.'

# Prerelease string of this module
# Prerelease = 'beta'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ function NatRulesMigration {
log "Error" $message
}
}
log -Message "[NatRulesMigration] Saving Standard Load Balancer $($StdLoadBalancer.Name)"
log -Message "[NatRulesMigration] Starting saving Standard Load Balancer $($StdLoadBalancer.Name)..."

if ($StdLoadBalancer.InboundNatRules.Count -eq 0) {
log -Message "[NatRulesMigration] No NAT Rules to migrate. Skipping save."
return
}
else {
log -Message "[NatRulesMigration] $($StdLoadBalancer.InboundNatRules.Count) NAT Rules migrated. Saving Standard Load Balancer '$($StdLoadBalancer.Name)'..."

try {
$ErrorActionPreference = 'Stop'

Expand All @@ -163,7 +165,7 @@ function NatRulesMigration {
}

If ($UpdateLBNATRulesJob.Error -or $UpdateLBNATRulesJob.State -eq 'Failed') {
Write-Error $UpdateLBNATRulesJob.Error
log -Severity Error -Message "Saving Standard Load Balancer $($StdLoadBalancer.Name) failed with the following errors: $($UpdateLBNATRulesJob.error; $UpdateLBNATRulesJob | Receive-Job). Migration will continue--to recover, manually add the NAT rules to the load balancer, then correct NAT Rule NIC membership after the script completes."
}
}
catch {
Expand Down
Loading