added dns forwarder and vmss parameter name
This commit is contained in:
Родитель
3e9baec589
Коммит
dd2cc3fcdd
|
@ -0,0 +1,226 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
"defaultValue": "[resourceGroup().location]",
|
||||
"metadata": {
|
||||
"description": "Specifies the location for all resources."
|
||||
}
|
||||
},
|
||||
"vmName": {
|
||||
"type": "string",
|
||||
"defaultValue": "dnsproxy",
|
||||
"metadata": {
|
||||
"description": "Specifies the name of the virtual machine."
|
||||
}
|
||||
},
|
||||
"vmSku": {
|
||||
"type": "string",
|
||||
"defaultValue": "Standard_A1",
|
||||
"metadata": {
|
||||
"description": "Specifies the sku of the virtual machine."
|
||||
}
|
||||
},
|
||||
"vmAdminUsername": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Specifies the user name for the virtual machine."
|
||||
}
|
||||
},
|
||||
"vmAdminKey": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "Specifies SSH key for the virtual machine."
|
||||
}
|
||||
},
|
||||
"storageAccountId": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Specifies the resource id of an existing storage account."
|
||||
}
|
||||
},
|
||||
"storageAccountKey": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Specifies the ID of the existing storage account where the powershell script is stored."
|
||||
}
|
||||
},
|
||||
"subnetId": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Specifies the resource Id of the subnet to which the virtual machine should connect."
|
||||
}
|
||||
},
|
||||
"vnetAddressPrefix": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Specifies the address prefix of the vnet to which the vm gets attached."
|
||||
}
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"location": "[parameters('location')]",
|
||||
"vmName": "[parameters('vmName')]",
|
||||
"vmSku": "[parameters('vmSku')]",
|
||||
"vmAdminUsername": "[parameters('vmAdminUsername')]",
|
||||
"vmAdminKey": "[parameters('vmAdminKey')]",
|
||||
"networkInterfaceCardName": "[concat(variables('vmName'), '-nic')]",
|
||||
"publicIpName": "[concat(variables('vmName'), '-publicip')]",
|
||||
"availabilitySetName": "[concat(variables('vmName'), '-availabilityset')]",
|
||||
"storageAccountId": "[parameters('storageAccountId')]",
|
||||
"storageAccountName": "[last(split(variables('storageAccountId'), '/'))]",
|
||||
"storageAccountKey": "[parameters('storageAccountKey')]",
|
||||
"subnetId": "[parameters('subnetId')]",
|
||||
"vnetAddressPrefix": "[parameters('vnetAddressPrefix')]",
|
||||
"forwardIP": "168.63.129.16",
|
||||
"setupScriptUri": "[concat('https://', variables('storageAccountName'), '.blob.core.windows.net/', 'shir', '/forwarderSetup.sh')]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"name": "[variables('availabilitySetName')]",
|
||||
"type": "Microsoft.Compute/availabilitySets",
|
||||
"apiVersion": "2019-07-01",
|
||||
"location": "[variables('location')]",
|
||||
"sku": {
|
||||
"name": "Aligned",
|
||||
"tier": "Standard",
|
||||
"capacity": 2
|
||||
},
|
||||
"properties": {
|
||||
"platformFaultDomainCount": 2,
|
||||
"platformUpdateDomainCount": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('publicIpName')]",
|
||||
"type": "Microsoft.Network/publicIPAddresses",
|
||||
"apiVersion": "2020-05-01",
|
||||
"location": "[variables('location')]",
|
||||
"properties": {
|
||||
"publicIPAllocationMethod": "Static",
|
||||
"publicIPAddressVersion": "IPv4",
|
||||
"dnsSettings": {
|
||||
"domainNameLabel": "[toLower(variables('vmName'))]"
|
||||
},
|
||||
// "ddosSettings": {
|
||||
// "protectionCoverage": "Standard",
|
||||
// "protectedIP": true
|
||||
// },
|
||||
"ipTags": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('networkInterfaceCardName')]",
|
||||
"type": "Microsoft.Network/networkInterfaces",
|
||||
"apiVersion": "2020-05-01",
|
||||
"location": "[variables('location')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIpName'))]",
|
||||
"[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceCardName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"name": "ipconfig1",
|
||||
"properties": {
|
||||
"privateIPAllocationMethod": "Dynamic",
|
||||
"publicIPAddress": {
|
||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIpName'))]"
|
||||
},
|
||||
"subnet": {
|
||||
"id": "[variables('subnetId')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('vmName')]",
|
||||
"type": "Microsoft.Compute/virtualMachines",
|
||||
"apiVersion": "2019-07-01",
|
||||
"location": "[variables('location')]",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/networkInterfaces/', variables('networkInterfaceCardName'))]",
|
||||
"[concat('Microsoft.Compute/availabilitySets/', variables('availabilitySetName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"additionalCapabilities": {},
|
||||
"priority": "Regular",
|
||||
"availabilitySet": {
|
||||
"id": "[resourceId('Microsoft.Compute/availabilitySets', variables('availabilitySetName'))]"
|
||||
},
|
||||
"hardwareProfile": {
|
||||
"vmSize": "[variables('vmSku')]"
|
||||
},
|
||||
"osProfile": {
|
||||
"computerName": "[variables('vmName')]",
|
||||
"adminUsername": "[variables('vmAdminUsername')]",
|
||||
"linuxConfiguration": {
|
||||
"disablePasswordAuthentication": true,
|
||||
"ssh": {
|
||||
"publicKeys": [
|
||||
{
|
||||
"path": "[concat('/home/', variables('vmAdminUsername'), '/.ssh/authorized_keys')]",
|
||||
"keyData": "[variables('vmAdminKey')]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"storageProfile": {
|
||||
"imageReference": {
|
||||
"publisher": "Canonical",
|
||||
"offer": "UbuntuServer",
|
||||
"sku": "14.04.2-LTS",
|
||||
"version": "latest"
|
||||
},
|
||||
"osDisk": {
|
||||
"caching": "ReadWrite",
|
||||
"createOption": "FromImage"
|
||||
}
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaces": [
|
||||
{
|
||||
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceCardName'))]"
|
||||
}
|
||||
]
|
||||
},
|
||||
"diagnosticsProfile": {
|
||||
"bootDiagnostics": {
|
||||
"enabled": true,
|
||||
"storageUri": "[concat('http://', variables('storageAccountName'),'.blob.core.windows.net')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[concat(variables('vmName'),'/setupscript')]",
|
||||
"type": "Microsoft.Compute/virtualMachines/extensions",
|
||||
"apiVersion": "2015-06-15",
|
||||
"location": "[variables('location')]",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"publisher": "Microsoft.Azure.Extensions",
|
||||
"type": "CustomScript",
|
||||
"typeHandlerVersion": "2.0",
|
||||
"autoUpgradeMinorVersion": true,
|
||||
"settings": {
|
||||
"fileUris": [
|
||||
"[variables('setupScriptUri')]"
|
||||
]
|
||||
},
|
||||
"protectedSettings": {
|
||||
"commandToExecute": "[concat('sh forwarderSetup.sh', ' ', variables('forwardIP'), ' ', variables('vnetAddressPrefix'))]",
|
||||
"storageAccountName": "[variables('storageAccountName')]",
|
||||
"storageAccountKey": "[variables('storageAccountKey')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"vmName": {
|
||||
"value": "dnsProxy"
|
||||
},
|
||||
"adminUsername": {
|
||||
"value": ""
|
||||
},
|
||||
"storageAccName": {
|
||||
"value": ""
|
||||
},
|
||||
"forwardIP": {
|
||||
"value": "168.63.129.16"
|
||||
},
|
||||
"location": {
|
||||
"value": ""
|
||||
},
|
||||
"authenticationType": {
|
||||
"value": "sshPublicKey"
|
||||
},
|
||||
"vmAdminPasswordOrKey": {
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {},
|
||||
"functions": [],
|
||||
"variables": {
|
||||
"applicationInsightsName": "[concat(variables('functionName'), '-application-insights')]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Insights/components",
|
||||
"apiVersion": "2018-05-01-preview",
|
||||
"name": "[variables('applicationInsightsName')]",
|
||||
"location": "[variables('location')]",
|
||||
"kind": "web",
|
||||
"properties": {
|
||||
"Application_Type": "web",
|
||||
"ApplicationId": "[variables('applicationInsightsName')]",
|
||||
"Flow_Type": "Bluefield",
|
||||
"Request_Source": "rest",
|
||||
"DisableIpMasking": false,
|
||||
"WorkspaceResourceId": "[variables('logAnalyticsWorkspaceResourceId')]",
|
||||
"publicNetworkAccessForIngestion": "Disabled",
|
||||
"publicNetworkAccessForQuery": "Disabled"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
"defaultValue": "[resourceGroup().location]",
|
||||
"metadata": {
|
||||
"description": "Specifies the location for all resources."
|
||||
}
|
||||
},
|
||||
"functionName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Specifies the name of the azure function."
|
||||
}
|
||||
},
|
||||
"logAnalyticsWorkspaceResourceId": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Specifies the resource ID of the log analytics workspace that should be used for the Azure Machine Learning workspace."
|
||||
}
|
||||
}
|
||||
},
|
||||
"functions": [],
|
||||
"variables": {
|
||||
"location": "[parameters('location')]",
|
||||
"functionName": "[parameters('functionName')]",
|
||||
"serverFarmName": "[concat(variables('functionName'), '-server-farm')]",
|
||||
"applicationInsightsName": "[concat(variables('functionName'), '-application-insights')]",
|
||||
"logAnalyticsWorkspaceResourceId": "[parameters('logAnalyticsWorkspaceResourceId')]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Web/serverfarms",
|
||||
"apiVersion": "2019-08-01",
|
||||
"name": "[variables('serverFarmName')]",
|
||||
"location": "[variables('location')]",
|
||||
"sku": {
|
||||
"name": "[variables('skuName')]",
|
||||
"tier": "[variables('skuTier')]"
|
||||
},
|
||||
"kind": "[variables('skuKind')]",
|
||||
"properties": {
|
||||
"maximumElasticWorkerCount": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Insights/components",
|
||||
"apiVersion": "2018-05-01-preview",
|
||||
"name": "[variables('applicationInsightsName')]",
|
||||
"location": "[variables('location')]",
|
||||
"kind": "web",
|
||||
"properties": {
|
||||
"Application_Type": "web",
|
||||
"ApplicationId": "[variables('applicationInsightsName')]",
|
||||
"Flow_Type": "Bluefield",
|
||||
"Request_Source": "rest",
|
||||
"DisableIpMasking": false,
|
||||
"WorkspaceResourceId": "[variables('logAnalyticsWorkspaceResourceId')]",
|
||||
"publicNetworkAccessForIngestion": "Disabled",
|
||||
"publicNetworkAccessForQuery": "Disabled"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/sites",
|
||||
"apiVersion": "2018-11-01",
|
||||
"name": "[variables('functionName')]",
|
||||
"location": "[variables('location')]",
|
||||
"kind": "functionapp",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/serverfarms', variables('serverFarmName'))]",
|
||||
"[resourceId('Microsoft.Storage/storageAccounts', 'storageAccountName')]"
|
||||
],
|
||||
"properties": {
|
||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('serverFarmName'))]",
|
||||
"siteConfig": {
|
||||
"appSettings": [
|
||||
{
|
||||
"name": "AzureWebJobsDashboard",
|
||||
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', 'storageAccountName', ';AccountKey=', listKeys('storageAccountID','2015-05-01-preview').key1)]"
|
||||
},
|
||||
{
|
||||
"name": "AzureWebJobsStorage",
|
||||
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', 'storageAccountName', ';AccountKey=', listKeys('storageAccountID','2015-05-01-preview').key1)]"
|
||||
},
|
||||
{
|
||||
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
|
||||
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', 'storageAccountName', ';AccountKey=', listKeys('storageAccountID','2015-05-01-preview').key1)]" // @Microsoft.KeyVault(SecretUri=https://secure-settings-demo.vault.azure.net/secrets/my-secret/)
|
||||
},
|
||||
{
|
||||
"name": "WEBSITE_CONTENTSHARE",
|
||||
"value": "[toLower('functionName')]"
|
||||
},
|
||||
{
|
||||
"name": "FUNCTIONS_EXTENSION_VERSION",
|
||||
"value": "~3"
|
||||
},
|
||||
{
|
||||
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
|
||||
"value": "[reference(resourceId('microsoft.insights/components/', 'applicationInsightsName'), '2015-05-01').InstrumentationKey]"
|
||||
},
|
||||
{
|
||||
"name": "FUNCTIONS_WORKER_RUNTIME",
|
||||
"value": "dotnet"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {}
|
||||
}
|
|
@ -82,8 +82,7 @@
|
|||
"storageAccountId": "[parameters('storageAccountId')]",
|
||||
"storageAccountName": "[last(split(variables('storageAccountId'), '/'))]",
|
||||
"storageAccountKey": "[parameters('storageAccountKey')]",
|
||||
"gatewayInstallScriptUri": "[concat('https://', variables('storageAccountName'), '.blob.core.windows.net/', 'shir', '/gatewayInstall.ps1')]"
|
||||
// "gatewayInstallScriptUri": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vms-with-selfhost-integration-runtime/gatewayInstall.ps1"
|
||||
"setupScriptUri": "[concat('https://', variables('storageAccountName'), '.blob.core.windows.net/', 'shir', '/gatewayInstall.ps1')]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
|
@ -330,7 +329,7 @@
|
|||
"autoUpgradeMinorVersion": true,
|
||||
"settings": {
|
||||
"fileUris": [
|
||||
"[variables('gatewayInstallScriptUri')]"
|
||||
"[variables('setupScriptUri')]"
|
||||
]
|
||||
},
|
||||
"protectedSettings": {
|
||||
|
|
|
@ -31,16 +31,29 @@
|
|||
{
|
||||
"name": "AllowRDP",
|
||||
"properties": {
|
||||
"priority": 1000,
|
||||
"sourceAddressPrefix": "*",
|
||||
"protocol": "Tcp",
|
||||
"destinationPortRange": "3389",
|
||||
"access": "Allow",
|
||||
"direction": "Inbound",
|
||||
"priority": 1000,
|
||||
"protocol": "Tcp",
|
||||
"sourceAddressPrefix": "*",
|
||||
"sourcePortRange": "*",
|
||||
"destinationAddressPrefix": "*"
|
||||
"destinationAddressPrefix": "*",
|
||||
"destinationPortRange": "3389"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "AllowSSH",
|
||||
"properties": {
|
||||
"access": "Allow",
|
||||
"direction": "Inbound",
|
||||
"priority": 1010,
|
||||
"protocol": "Tcp",
|
||||
"sourceAddressPrefix": "*",
|
||||
"sourcePortRange": "*",
|
||||
"destinationAddressPrefix": "*",
|
||||
"destinationPortRange": "22"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -77,28 +90,6 @@
|
|||
"privateEndpointNetworkPolicies": "Disabled",
|
||||
"privateLinkServiceNetworkPolicies": "Disabled"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dh-databricks-function-subnet",
|
||||
"properties": {
|
||||
"addressPrefix": "10.0.2.0/24",
|
||||
"privateEndpointNetworkPolicies": "Enabled",
|
||||
"privateLinkServiceNetworkPolicies": "Enabled",
|
||||
"networkSecurityGroup": {
|
||||
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', 'dh-nsg')]"
|
||||
},
|
||||
"delegations": [
|
||||
{
|
||||
"name": "delegation",
|
||||
"properties": {
|
||||
"serviceName": "Microsoft.Web/serverFarms",
|
||||
"actions": [
|
||||
"Microsoft.Network/virtualNetworks/subnets/action"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче