Skip to content

Commit 4935050

Browse files
committed
added - Add access restrictions rules programmatically
1 parent a64406c commit 4935050

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

articles/app-service/app-service-ip-restrictions.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,31 @@ For ARM templates, modify the property `ipSecurityRestrictions`. A sample ARM te
251251
}
252252
```
253253

254+
### [Bicep](#tab/bicep)
255+
256+
For Bicep, modify the property `ipSecurityRestrictionsDefaultAction`. A sample Bicep snippet is provided for you:
257+
258+
```bicep
259+
resource appService 'Microsoft.Web/sites@2020-06-01' = {
260+
name: webSiteName
261+
location: location
262+
properties: {
263+
serverFarmId: appServicePlan.id
264+
siteConfig: {
265+
linuxFxVersion: linuxFxVersion
266+
ipSecurityRestrictions: [
267+
{
268+
ipAddress: '122.133.144.0/24'
269+
action: 'Allow'
270+
priority: 100
271+
name: 'IP example rule'
272+
}
273+
]
274+
}
275+
}
276+
}
277+
```
278+
254279
---
255280

256281
You can also set values manually by doing one of the following options:
@@ -305,7 +330,7 @@ You can change *Unmatched rule action* for *Main site* programmatically by doing
305330

306331
### [Azure CLI](#tab/azurecli)
307332

308-
Run the following command in the [Cloud Shell](https://shell.azure.com). Use [the Azure CLI](/cli/azure/resource?view=azure-cli-latest#az-resource-update). Accepted values for `ipSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
333+
Run the following command in the [Cloud Shell](https://shell.azure.com). Use [the Azure CLI](/cli/azure/resource?view=azure-cli-latest#az-resource-update&preserve-view=true). Accepted values for `ipSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
309334

310335
```azurecli-interactive
311336
az resource update --resource-group ResourceGroup --name AppName --resource-type "Microsoft.Web/sites" \
@@ -397,7 +422,7 @@ You can change *Unmatched rule action* for *Advanced tool site* programmatically
397422

398423
### [Azure CLI](#tab/azurecli)
399424

400-
Run the following command in the [Cloud Shell](https://shell.azure.com). Use [the Azure CLI](/cli/azure/resource?view=azure-cli-latest#az-resource-update). Accepted values for `scmIpSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
425+
Run the following command in the [Cloud Shell](https://shell.azure.com). Use [the Azure CLI](/cli/azure/resource?view=azure-cli-latest#az-resource-update&preserve-view=true). Accepted values for `scmIpSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
401426

402427
```azurecli-interactive
403428
az resource update --resource-group ResourceGroup --name AppName --resource-type "Microsoft.Web/sites" \

0 commit comments

Comments
 (0)