Azure / Azure/azure-powershell

Set-AzureRmApplicationGateway - cannot update certificates for gateway with Minimum scale units 0

Open
#12,160 9 comments 0 reactions 1 assignee Claimed by @surajmb View on GitHub
act-quality-productivity-squad customer-reported Network - Application Gateway question Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

## Description
I'm trying to automate Let's encrypt certificate renewal. I'm using following script: https://github.com/intelequia/letsencrypt-aw/blob/master/letsencryptaw_v2.ps1

to renew the certificate. Problem is when I call `Set-AzureRmApplicationGateway` - it fails with error message:

```
Set-AzureRmApplicationGateway : 'MinCapacity' is less than minimum value of '2'.

At line:122 char:1

+ Set-AzureRmApplicationGateway -ApplicationGateway $appgw

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : CloseError: (:) [Set-AzureRmApplicationGateway], ValidationException

+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.SetAzureApplicationGatewayCommand
```

I don't change the `MinCapacity` anywhere, I don't touch it.

If I modify the gateway in Azure portal and set it to minimum scale to 2, as required, then it works and command succeeds.

## Steps to reproduce

```powershell
$appgw = Get-AzureRmApplicationGateway -ResourceGroupName $AGResourceGroupName -Name $AGName
Set-AzureRmApplicationGatewaySSLCertificate -Name $AGOldCertName -ApplicationGateway $appgw -CertificateFile $certPfxPath -Password $password
Set-AzureRmApplicationGateway -ApplicationGateway $appgw
```

## Module versions
It is Azure automation script. I couldn't run `Get-Module` because of
```
The runbook job failed due to a job stream being larger than 1MB, the limit that is supported by an Azure Automation sandbox.
```

error so I copied data from portal shared modules:

```
ACME-PS 1.2.3
AuditPolicyDsc 1.1.0.0
Azure 5.3.0
Azure.Storage 4.6.1
AzureRM.Automation 6.1.1
AzureRM.Compute 5.9.1
AzureRM.Network 6.11.1
AzureRM.Profile 5.8.3
AzureRM.Resources 6.7.3
AzureRM.Sql 4.12.1
AzureRM.Storage 5.2.0
ComputerManagementDsc 5.0.0.0
GPRegistryPolicyParser 0.2
Microsoft.PowerShell.Core 0.0
Microsoft.PowerShell.Diagnostics
Microsoft.PowerShell.Management
Microsoft.PowerShell.Security
Microsoft.PowerShell.Utility
Microsoft.WSMan.Management
Orchestrator.AssetManagement.Cmdlets 1.0
PSDscResources 2.9.0.0
SecurityPolicyDsc 2.1.0.0
StateConfigCompositeResources 1.0
xDSCDomainjoin 1.1
xPowerShellExecutionPolicy 1.1.0.0
xRemoteDesktopAdmin 1.1.0.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.