From b912c143130701a49eaea6ad14c6d1ea9aa970c0 Mon Sep 17 00:00:00 2001 From: xingyang-li Date: Fri, 22 Mar 2024 13:12:39 -0700 Subject: [PATCH] changed template structure --- .github/workflows/deploy_resources.yml | 2 +- README.md | 12 +- deploy.ps1 | 4 +- deploy.sh | 2 +- templates/stf-eastus.json | 1374 ----------------- templates/stf-eastus2euap.json | 1374 ----------------- templates/stf-northcentralus.json | 1374 ----------------- templates/stf-northeurope.json | 1374 ----------------- .../{stf-centraluseuap.json => stf-prod.json} | 42 +- templates/stf-southcentralus.json | 1374 ----------------- templates/stf-test.json | 42 +- templates/stf-westcentralus.json | 1374 ----------------- templates/stf-westeurope.json | 1374 ----------------- templates/stf-westus2.json | 1209 --------------- 14 files changed, 22 insertions(+), 10909 deletions(-) delete mode 100644 templates/stf-eastus.json delete mode 100644 templates/stf-eastus2euap.json delete mode 100644 templates/stf-northcentralus.json delete mode 100644 templates/stf-northeurope.json rename templates/{stf-centraluseuap.json => stf-prod.json} (97%) delete mode 100644 templates/stf-southcentralus.json delete mode 100644 templates/stf-westcentralus.json delete mode 100644 templates/stf-westeurope.json delete mode 100644 templates/stf-westus2.json diff --git a/.github/workflows/deploy_resources.yml b/.github/workflows/deploy_resources.yml index eaeb1e7..412fe75 100644 --- a/.github/workflows/deploy_resources.yml +++ b/.github/workflows/deploy_resources.yml @@ -61,7 +61,7 @@ jobs: azcliversion: 2.30.0 inlineScript: | chmod +x $GITHUB_WORKSPACE/deploy.sh - $GITHUB_WORKSPACE/deploy.sh stf-${{ matrix.location }} ${{ matrix.location }} + $GITHUB_WORKSPACE/deploy.sh stf-${{ matrix.location }} ${{ matrix.location }} templates/stf-prod.json build-api-app: needs: get-locations diff --git a/README.md b/README.md index a3d7d57..983626f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ To introduce changes to the framework and set up local testing, please follow th 4. Get access to the "WAWS Swift Test" Azure subscription. (Needed to test ARM template changes) -### Manipulating Azure Resources +### Creating Azure Resources There is a resource group deployed to every region defined in `location_matrix.json`. To extend this framework to another region, add the desired region name to this file. @@ -28,17 +28,17 @@ The ARM templates that define the resources are located in the `templates` folde To locally test ARM template changes, you can deploy resources to Azure using Azure Powershell. 1. Open Powershell and login to Azure with: `az login` -2. Set your subscription to the 'WAWS Swift Test': `Az-SetContext {WAWS Swift Test Subscription ID}` (You may need to run `az account set --subscription {WAWS Swift Test Subscription ID}` instead if Azure CLI is already set up for your Powershell instead of Azure Powershell.) +2. Set your subscription to the 'WAWS Swift Test': `az account set --subscription {WAWS Swift Test Subscription ID}` (You may need to run `Az-SetContext {WAWS Swift Test Subscription ID}` instead if Azure Powershell is already set up for your Powershell instead of Azure CLI.) 3. Add ARM template changes to `templates\stf-test.json` file. -4. Run: `.\deploy.ps1 -projectName {resource group name} -location {desired location}` +4. Run: `.\deploy.ps1 -projectName {resource group name} -location {desired location} -templateFile .\templates\stf-test.json` 5. Navigate to the specified resource group in the Azure portal to verify that the deployment succeeded. +6. Copy over all contents from stf-test.json to stf-prod.json once you have tested the deployment so that the Github Actions workflow will deploy your changes across all regions once the changes have been checked in. - -### Adding API Changes +### Adding API Controller Each resource group contains canary web apps that will host an API app to connect/interact with other resources in the group. The code for these apps is located under `src\SwiftTestingFrameworkAPI`. -The app is an ASP.NET Core web API project, and you will need to make a new API endpoint for each new feature/test you would like to add to the framework. +The app is an ASP.NET Core web API project, and you will need to make a new API controller for each new feature/test you would like to add to the framework. This is a good resource for developing ASP.NET Core API code: [https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-6.0](https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-6.0) diff --git a/deploy.ps1 b/deploy.ps1 index 06e0e53..c83c36a 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -1,5 +1,5 @@ -param([string]$projectName, [string]$location) +param([string]$projectName, [string]$location, [string]$templateFile) az group delete --resource-group $projectName --yes az group create --resource-group $projectName --location $location -az deployment group create --resource-group $projectName --template-file "templates\stf-test.json" --parameters projectName=$projectName adminUsername=aleksbol adminPublicKey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsGHFYhLieeRSlgreDQU9eyl8feMMa/7HQosSyGqKuiXjQ4ngzc9peKqYI8AV4gpWBysOlovaj9DfyHHGlm/f6bl+I881o3E0iU+xYpdPIQXUAkkRCMCdwXEIFY3hnMykbCGHTU2+XIglNEfT+kDhDEPYP4bMlBTKY03LIOYo3Ur71oUiIV56U7fmB9EygVDSk3n05rm23qd/ek5BLXbu6wY/f0RxSdwlf07xujkMiQyqR2Iug8sWGjiMkgH6RIxSQRI0u+uLwxeerH2JT37k4TfdCeXmRi3uPDa+xpZS5/A9DCmPFbAS6uSHrlMxZ9LiR/WKZdu7aOh/sY0hV/tDbdQkVXDJt2Erht1Qs2upKsLRLfDO+/9Wtmx2Uew1R/hqbaavZl3j0GmqN+vxQ6aEtrWbq2rbzxOmPM7aLOjnoU/j2IZZe7opjETrVsWVilvHuo0/dtqfI1QOQ6HpvD6f/Oa1i2A/QXSETdUb03trhB3Ylig5LOIxxrcdFxlXu3ZhgsAFGN7Tk5Q5ZBqn9JjPtneDr/6yXBDXWtf0ZeqtjF2L2k+AFZ39j3JMxGtZWw0I8c2yslNVIf1o+tW3ya9aeC3u8BoHcpThrVVX6WBHha+szcExH/dQvsvcSGnDmLOzIVUeGInLTXrLAwtYZBrPDTmbKrBBPypE7joLbt+J31w== redmond\aleksbol@LAPTOP-GA4VCRGE" \ No newline at end of file +az deployment group create --resource-group $projectName --template-file $templateFile --parameters projectName=$projectName \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index b72b42b..4739dd8 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,3 +1,3 @@ az group delete --resource-group $1 --yes az group create --resource-group $1 --location "$2" -az deployment group create --resource-group $1 --template-file "templates/$1.json" --parameters projectName=$1 adminUsername=aleksbol adminPublicKey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsGHFYhLieeRSlgreDQU9eyl8feMMa/7HQosSyGqKuiXjQ4ngzc9peKqYI8AV4gpWBysOlovaj9DfyHHGlm/f6bl+I881o3E0iU+xYpdPIQXUAkkRCMCdwXEIFY3hnMykbCGHTU2+XIglNEfT+kDhDEPYP4bMlBTKY03LIOYo3Ur71oUiIV56U7fmB9EygVDSk3n05rm23qd/ek5BLXbu6wY/f0RxSdwlf07xujkMiQyqR2Iug8sWGjiMkgH6RIxSQRI0u+uLwxeerH2JT37k4TfdCeXmRi3uPDa+xpZS5/A9DCmPFbAS6uSHrlMxZ9LiR/WKZdu7aOh/sY0hV/tDbdQkVXDJt2Erht1Qs2upKsLRLfDO+/9Wtmx2Uew1R/hqbaavZl3j0GmqN+vxQ6aEtrWbq2rbzxOmPM7aLOjnoU/j2IZZe7opjETrVsWVilvHuo0/dtqfI1QOQ6HpvD6f/Oa1i2A/QXSETdUb03trhB3Ylig5LOIxxrcdFxlXu3ZhgsAFGN7Tk5Q5ZBqn9JjPtneDr/6yXBDXWtf0ZeqtjF2L2k+AFZ39j3JMxGtZWw0I8c2yslNVIf1o+tW3ya9aeC3u8BoHcpThrVVX6WBHha+szcExH/dQvsvcSGnDmLOzIVUeGInLTXrLAwtYZBrPDTmbKrBBPypE7joLbt+J31w== redmond\aleksbol@LAPTOP-GA4VCRGE" \ No newline at end of file +az deployment group create --resource-group $1 --template-file $3 --parameters projectName=$1 \ No newline at end of file diff --git a/templates/stf-eastus.json b/templates/stf-eastus.json deleted file mode 100644 index afeab95..0000000 --- a/templates/stf-eastus.json +++ /dev/null @@ -1,1374 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secret1Name": "secret1", - "secret1Value": "secretValue", - "storageKeySecretName": "storageKey", - "secret1ResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "storageKeySecretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "filePrivateEndpointConnName": "[concat(parameters('projectName'), '-file-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "filePrivateZoneName": "privatelink.file.core.windows.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu", - "mountPath": "/mounts/remote" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('filePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('filePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('filePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('filePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "file" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('filePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('filePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-file-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false, - "networkAcls": { - "defaultAction": "Deny", - "bypass": "AzureServices" - } - }, - "sku": { - "name": "Standard_LRS" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'windows')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'linux')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secret1Name'))]", - "properties": { - "value": "[variables('secret1Value')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('storageKeySecretName'))]", - "properties": { - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "windows", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ], - "azureStorageAccounts": { - "remote": { - "mountPath": "[variables('mountPath')]", - "accountName": "[variables('storageAccountName')]", - "type": "AzureFiles", - "shareName": "linux", - "accessKey": "listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)" - } - } - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "linux", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/templates/stf-eastus2euap.json b/templates/stf-eastus2euap.json deleted file mode 100644 index afeab95..0000000 --- a/templates/stf-eastus2euap.json +++ /dev/null @@ -1,1374 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secret1Name": "secret1", - "secret1Value": "secretValue", - "storageKeySecretName": "storageKey", - "secret1ResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "storageKeySecretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "filePrivateEndpointConnName": "[concat(parameters('projectName'), '-file-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "filePrivateZoneName": "privatelink.file.core.windows.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu", - "mountPath": "/mounts/remote" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('filePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('filePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('filePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('filePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "file" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('filePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('filePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-file-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false, - "networkAcls": { - "defaultAction": "Deny", - "bypass": "AzureServices" - } - }, - "sku": { - "name": "Standard_LRS" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'windows')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'linux')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secret1Name'))]", - "properties": { - "value": "[variables('secret1Value')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('storageKeySecretName'))]", - "properties": { - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "windows", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ], - "azureStorageAccounts": { - "remote": { - "mountPath": "[variables('mountPath')]", - "accountName": "[variables('storageAccountName')]", - "type": "AzureFiles", - "shareName": "linux", - "accessKey": "listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)" - } - } - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "linux", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/templates/stf-northcentralus.json b/templates/stf-northcentralus.json deleted file mode 100644 index afeab95..0000000 --- a/templates/stf-northcentralus.json +++ /dev/null @@ -1,1374 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secret1Name": "secret1", - "secret1Value": "secretValue", - "storageKeySecretName": "storageKey", - "secret1ResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "storageKeySecretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "filePrivateEndpointConnName": "[concat(parameters('projectName'), '-file-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "filePrivateZoneName": "privatelink.file.core.windows.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu", - "mountPath": "/mounts/remote" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('filePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('filePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('filePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('filePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "file" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('filePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('filePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-file-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false, - "networkAcls": { - "defaultAction": "Deny", - "bypass": "AzureServices" - } - }, - "sku": { - "name": "Standard_LRS" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'windows')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'linux')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secret1Name'))]", - "properties": { - "value": "[variables('secret1Value')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('storageKeySecretName'))]", - "properties": { - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "windows", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ], - "azureStorageAccounts": { - "remote": { - "mountPath": "[variables('mountPath')]", - "accountName": "[variables('storageAccountName')]", - "type": "AzureFiles", - "shareName": "linux", - "accessKey": "listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)" - } - } - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "linux", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/templates/stf-northeurope.json b/templates/stf-northeurope.json deleted file mode 100644 index afeab95..0000000 --- a/templates/stf-northeurope.json +++ /dev/null @@ -1,1374 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secret1Name": "secret1", - "secret1Value": "secretValue", - "storageKeySecretName": "storageKey", - "secret1ResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "storageKeySecretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "filePrivateEndpointConnName": "[concat(parameters('projectName'), '-file-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "filePrivateZoneName": "privatelink.file.core.windows.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu", - "mountPath": "/mounts/remote" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('filePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('filePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('filePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('filePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "file" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('filePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('filePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-file-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false, - "networkAcls": { - "defaultAction": "Deny", - "bypass": "AzureServices" - } - }, - "sku": { - "name": "Standard_LRS" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'windows')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'linux')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secret1Name'))]", - "properties": { - "value": "[variables('secret1Value')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('storageKeySecretName'))]", - "properties": { - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "windows", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ], - "azureStorageAccounts": { - "remote": { - "mountPath": "[variables('mountPath')]", - "accountName": "[variables('storageAccountName')]", - "type": "AzureFiles", - "shareName": "linux", - "accessKey": "listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)" - } - } - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "linux", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/templates/stf-centraluseuap.json b/templates/stf-prod.json similarity index 97% rename from templates/stf-centraluseuap.json rename to templates/stf-prod.json index afeab95..730127e 100644 --- a/templates/stf-centraluseuap.json +++ b/templates/stf-prod.json @@ -15,18 +15,6 @@ "description": "Specifies the location for all resources." } }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, "vmSize": { "type": "string", "defaultValue": "Standard_D2s_v3", @@ -47,6 +35,8 @@ "windowsAppSubnetPrefix": "10.0.1.0/24", "linuxAppSubnetPrefix": "10.0.2.0/24", "vmName": "[concat(parameters('projectName'), '-vm')]", + "adminUsername": "stfadmin", + "adminPassword": "iis6!dfu", "peeredVmName": "peered-vm", "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", @@ -498,18 +488,8 @@ }, "osProfile": { "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } + "adminUsername": "[variables('adminUsername')]", + "adminPassword": "[variables('adminPassword')]" }, "storageProfile": { "imageReference": { @@ -570,18 +550,8 @@ }, "osProfile": { "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } + "adminUsername": "[variables('adminUsername')]", + "adminPassword": "[variables('adminPassword')]" }, "storageProfile": { "imageReference": { diff --git a/templates/stf-southcentralus.json b/templates/stf-southcentralus.json deleted file mode 100644 index afeab95..0000000 --- a/templates/stf-southcentralus.json +++ /dev/null @@ -1,1374 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secret1Name": "secret1", - "secret1Value": "secretValue", - "storageKeySecretName": "storageKey", - "secret1ResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "storageKeySecretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "filePrivateEndpointConnName": "[concat(parameters('projectName'), '-file-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "filePrivateZoneName": "privatelink.file.core.windows.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu", - "mountPath": "/mounts/remote" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('filePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('filePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('filePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('filePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "file" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('filePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('filePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-file-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false, - "networkAcls": { - "defaultAction": "Deny", - "bypass": "AzureServices" - } - }, - "sku": { - "name": "Standard_LRS" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'windows')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'linux')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secret1Name'))]", - "properties": { - "value": "[variables('secret1Value')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('storageKeySecretName'))]", - "properties": { - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "windows", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ], - "azureStorageAccounts": { - "remote": { - "mountPath": "[variables('mountPath')]", - "accountName": "[variables('storageAccountName')]", - "type": "AzureFiles", - "shareName": "linux", - "accessKey": "listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)" - } - } - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "linux", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/templates/stf-test.json b/templates/stf-test.json index 065b485..e6bf8a7 100644 --- a/templates/stf-test.json +++ b/templates/stf-test.json @@ -15,18 +15,6 @@ "description": "Specifies the location for all resources." } }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, "vmSize": { "type": "string", "defaultValue": "Standard_D2s_v3", @@ -47,6 +35,8 @@ "windowsAppSubnetPrefix": "10.0.1.0/24", "linuxAppSubnetPrefix": "10.0.2.0/24", "vmName": "[concat(parameters('projectName'), '-vm')]", + "adminUsername": "stfadmin", + "adminPassword": "iis6!dfu", "peeredVmName": "peered-vm", "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", @@ -498,18 +488,8 @@ }, "osProfile": { "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } + "adminUsername": "[variables('adminUsername')]", + "adminPassword": "[variables('adminPassword')]" }, "storageProfile": { "imageReference": { @@ -570,18 +550,8 @@ }, "osProfile": { "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } + "adminUsername": "[variables('adminUsername')]", + "adminPassword": "[variables('adminPassword')]" }, "storageProfile": { "imageReference": { diff --git a/templates/stf-westcentralus.json b/templates/stf-westcentralus.json deleted file mode 100644 index afeab95..0000000 --- a/templates/stf-westcentralus.json +++ /dev/null @@ -1,1374 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secret1Name": "secret1", - "secret1Value": "secretValue", - "storageKeySecretName": "storageKey", - "secret1ResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "storageKeySecretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "filePrivateEndpointConnName": "[concat(parameters('projectName'), '-file-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "filePrivateZoneName": "privatelink.file.core.windows.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu", - "mountPath": "/mounts/remote" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('filePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('filePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('filePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('filePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "file" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('filePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('filePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-file-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false, - "networkAcls": { - "defaultAction": "Deny", - "bypass": "AzureServices" - } - }, - "sku": { - "name": "Standard_LRS" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'windows')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'linux')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secret1Name'))]", - "properties": { - "value": "[variables('secret1Value')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('storageKeySecretName'))]", - "properties": { - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "windows", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ], - "azureStorageAccounts": { - "remote": { - "mountPath": "[variables('mountPath')]", - "accountName": "[variables('storageAccountName')]", - "type": "AzureFiles", - "shareName": "linux", - "accessKey": "listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)" - } - } - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "linux", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/templates/stf-westeurope.json b/templates/stf-westeurope.json deleted file mode 100644 index afeab95..0000000 --- a/templates/stf-westeurope.json +++ /dev/null @@ -1,1374 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secret1Name": "secret1", - "secret1Value": "secretValue", - "storageKeySecretName": "storageKey", - "secret1ResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "storageKeySecretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "filePrivateEndpointConnName": "[concat(parameters('projectName'), '-file-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "filePrivateZoneName": "privatelink.file.core.windows.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu", - "mountPath": "/mounts/remote" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('filePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('filePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('filePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('filePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "file" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('filePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('filePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-file-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('filePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false, - "networkAcls": { - "defaultAction": "Deny", - "bypass": "AzureServices" - } - }, - "sku": { - "name": "Standard_LRS" - } - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'windows')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", - "apiVersion": "2023-01-01", - "name": "[format('{0}/default/{1}', variables('storageAccountName'), 'linux')]", - "properties": { - "enabledProtocols": "SMB" - }, - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secret1Name'))]", - "properties": { - "value": "[variables('secret1Value')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('storageKeySecretName'))]", - "properties": { - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "windows", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ], - "azureStorageAccounts": { - "remote": { - "mountPath": "[variables('mountPath')]", - "accountName": "[variables('storageAccountName')]", - "type": "AzureFiles", - "shareName": "linux", - "accessKey": "listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)" - } - } - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secret1ResourceId')).secretUriWithVersion, ')')]", - "storageKeySecret": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('storageKeySecretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "WEBSITE_DNS_SERVER": "168.63.129.16", - "WEBSITE_CONTENTOVERVNET": "1", - "WEBSITE_CONTENTSHARE": "windows", - "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secret1Name'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - }, - { - "name": "azurestorageaccounts", - "type": "config", - "apiVersion": "2022-09-01", - "properties": { - "remote": { - "type": "AzureFiles", - "accountName": "[variables('storageAccountName')]", - "shareName": "linux", - "mountPath": "[variables('mountPath')]", - "accessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-11-01').keys[0].value]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('storageKeySecretName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/templates/stf-westus2.json b/templates/stf-westus2.json deleted file mode 100644 index 8b291b8..0000000 --- a/templates/stf-westus2.json +++ /dev/null @@ -1,1209 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "projectName": { - "type": "string", - "metadata": { - "description": "Specifies a name for generating resource names." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "adminUsername": { - "type": "string", - "metadata": { - "description": "Specifies a username for the Virtual Machine." - } - }, - "adminPublicKey": { - "type": "string", - "metadata": { - "description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs." - } - }, - "vmSize": { - "type": "string", - "defaultValue": "Standard_D2s_v3", - "metadata": { - "description": "description" - } - } - }, - "variables": { - "tenantId": "[subscription().tenantId]", - "vNetName": "[concat(parameters('projectName'), '-vnet')]", - "peeredVnetName": "[concat(parameters('projectName'), '-peered-vnet')]", - "vNetAddressPrefixes": "10.0.0.0/16", - "peeredVnetAddressPrefixes": "172.16.0.0/16", - "peeredVnetSubnetAddressPrefix": "172.16.0.0/24", - "vNetSubnetName": "default", - "vNetSubnetAddressPrefix": "10.0.0.0/24", - "windowsAppSubnetPrefix": "10.0.1.0/24", - "linuxAppSubnetPrefix": "10.0.2.0/24", - "vmName": "[concat(parameters('projectName'), '-vm')]", - "peeredVmName": "peered-vm", - "functionAppName": "[concat(parameters('projectName'), '-functionapp')]", - "privateAppName": "[concat(parameters('projectName'), '-privateapp')]", - "windowsAppName": "[concat(parameters('projectName'), '-winapp')]", - "windowsAppServicePlanName": "[concat(parameters('projectName'), '-winasp')]", - "windowsAppSubnetName": "WindowsAppSubnet", - "linuxAppName": "[concat(parameters('projectName'), '-linuxapp')]", - "linuxAppServicePlanName": "[concat(parameters('projectName'), '-linuxasp')]", - "linuxAppSubnetName": "linuxAppSubnet", - "miscAppServicePlanName": "[concat(parameters('projectName'), '-miscasp')]", - "funcAppServicePlanName": "[concat(parameters('projectName'), '-funcasp')]", - "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", - "peeredPublicIPAddressName": "peered-ip", - "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", - "peeredNetworkInterfaceName": "peered-nic", - "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", - "networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]", - "applicationInsightsName": "[variables('functionAppName')]", - "storageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'stor')]", - "funcStorageAccountName": "[concat(replace(parameters('projectName'), '-', ''), 'fstor')]", - "keyVaultName": "[concat(parameters('projectName'), '-vault')]", - "secretName": "secret1", - "secretValue": "secretValue", - "secretResourceId": "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secretName'))]", - "storagePrivateEndpointConnName": "[concat(parameters('projectName'), '-stor-pe')]", - "sitePrivateEndpointConnName": "[concat(parameters('projectName'), '-site-pe')]", - "blobPrivateZoneName": "privatelink.blob.core.windows.net", - "sitePrivateZoneName": "privatelink.azurewebsites.net", - "administratorLogin": "swiftadmin", - "administratorLoginPassword": "iis6!dfu" - }, - "resources": [ - { - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 200, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('publicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "type": "Microsoft.Network/publicIPAddresses", - "apiVersion": "2020-05-01", - "name": "[variables('peeredPublicIPAddressName')]", - "location": "[parameters('location')]", - "properties": { - "publicIPAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, - { - "comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2020-05-01", - "name": "[variables('networkSecurityGroupName2')]", - "location": "[parameters('location')]", - "properties": { - "securityRules": [ - { - "name": "http_rule", - "properties": { - "description": "Allow HTTP", - "protocol": "Tcp", - "sourcePortRange": "*", - "destinationPortRange": "80", - "sourceAddressPrefixes": [ - "167.220.148.0/23", - "131.107.147.0/24", - "131.107.159.0/24", - "131.107.160.0/24", - "131.107.174.0/24", - "167.220.24.0/24", - "167.220.26.0/24", - "167.220.238.0/27", - "167.220.238.128/27", - "167.220.238.192/27", - "167.220.238.64/27", - "167.220.232.0/23", - "167.220.255.0/25", - "167.220.242.0/27", - "167.220.242.128/27", - "167.220.242.192/27", - "167.220.242.64/27", - "94.245.87.0/24", - "167.220.196.0/23", - "194.69.104.0/25", - "191.234.97.0/26", - "167.220.0.0/23", - "167.220.2.0/24", - "167.220.226.0/23", - "131.107.132.16/28", - "131.107.132.32/28", - "157.58.212.64/26", - "157.58.212.128/26", - "157.58.213.64/26", - "157.58.213.192/26", - "157.58.214.128/26", - "157.58.214.192/26", - "167.220.70.64/26", - "167.220.76.192/26", - "167.220.77.64/26", - "167.220.80.192/26", - "167.220.81.128/26", - "167.220.81.192/26", - "131.107.1.128/25", - "131.107.8.0/25", - "167.220.204.128/26", - "167.220.204.192/26", - "167.220.205.0/26", - "167.220.205.64/26", - "157.58.216.64/26", - "194.69.119.64/26", - "167.220.249.128/26", - "207.68.190.32/27", - "13.106.78.32/27", - "10.254.32.0/20", - "10.97.136.0/22", - "13.106.174.32/27", - "13.106.4.96/27", - "10.137.168.0/23" - ], - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 1100, - "direction": "Inbound" - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('vNetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('vNetAddressPrefixes')]" - ] - }, - "dhcpOptions": { - "dnsServers": [ - "10.0.0.4", - "168.63.129.16" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('vNetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "privateEndpointNetworkPolicies": "Disabled" - } - }, - { - "name": "[variables('windowsAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('windowsAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - }, - { - "name": "[variables('linuxAppSubnetName')]", - "properties": { - "addressPrefix": "[variables('linuxAppSubnetPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - }, - "serviceEndpoints": [ - { - "service": "Microsoft.KeyVault", - "locations": [ - "*" - ] - } - ], - "delegations": [ - { - "name": "Microsoft.Web.serverFarms", - "properties": { - "serviceName": "Microsoft.Web/serverFarms", - "actions": [ - "Microsoft.Network/virtualNetworks/subnets/action" - ] - }, - "type": "Microsoft.Network/virtualNetworks/subnets/delegations" - } - ] - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-05-01", - "name": "[variables('peeredVnetName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - ], - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[variables('peeredVnetAddressPrefixes')]" - ] - }, - "subnets": [ - { - "name": "[variables('vNetSubnetName')]", - "properties": { - "addressPrefix": "[variables('peeredVnetSubnetAddressPrefix')]", - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('vNetName'), 'stf-peer')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings", - "apiVersion": "2020-05-01", - "name": "[format('{0}/{1}', variables('peeredVnetName'), 'peer-stf')]", - "properties": { - "allowVirtualNetworkAccess": true, - "allowForwardedTraffic": true, - "allowGatewayTransit": false, - "useRemoteGateways": false, - "remoteVirtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - }, - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]" - ] - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('networkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-05-01", - "name": "[variables('peeredNetworkInterfaceName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('peeredVnetName'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [ - { - "name": "ipconfig1", - "properties": { - "privateIPAllocationMethod": "Dynamic", - "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('peeredPublicIPAddressName'))]" - }, - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('peeredVnetName'), variables('vNetSubnetName'))]" - } - } - } - ] - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('vmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('vmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('vmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('vmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2019-12-01", - "name": "[variables('peeredVmName')]", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - ], - "properties": { - "hardwareProfile": { - "vmSize": "[parameters('vmSize')]" - }, - "osProfile": { - "computerName": "[variables('peeredVmName')]", - "adminUsername": "[parameters('adminUsername')]", - "linuxConfiguration": { - "disablePasswordAuthentication": true, - "ssh": { - "publicKeys": [ - { - "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]", - "keyData": "[parameters('adminPublicKey')]" - } - ] - } - } - }, - "storageProfile": { - "imageReference": { - "publisher": "Canonical", - "offer": "UbuntuServer", - "sku": "18_04-lts-gen2", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage" - } - }, - "networkProfile": { - "networkInterfaces": [ - { - "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('peeredNetworkInterfaceName'))]" - } - ] - } - } - }, - { - "name": "[concat(variables('peeredVmName'), '/config-app')]", - "type": "Microsoft.Compute/virtualMachines/extensions", - "location": "[resourceGroup().location]", - "apiVersion": "2019-03-01", - "dependsOn": [ - "[resourceId('Microsoft.Compute/virtualMachines', variables('peeredVmName'))]" - ], - "tags": { - "displayName": "config-app" - }, - "properties": { - "publisher": "Microsoft.Azure.Extensions", - "type": "CustomScript", - "typeHandlerVersion": "2.1", - "autoUpgradeMinorVersion": true, - "settings": {}, - "protectedSettings": { - "commandToExecute": "sh start.sh", - "fileUris": [ - "https://raw.githubusercontent.com/xingyang-li/SwiftTestFramework/main/dnsExtension/start.sh" - ] - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('blobPrivateZoneName')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 2, - "numberOfVirtualNetworkLinks": 1, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones", - "apiVersion": "2018-09-01", - "name": "[variables('sitePrivateZoneName')]", - "location": "global", - "properties": { - "maxNumberOfRecordSets": 25000, - "maxNumberOfVirtualNetworkLinks": 1000, - "maxNumberOfVirtualNetworkLinksWithRegistration": 100, - "numberOfRecordSets": 3, - "numberOfVirtualNetworkLinks": 0, - "numberOfVirtualNetworkLinksWithRegistration": 0, - "provisioningState": "Succeeded" - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('blobPrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks", - "apiVersion": "2018-09-01", - "name": "[concat(variables('sitePrivateZoneName'), '/n33a3tkelqvqk')]", - "location": "global", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "properties": { - "registrationEnabled": false, - "virtualNetwork": { - "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('storagePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[resourceGroup().location]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('storagePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]", - "groupIds": [ - "blob" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "manualPrivateLinkServiceConnections": [], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - }, - "customDnsConfigs": [] - } - }, - { - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "name": "[variables('sitePrivateEndpointConnName')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" - ], - "location": "[parameters('location')]", - "properties": { - "privateLinkServiceConnections": [ - { - "name": "[variables('sitePrivateEndpointConnName')]", - "properties": { - "privateLinkServiceId": "[resourceId('Microsoft.Web/sites', variables('privateAppName'))]", - "groupIds": [ - "sites" - ], - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "Auto-Approved", - "actionsRequired": "None" - } - } - } - ], - "subnet": { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]" - } - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('storagePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('storagePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-blob-core-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('blobPrivateZoneName'))]" - } - } - ] - } - }, - { - "type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups", - "apiVersion": "2020-11-01", - "name": "[concat(variables('sitePrivateEndpointConnName'), '/default')]", - "dependsOn": [ - "[resourceId('Microsoft.Network/privateEndpoints', variables('sitePrivateEndpointConnName'))]" - ], - "properties": { - "privateDnsZoneConfigs": [ - { - "name": "privatelink-azure-websites-windows-net", - "properties": { - "privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', variables('sitePrivateZoneName'))]" - } - } - ] - } - }, - { - "name": "[variables('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('storageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "StorageV2", - "properties": { - "publicNetworkAccess": "Disabled", - "allowBlobPublicAccess": false - }, - "sku": { - "name": "Premium_LRS", - "tier": "Premium" - } - }, - { - "name": "[variables('funcStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2021-04-01", - "tags": { - "displayName": "[variables('funcStorageAccountName')]" - }, - "location": "[parameters('location')]", - "kind": "Storage", - "sku": { - "name": "Standard_LRS" - } - }, - { - "name": "[variables('keyVaultName')]", - "type": "Microsoft.KeyVault/vaults", - "apiVersion": "2019-09-01", - "location": "[parameters('location')]", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.Web/sites', variables('linuxAppName'))]" - ], - "properties": { - "tenantId": "[variables('tenantId')]", - "sku": { - "family": "A", - "name": "standard" - }, - "networkAcls": { - "bypass": "AzureServices", - "defaultAction": "Deny", - "ipRules": [], - "virtualNetworkRules": [ - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - }, - { - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "ignoreMissingVnetServiceEndpoint": false - } - ] - }, - "accessPolicies": [ - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('windowsAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - }, - { - "tenantId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.tenantId]", - "objectId": "[reference(resourceId('Microsoft.Web/sites/', variables('linuxAppName')), '2020-12-01', 'Full').identity.principalId]", - "permissions": { - "secrets": [ "get" ] - } - } - ], - "enabledForDeployment": true, - "enabledForDiskEncryption": true, - "enabledForTemplateDeployment": true, - "enableSoftDelete": false, - "publicNetworkAccess": "Enabled" - } - }, - { - "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2021-11-01-preview", - "name": "[format('{0}/{1}', variables('keyVaultName'), variables('secretName'))]", - "properties": { - "value": "[variables('secretValue')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('windowsAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('linuxAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 2 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 2, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 2 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('miscAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app,linux", - "properties": { - "reserved": true, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1 - } - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2020-06-01", - "name": "[variables('funcAppServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", - "capacity": 1 - }, - "kind": "app", - "properties": { - "reserved": false, - "workerSize": "Default", - "workerSizeId": 0, - "workerTierName": null, - "numberOfWorkers": 1, - "currentWorkerSize": "Default", - "currentWorkerSizeId": 0, - "currentNumberOfWorkers": 1, - "kind": "app" - } - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-01-15", - "name": "[variables('windowsAppName')]", - "location": "[parameters('location')]", - "kind": "app", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('windowsAppServicePlanName'))]", - "reserved": false, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 1, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": true, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('windowsAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('windowsAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secretName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('linuxAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('linuxAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]" - ], - "identity": { - "type": "SystemAssigned" - }, - "properties": { - "enabled": true, - "serverFarmId": "[variables('linuxAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0, - "vnetPrivatePortsCount": 1, - "connectionStrings": [ - { - "name": "Storage", - "connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2015-05-01-preview').key1)]", - "type": "Custom" - } - ] - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "virtualNetworkSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('linuxAppSubnetName'))]", - "keyVaultReferenceIdentity": "SystemAssigned" - }, - "resources": [ - { - "name": "appsettings", - "type": "config", - "apiVersion": "2018-11-01", - "properties": { - "secret1": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('secretResourceId')).secretUriWithVersion, ')')]", - "WEBSITE_VNET_ROUTE_ALL": "1", - "ResourceGroup": "[parameters('projectName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('linuxAppName'))]", - "[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyvaultName'), variables('secretName'))]" - ] - } - ] - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-03-01", - "name": "[variables('privateAppName')]", - "location": "[parameters('location')]", - "kind": "app,linux", - "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]", - "[resourceId('Microsoft.Web/serverFarms', variables('miscAppServicePlanName'))]" - ], - "properties": { - "enabled": true, - "serverFarmId": "[variables('miscAppServicePlanName')]", - "reserved": true, - "isXenon": false, - "hyperV": false, - "siteConfig": { - "numberOfWorkers": 1, - "linuxFxVersion": "DOTNETCORE|6.0", - "acrUseManagedIdentityCreds": false, - "alwaysOn": true, - "http20Enabled": false, - "functionAppScaleLimit": 0, - "minimumElasticInstanceCount": 0 - }, - "scmSiteAlsoStopped": false, - "clientAffinityEnabled": false, - "clientCertEnabled": false, - "clientCertMode": "Required", - "hostNamesDisabled": false, - "containerSize": 0, - "dailyMemoryTimeQuota": 0, - "httpsOnly": true, - "redundancyMode": "None", - "storageAccountRequired": false, - "keyVaultReferenceIdentity": "SystemAssigned" - } - }, - { - "type": "microsoft.insights/components", - "apiVersion": "2020-02-02", - "name": "[variables('applicationInsightsName')]", - "location": "[parameters('location')]", - "tags": { - "[concat('hidden-link:', resourceId('Microsoft.Web/sites', variables('applicationInsightsName')))]": "Resource" - }, - "properties": { - "Application_Type": "web" - }, - "kind": "web" - }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2021-02-01", - "name": "[variables('functionAppName')]", - "location": "[parameters('location')]", - "kind": "functionapp", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "[resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName'))]", - "[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('funcAppServicePlanName'))]", - "siteConfig": { - "alwaysOn": true, - "appSettings": [ - { - "name": "APPINSIGHTS_INSTRUMENTATIONKEY", - "value": "[reference(resourceId('microsoft.insights/components', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]" - }, - { - "name": "AzureWebJobsStorage", - "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('funcStorageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('funcStorageAccountName')), '2019-06-01').keys[0].value)]" - }, - { - "name": "FUNCTIONS_EXTENSION_VERSION", - "value": "~1" - }, - { - "name": "FUNCTIONS_WORKER_RUNTIME", - "value": "dotnet" - }, - { - "name": "ResourceGroup", - "value": "[parameters('projectName')]" - } - ] - } - } - } - ] -} \ No newline at end of file