I'm trying to modify the IP restrictions for my Azure function app using Azure PowerShell. I'm using the method described here: Modify Azure AppService ipsecurity during release from VSTS
$r = Get-AzureRmResource -ResourceGroupName "Resoucegroup name" -ResourceType Microsoft.Web/sites/config -ResourceName resourcename -ApiVersion 2016-08-01
$p = $r.Properties
$p.ipSecurityRestrictions = @()
$restriction = @{}
$restriction.Add("ipAddress","0.0.0.0")
$restriction.Add("subnetMask","0.0.0.0")
$p.ipSecurityRestrictions+= $restriction
Set-AzureRmResource -ResourceGroupName "Resoucegroup name" -ResourceType Microsoft.Web/sites/config -ResourceName resourcename -ApiVersion 2016-08-01 -PropertyObject $p -Force
However the Set-AzureRmResource CmdLet fails with error:
The requested resource does not support http method 'PUT'.
Any ideas?
However, to configure your IP whitelist for a specific web application, navigate to Settings, Networking, <the Web App overview page>. Under IP restrictions, click Configure IP restrictions. You can add a rule by specifying an IP address, or an IP address range, and providing a subnet mask.
You can restrict internet access in a couple of ways: Private endpoints: Restrict inbound traffic to your function app by private link over your virtual network, effectively blocking inbound traffic from the public internet. IP restrictions: Restrict inbound traffic to your function app by IP range.
Deploying an Azure function in an App Service Environment is currently the only way to have a static inbound and outbound IP for your function. Yes, the Application Gateway v2 SKU supports static public IP addresses. You can choose Application Gateway Dynamic or Static IP during the resource creation.
What are you using for your resourcename
? It should be yourFunctionAppName/web
Your commands work exactly as is for me replacing Resoucegroup name
with my resourceGroup name, and resourcename
with my-function-app-name/web
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With