finn0013
finn0013

Reputation: 195

Need help setting ARR Affinity and HTTP Version in Powershell

I am trying to set the HTTP Version and ARR Affinity settings after calling New-AzWebApp. I have tried a ton of variations of this and cannot seem to find any documentation as to what a valid list of these are. For example, to set the stack you must use "CURRENT_STACK" but when I look at the environment template there is no mention of current_stack or stack. I have also made sure I'm using the most up to date Az module.

These are the calls I started with, based on findings elsewhere on the internet. However, after calling this the Stack is updated but neither HTTP Version or ARR Affinity are updated.

$PropertiesObject = @{
CURRENT_STACK =  "dotnet"
http20Enabled = $true
clientAffinityEnabled = $false
}
New-AzResource -ResourceGroupName "JASON-SCRIPT-TEST" 
            -ResourceType "Microsoft.Web/sites/config" 
            -ResourceName "jason-script-test/metadata" 
            -PropertyObject $PropertiesObject 
            -Force

$AppService = Set-AzWebApp -ResourceGroupName "JASON-SCRIPT-TEST" 
                        -AppServicePlan "JASON-SCRIPT-TEST-APPSVCPLN" 
                        -Name "jason-script-test"

Any help getting these set is appreciated. Also, if anyone knows where I can find a list of the valid values to be set here that would be awesome.

Upvotes: 0

Views: 510

Answers (1)

finn0013
finn0013

Reputation: 195

So after trying a ton of different things, as well as digging through the PowerShell AZ code, this is how I finally got it to set through PowerShell.

AppService = Get-AzWebApp -ResourceGroup $ResourceGroupName `
                          -Name $AppServiceName
$AppService.ClientAffinityEnabled = $false
$AppService.SiteConfig.Http20Enabled = $true

$AppService | Set-AzWebApp

Upvotes: 2

Related Questions