DEV Community

Discussion on: Auto-scaling Azures SignalR Service via Powershell Function

Collapse
 
ealcyon profile image
Éric Lambert • Edited

Hi Matt,

Thank you for this script and for your time.

As I was getting the following error:

ERROR: Set-AzResource: Conflict: The resource is not on an infrastructure that supports Network ACL.

I replaced the following lines (in the run.ps1 file) :

$signalRResource.Sku.Capacity = $targetUnitCount
$signalRResource | Set-AzResource -Force

by

Update-AzSignalR -ResourceId $resourceId -UnitCount $targetUnitCount

This cmdlet comes from the Az.SignalR module (available in the Azure function thanks to :
"managedDependency": {"enabled": true}
(property found in the host.json file)

For your information, my SignalR resource was created a long time ago.

Thanks again and good luck

Message update (May 13, 2020) :

After a while, the Get-AzResource command returned :
invalid status code 'BadRequest'
StatusCode: 400

So I also had to replace the following line:
$signalRResource = Get-AzResource -ResourceId $resourceId -Verbose

by

$signalRResource = Get-AzSignalR -ResourceId $resourceId -Verbose