shane
shane

Reputation: 23

Add authentication for private nuget feed in ARM template

The ARM template requirements for importing/applying a site extension nuget package is clear, but requires a public feed. What method should be used with a private Azure DevOps artifact nuget feed that requires authentication?

Template snippet below works with public feed, but returns Invalid feed Uri when private.

{
        "name": "[variables('webAppName')]",
        "type": "Microsoft.Web/sites",
        "kind": "app",
        "location": "[resourceGroup().location]",
        "apiVersion": "2015-08-01",
        "dependsOn": [
            "[resourceId('Microsoft.Web/serverfarms', variables('appServiceName'))]"
        ],
        "tags": {},
        "properties": {
            "name": "[variables('webAppName')]",
            "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServiceName'))]",
            "siteConfig": {
                "WindowsFxVersion": "[parameters('windowsFxVersion')]",
                "ftpsState": "Disabled",
                "phpVersion": "Off",
                "use32BitWorkerProcess": false,
                "http20Enabled": true,
                "minTlsVersion": "1.2",
                "defaultDocuments": [
                    "index.html"
                ]
            },
            "hostNames": [
                "[concat('wa-', parameters('baseAppName'),'.azurewebsites.net')]"
            ],
            "siteProperties": {
                "metadata": null,
                "properties": [{
                        "name": "LinuxFxVersion",
                        "value": null
                    },
                    {
                        "name": "WindowsFxVersion",
                        "value": "DOTNETCORE|2.2"
                    }
                ],
                "appSettings": null,

                "httpsOnly": true
            },
            "availabilityState": "Normal",
            "sslCertificates": null,
            "httpsOnly": true,
            "csrs": [],
            "cers": null,
            "siteMode": null,
            "enabledHostNames": [
                "[concat('wa-', parameters('baseAppName'),'.azurewebsites.net')]",
                "[concat('wa-', parameters('baseAppName'),'.scm.azurewebsites.net')]"
            ]
        },
        "resources": [{
                "name": "appsettings",
                "type": "config",
                "apiVersion": "2015-08-01",
                "dependsOn": [
                    "[concat('Microsoft.Web/sites/', variables('webAppName'))]"
                ],
                "properties": {
                    "SCM_SITEEXTENSIONS_FEED_URL": "[PRIVATE NUGET FEED]"
                }
            },
            {
                "apiVersion": "2015-08-01",
                "name": "[SITE EXTENSION NAME]",
                "type": "siteextensions",
                "dependsOn": [
                    "[resourceId('Microsoft.Web/Sites', variables('webAppName'))]",
                    "[concat(resourceId('Microsoft.Web/Sites', variables('webAppName')),'/config/appsettings')]"
                ],
                "properties": {}
            }

        ]
    }

Upvotes: 2

Views: 177

Answers (1)

bmoore-msft
bmoore-msft

Reputation: 8727

It's not possible to use a private endpoint in a template deployment at this time.

Upvotes: 1

Related Questions