Skip to content

Commit 6a6516b

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

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ You can add access restrictions rules programmatically by doing one of the follo
199199

200200
### [Azure CLI](#tab/azurecli)
201201

202-
Run the following command in the [Cloud Shell](https://shell.azure.com). Use [the Azure CLI](/cli/azure/webapp/config/access-restriction). For example:
202+
You can run the following command in the [Cloud Shell](https://shell.azure.com). For more information about *az webapp config access-restriction* command visit [this page](/cli/azure/webapp/config/access-restriction).
203203

204204
```azurecli-interactive
205205
az webapp config access-restriction add --resource-group ResourceGroup --name AppName \
@@ -208,7 +208,7 @@ Run the following command in the [Cloud Shell](https://shell.azure.com). Use [th
208208

209209
### [PowerShell](#tab/powershell)
210210

211-
To do the same with PowerShell, run the following command in the [Cloud Shell](https://shell.azure.com). Use [Azure PowerShell](/powershell/module/Az.Websites/Add-AzWebAppAccessRestrictionRule). For example:
211+
You can run the following command in the [Cloud Shell](https://shell.azure.com). For more information about *Add-AzWebAppAccessRestrictionRule* command visit [this page](/powershell/module/Az.Websites/Add-AzWebAppAccessRestrictionRule).
212212

213213
```azurepowershell-interactive
214214
Add-AzWebAppAccessRestrictionRule -ResourceGroupName "ResourceGroup" -WebAppName "AppName"
@@ -217,7 +217,7 @@ To do the same with PowerShell, run the following command in the [Cloud Shell](h
217217

218218
### [ARM](#tab/arm)
219219

220-
For ARM templates, modify the property `ipSecurityRestrictions`. A sample ARM template snippet is provided for you:
220+
For ARM templates, modify the `ipSecurityRestrictions` block. A sample ARM template snippet is provided for you.
221221

222222
```ARM
223223
{
@@ -253,7 +253,7 @@ For ARM templates, modify the property `ipSecurityRestrictions`. A sample ARM te
253253

254254
### [Bicep](#tab/bicep)
255255

256-
For Bicep, modify the property `ipSecurityRestrictionsDefaultAction`. A sample Bicep snippet is provided for you:
256+
For Bicep, modify the `ipSecurityRestrictions` block. A sample Bicep snippet is provided for you.
257257

258258
```bicep
259259
resource appService 'Microsoft.Web/sites@2020-06-01' = {
@@ -262,6 +262,8 @@ resource appService 'Microsoft.Web/sites@2020-06-01' = {
262262
properties: {
263263
serverFarmId: appServicePlan.id
264264
siteConfig: {
265+
ftpsState: ftpsState
266+
alwaysOn: alwaysOn
265267
linuxFxVersion: linuxFxVersion
266268
ipSecurityRestrictions: [
267269
{
@@ -330,7 +332,7 @@ You can change *Unmatched rule action* for *Main site* programmatically by doing
330332

331333
### [Azure CLI](#tab/azurecli)
332334

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`.
335+
You can run the following command in the [Cloud Shell](https://shell.azure.com). For more information about *az resource* command visit [this page](/cli/azure/resource?view=azure-cli-latest#az-resource-update&preserve-view=true). Accepted values for `ipSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
334336

335337
```azurecli-interactive
336338
az resource update --resource-group ResourceGroup --name AppName --resource-type "Microsoft.Web/sites" \
@@ -339,7 +341,7 @@ Run the following command in the [Cloud Shell](https://shell.azure.com). Use [th
339341

340342
### [PowerShell](#tab/powershell)
341343

342-
To do the same with PowerShell, run the following command in the [Cloud Shell](https://shell.azure.com). Use [Azure PowerShell](/powershell/module/az.resources/set-azresource). Accepted values for `ipSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
344+
You can run the following command in the [Cloud Shell](https://shell.azure.com) For more information about *Set-AzResource* command visit [this page](/powershell/module/az.resources/set-azresource). Accepted values for `ipSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
343345

344346
```azurepowershell-interactive
345347
$Resource = Get-AzResource -ResourceType Microsoft.Web/sites -ResourceGroupName ResourceGroup -ResourceName AppName
@@ -349,7 +351,7 @@ To do the same with PowerShell, run the following command in the [Cloud Shell](h
349351

350352
### [ARM](#tab/arm)
351353

352-
For ARM templates, modify the property `ipSecurityRestrictionsDefaultAction`. Accepted values for `ipSecurityRestrictionsDefaultAction` are `Allow` or `Deny`. A sample ARM template snippet is provided for you:
354+
For ARM templates, modify the property `ipSecurityRestrictionsDefaultAction`. Accepted values for `ipSecurityRestrictionsDefaultAction` are `Allow` or `Deny`. A sample ARM template snippet is provided for you.
353355

354356
```ARM
355357
{
@@ -378,7 +380,7 @@ For ARM templates, modify the property `ipSecurityRestrictionsDefaultAction`. Ac
378380

379381
### [Bicep](#tab/bicep)
380382

381-
For Bicep, modify the property `ipSecurityRestrictionsDefaultAction`. A sample Bicep snippet is provided for you:
383+
For Bicep, modify the property `ipSecurityRestrictionsDefaultAction`. A sample Bicep snippet is provided for you.
382384

383385
```bicep
384386
resource appService 'Microsoft.Web/sites@2020-06-01' = {
@@ -387,9 +389,10 @@ resource appService 'Microsoft.Web/sites@2020-06-01' = {
387389
properties: {
388390
serverFarmId: appServicePlan.id
389391
siteConfig: {
392+
ftpsState: ftpsState
393+
alwaysOn: alwaysOn
390394
linuxFxVersion: linuxFxVersion
391395
ipSecurityRestrictionsDefaultAction: ipSecurityRestrictionsDefaultAction
392-
scmIpSecurityRestrictionsDefaultAction: scmIpSecurityRestrictionsDefaultAction
393396
}
394397
}
395398
}
@@ -422,7 +425,7 @@ You can change *Unmatched rule action* for *Advanced tool site* programmatically
422425

423426
### [Azure CLI](#tab/azurecli)
424427

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`.
428+
You can run the following command in the [Cloud Shell](https://shell.azure.com). For more information about *az resource* command visit [this page](/cli/azure/resource?view=azure-cli-latest#az-resource-update&preserve-view=true). Accepted values for `scmIpSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
426429

427430
```azurecli-interactive
428431
az resource update --resource-group ResourceGroup --name AppName --resource-type "Microsoft.Web/sites" \
@@ -431,7 +434,7 @@ Run the following command in the [Cloud Shell](https://shell.azure.com). Use [th
431434

432435
### [PowerShell](#tab/powershell)
433436

434-
To do the same with PowerShell, run the following command in the [Cloud Shell](https://shell.azure.com). Use [Azure PowerShell](/powershell/module/az.resources/set-azresource). Accepted values for `scmIpSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
437+
You can run the following command in the [Cloud Shell](https://shell.azure.com). For more information about *Set-AzResource* command visit [this page](/powershell/module/az.resources/set-azresource). Accepted values for `scmIpSecurityRestrictionsDefaultAction` are `Allow` or `Deny`.
435438

436439
```azurepowershell-interactive
437440
$Resource = Get-AzResource -ResourceType Microsoft.Web/sites -ResourceGroupName ResourceGroup -ResourceName AppName
@@ -441,7 +444,7 @@ To do the same with PowerShell, run the following command in the [Cloud Shell](h
441444

442445
### [ARM](#tab/arm)
443446

444-
For ARM templates, modify the property `scmIpSecurityRestrictionsDefaultAction`. Accepted values for `scmIpSecurityRestrictionsDefaultAction` are `Allow` or `Deny`. A sample ARM template snippet is provided for you:
447+
For ARM templates, modify the property `scmIpSecurityRestrictionsDefaultAction`. Accepted values for `scmIpSecurityRestrictionsDefaultAction` are `Allow` or `Deny`. A sample ARM template snippet is provided for you.
445448

446449
```ARM
447450
{
@@ -470,7 +473,7 @@ For ARM templates, modify the property `scmIpSecurityRestrictionsDefaultAction`.
470473

471474
### [Bicep](#tab/bicep)
472475

473-
For Bicep, modify the property `scmIpSecurityRestrictionsDefaultAction`. A sample Bicep snippet is provided for you:
476+
For Bicep, modify the property `scmIpSecurityRestrictionsDefaultAction`. A sample Bicep snippet is provided for you.
474477

475478
```bicep
476479
resource appService 'Microsoft.Web/sites@2020-06-01' = {
@@ -479,6 +482,8 @@ resource appService 'Microsoft.Web/sites@2020-06-01' = {
479482
properties: {
480483
serverFarmId: appServicePlan.id
481484
siteConfig: {
485+
ftpsState: ftpsState
486+
alwaysOn: alwaysOn
482487
linuxFxVersion: linuxFxVersion
483488
scmIpSecurityRestrictionsDefaultAction: scmIpSecurityRestrictionsDefaultAction
484489
}

0 commit comments

Comments
 (0)