Azure-docs: Add SCM ip restrictions programmatically

Created on 13 May 2019  Â·  4Comments  Â·  Source: MicrosoftDocs/azure-docs

Is there a way to automate the "Box Check" the article mentions via powershell, az cli or ARM templates?

This part only mentions the application of rules for the main site.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

app-service-wesvc cxp product-question triaged

Most helpful comment

Oh, i see. It's ok then, thanks a lot.

To future people, what @ccompy mentions is correct, located here:
https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2018-02-01/sites

An example:

    "resources": [
        {
            "apiVersion": "2018-02-01",
            "name": "[concat(parameters('appName'), '/', parameters('slotName'))]",
            "type": "Microsoft.Web/Sites/slots",
            "location": "[resourceGroup().location]",
            "tags": {
            },
            "properties": {
                "siteConfig": {
                    "ipSecurityRestrictions":  "[variables('firewallRules')]",
                    "scmIpSecurityRestrictionsUseMain": true
                }
            }
        }
    ]

All 4 comments

@AugerC Thanks for the comment! We will check on this request and get back to you soon.

There is a setting in the config section under your app where all of the rules go. Also there is a config item. When set to true, your scm site uses the rules set for your app.
"scmIpSecurityRestrictionsUseMain": true
We do not have CLI/PowerShell for all of this yet.

@AugerC, Just checking in to see if you have had a chance to see the previous response. Kindly let us know if you need further assistance on this issue or is good to be closed.

Oh, i see. It's ok then, thanks a lot.

To future people, what @ccompy mentions is correct, located here:
https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2018-02-01/sites

An example:

    "resources": [
        {
            "apiVersion": "2018-02-01",
            "name": "[concat(parameters('appName'), '/', parameters('slotName'))]",
            "type": "Microsoft.Web/Sites/slots",
            "location": "[resourceGroup().location]",
            "tags": {
            },
            "properties": {
                "siteConfig": {
                    "ipSecurityRestrictions":  "[variables('firewallRules')]",
                    "scmIpSecurityRestrictionsUseMain": true
                }
            }
        }
    ]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

spottedmahn picture spottedmahn  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

mrdfuse picture mrdfuse  Â·  3Comments