<commit_before>{
	"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
	"contentVersion": "1.0.0.0",
	"parameters": {
		"eventHubNamespaceName": {
			"type": "string",
			"metadata": {
				"description": "Name of the EventHub namespace"
			},
			"defaultValue": "[toLower(uniqueString(resourceGroup().id, 'eventhubs'))]"
		},
		"dataFactoryLocation": {
			"type": "string",
			"allowedValues": [
				"East US 2",
				"East US"
			],
			"metadata": {
				"description": "Location of the data factory. Currently, only East US and East US 2 are supported. "
			}
		},
		"adlAnalyticsName": {
			"type": "string",
			"defaultValue": "datalakedemoadla",
			"metadata": {
				"description": "The name of the Data Lake Analytics account to create."
			}
		},
		"adlStoreName": {
			"type": "string",
			"defaultValue": "datalakedemoadls",
			"metadata": {
				"description": "The name of the Data Lake Store account to create."
			}
		},
		"captureTime": {
			"type": "int",
			"defaultValue": 300,
			"minValue": 60,
			"maxValue": 900,
			"metadata": {
				"description": "the time window in seconds for the archival"
			}
		},
		"captureSize": {
			"type": "int",
			"defaultValue": 10485760,
			"minValue": 10485760,
			"maxValue": 524288000,
			"metadata": {
				"description": "the size window in bytes for evetn hub capture"
			}
		},
		"vmSize": {
			"type": "string",
			"allowedValues": [
				"Standard_A1",
				"Standard_A2",
				"Standard_A3",
				"Standard_A4",
				"Standard_D1_v2",
				"Standard_D2_v2",
				"Standard_D3_v2",
				"Standard_D4_v2"
			],
			"defaultValue": "Standard_D1_v2",
			"metadata": {
				"description": "Size of vm"
			}
		},
		"vm_username": {
			"type": "string",
			"defaultValue": "azuredemo",
			"metadata": {
				"description": "Username for the Virtual Machine."
			}
		},
		"vm_password": {
			"type": "securestring",
			"metadata": {
				"description": "Password for the Virtual Machine."
			}
		},
		"location": {
			"type": "string",
			"defaultValue":"[resourceGroup().location]",
			"metadata": {
				"description": "The location in which the resources will be created."
			}
		},
		"OptionalWizardInstall": {
			"type": "string",
			"allowedValues": [
				"Yes",
				"No"
			],
			"defaultValue": "Yes",
			"metadata": {
				"description": "Select whether the VM should be in production or not."
			}
		},
		"dataFactoryName": {
			"type": "string",
			"metadata": {
				"description": "Name of the data factory. Must be globally unique."
			},
			"defaultValue": "[toLower(uniqueString(resourceGroup().id, 'datafactory'))]"
		},
		"servicePrincipalId": {
			"type": "string",
			"metadata": {
				"description": "The ID of the service principal that has permissions to create HDInsight clusters in your subscription."
			}
		},
		"servicePrincipalKey": {
			"type": "string",
			"metadata": {
				"description": "The access key of the service principal that has permissions to create HDInsight clusters in your subscription."
			}
		},
		"eventhubSku": {
			"type": "string",
			"defaultValue": "Standard",
			"allowedValues": [
				"Basic",
				"Standard"
			],
			"metadata": {
				"description": "The messaging tier for service Bus namespace"
			}
		},
		"skuCapacity": {
			"type": "int",
			"defaultValue": 1,
			"allowedValues": [
				1,
				2,
				4
			],
			"metadata": {
				"description": "MessagingUnits for premium namespace"
			}
		},
		"isAutoInflateEnabled": {
			"type": "string",
			"defaultValue": "True",
			"allowedValues": [
				"True",
				"False"
			],
			"metadata": {
				"description": "Enable or disable AutoInflate"
			}
		},
		"messageRetentionInDays": {
			"type": "int",
			"minValue": 1,
			"defaultValue": 1,
			"maxValue": 7,
			"metadata": {
				"description": "How long to retain the data in Event Hub"
			}
		},
		"partitionCount": {
			"type": "int",
			"minValue": 2,
			"maxValue": 32,
			"defaultValue": 2,
			"metadata": {
				"description": "Number of partitions chosen"
			}
		},
		"captureEncodingFormat": {
			"type": "string",
			"defaultValue": "Avro",
			"allowedValues": [
				"Avro"
			],
			"metadata": {
				"description": "The encoding format Eventhub capture serializes the EventData when archiving to your storage"
			}
		},
		"_artifactsLocationSasToken": {
  			"type": "secureString",
  			"metadata": {
    			"description": "SAS Token required for connecting to Artifacts required by this template"	
  			},
			"defaultValue": ""
		},
	"tenantId": {
      "type": "string",
      "defaultValue": "[subscription().tenantId]",
      "metadata": {
        "description": "Specifies the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. Get it by using Get-AzSubscription cmdlet."
      }
    },
    "objectId": {
      "type": "string",
      "metadata": {
        "description": "Specifies the object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. Get it by using Get-AzADUser or Get-AzADServicePrincipal cmdlets."
      }
    },
    "keysPermissions": {
      "type": "array",
      "defaultValue": [
        "list"
      ],
      "metadata": {
        "description": "Specifies the permissions to keys in the vault. Valid values are: all, encrypt, decrypt, wrapKey, unwrapKey, sign, verify, get, list, create, update, import, delete, backup, restore, recover, and purge."
      }
    },
    "secretsPermissions": {
      "type": "array",
      "defaultValue": [
        "list"
      ],
      "metadata": {
        "description": "Specifies the permissions to secrets in the vault. Valid values are: all, get, list, set, delete, backup, restore, recover, and purge."
      }
    },
    "keyVaultName": {
      "type": "string",
      "metadata": {
        "description": "Specifies the name of the key vault."
      }
    }
	},
	"variables": {
		"storageAccountName": "[toLower(uniqueString(resourceGroup().id, 'storage'))]",
		"blobContainer": "raw",
		"storageAccountType": "Standard_LRS",
		"maximumThroughputUnits": 8,
		"DataCleaningInputStream": "datalakerawstream",
		"DataCleaningOutputStream": "datalakecleanstream",
		"captureNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}",
		"DataCleaningStreamAnalyticsJob": "cleanOrdersStreamAnalyticsJob",
		"DataAggregatorStreamAnalyticsJob1": "sellingProductPerMinJob",
		"DataAggregatorStreamAnalyticsJob2": "geoLocationsJob",
		"DataAggregatorStreamAnalyticsJob3": "ageGroupWiseRevenueJob",
		"appName": "azuredatalakeuiapp",
		"dnsLabelPrefix": "[concat('datalake',uniquestring(resourceGroup().id,deployment().name))]",
		"ES_Function_name": "elkstackfuntion",
		"serverfarms_EastUS2Plan_name": "EastUS2Plan",
		"config_web_name_4": "web",
		"_artifactsLocation": "https://raw.githubusercontent.com/ajos1993/yash-datalake/master/",
		"artloc": "https://azbotstorage.blob.core.windows.net/sample-artifacts/yash-datalake"	
	},
	"resources": [
    {
      "type": "Microsoft.KeyVault/vaults",
      "name": "[parameters('keyVaultName')]",
      "apiVersion": "2018-02-14",
      "location": "[parameters('location')]",
      "properties": {
        "enabledForDeployment": false,
        "enabledForDiskEncryption": false,
        "enabledForTemplateDeployment": true,
        "tenantId": "[parameters('tenantId')]",
        "accessPolicies": [
          {
            "objectId": "[parameters('objectId')]",
            "tenantId": "[parameters('tenantId')]",
            "permissions": {
              "keys": "[parameters('keysPermissions')]",
              "secrets": "[parameters('secretsPermissions')]"      
            }
          }
        ],
        "sku": {
          "name": "[parameters('skuName')]",
          "family": "A"
        },
        "networkAcls": {
          "value": {
            "defaultAction": "Allow",
            "bypass": "AzureServices"
          }
        }
      }
    },
	
	{
			"type": "Microsoft.Resources/deployments",
			"name": "storageAccount",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/storageAccount.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"storageAccountType": {
						"value": "[variables('storageAccountType')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"keyVaultName":{
						"value": "[parameters('keyVaultName')]"
					}
				}
			}
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "dataFactory",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/dataFactory.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"KibanaESDeployedVMIP": {
						"value": "[reference('KibanaESDeployedVM').outputs.publicIpAddress.value]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"_artifactsLocation": {
						"value": "[variables('artloc')]"
					},
					"dataFactoryName": {
						"value": "[parameters('dataFactoryName')]"
					},
					"dataFactoryLocation": {
						"value": "[parameters('dataFactoryLocation')]"
					},
					"blobContainer": {
						"value": "[variables('blobContainer')]"
					},
					"clientAzureStorageConnectionString": {
						"value": "[reference('storageAccount').outputs.clientAzureStorageConnectionString.value]"
					},
					"servicePrincipalId": {
						"value": "[parameters('servicePrincipalId')]"
					},
					"servicePrincipalKey": {
						"value": "[parameters('servicePrincipalKey')]"
					}
				}
			},
			"dependsOn": [
				"KibanaESDeployedVM"
			]
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "dataLakeAnalytics",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/datalakeAnalytics.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"adlAnalyticsName": {
						"value": "[parameters('adlAnalyticsName')]"
					},
					"adlStoreName": {
						"value": "[parameters('adlStoreName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"accessKey": {
						"value": "[reference('storageAccount').outputs.accessKey.value]"
					}
				}
			},
			"dependsOn": [
				"storageAccount"
			]
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "EventHubTemplate",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/eventHub.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"eventHubNamespaceName": {
						"value": "[parameters('eventHubNamespaceName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"eventhubSku": {
						"value": "[parameters('eventhubSku')]"
					},
					"skuCapacity": {
						"value": "[parameters('skuCapacity')]"
					},
					"isAutoInflateEnabled": {
						"value": "[parameters('isAutoInflateEnabled')]"
					},
					"maximumThroughputUnits": {
						"value": "[variables('maximumThroughputUnits')]"
					},
					"DataCleaningInputStream": {
						"value": "[variables('DataCleaningInputStream')]"
					},
					"DataCleaningOutputStream": {
						"value": "[variables('DataCleaningOutputStream')]"
					},
					"messageRetentionInDays": {
						"value": "[parameters('messageRetentionInDays')]"
					},
					"partitionCount": {
						"value": "[parameters('partitionCount')]"
					},
					"captureEncodingFormat": {
						"value": "[parameters('captureEncodingFormat')]"
					},
					"captureTime": {
						"value": "[parameters('captureTime')]"
					},
					"captureSize": {
						"value": "[parameters('captureSize')]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"captureNameFormat": {
						"value": "[variables('captureNameFormat')]"
					},
					"keyVaultName":{
						"value": "[parameters('keyVaultName')]"
					}
				}
			},
			"dependsOn": [
				"dataLakeAnalytics"
			]
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "streamAnalyticsJobsTemplate",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"EventHubTemplate"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/streamAnalytics.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"eventHubNamespaceName": {
						"value": "[parameters('eventHubNamespaceName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"DataCleaningInputStream": {
						"value": "[variables('DataCleaningInputStream')]"
					},
					"DataCleaningOutputStream": {
						"value": "[variables('DataCleaningOutputStream')]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"sharedAccessPolicyKey": {
						"value": "[reference('EventHubTemplate').outputs.SharedAccessPolicyPrimaryKey.value]"
					},
					"DataCleaningStreamAnalyticsJob": {
						"value": "[variables('DataCleaningStreamAnalyticsJob')]"
					},
					"DataAggregatorStreamAnalyticsJob1": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob1')]"
					},
					"DataAggregatorStreamAnalyticsJob2": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob2')]"
					},
					"DataAggregatorStreamAnalyticsJob3": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob3')]"
					}
				}
			}
		},
		{
			"condition": "[equals(parameters('OptionalWizardInstall'), 'Yes')]",
			"type": "Microsoft.Resources/deployments",
			"name": "azureFunction",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"KibanaESDeployedVM"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/azureFunction.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"KibanaESDeployedVMIP": {
						"value": "[reference('KibanaESDeployedVM').outputs.publicIpAddress.value]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"_artifactsLocation": {
						"value": "[variables('_artifactsLocation')]"
					},
					"_artifactsLocationSasToken":{
						"value": "[parameters('_artifactsLocationSasToken')]"
					},
					"storageAccountConnectionString": {
						"value": "[reference('storageAccount').outputs.clientAzureStorageConnectionString.value]"
					},
					"appName": {
						"value": "[variables('appName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"web_app_id": {
						"value": "[parameters('servicePrincipalId')]"
					},
					"web_app_secret": {
						"value": "[parameters('servicePrincipalKey')]"
					},
					"datafactory_name": {
						"value": "[parameters('dataFactoryName')]"
					},
					"eventhub_name": {
						"value": "[variables('DataCleaningInputStream')]"
					},
					"eventhub_namespace": {
						"value": "[parameters('eventHubNamespaceName')]"
					},
					"sas_key": {
						"value": "[reference('EventHubTemplate').outputs.SharedAccessPolicyPrimaryKey.value]"
					},
					"adla_account_name": {
						"value": "[parameters('adlAnalyticsName')]"
					},
					"DataCleaningStreamAnalyticsJob": {
						"value": "[variables('DataCleaningStreamAnalyticsJob')]"
					},
					"DataAggregatorStreamAnalyticsJob1": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob1')]"
					},
					"DataAggregatorStreamAnalyticsJob2": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob2')]"
					},
					"DataAggregatorStreamAnalyticsJob3": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob3')]"
					}
				}
			}
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "KibanaESDeployedVM",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"storageAccount"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/elasticSearchKibana.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"vmSize": {
						"value": "[parameters('vmSize')]"
					},
					"username": {
						"value": "[parameters('vm_username')]"
					},
					"password": {
						"value": "[parameters('vm_password')]"
					},
					"dnsLabelPrefix": {
						"value": "[variables('dnsLabelPrefix')]"
					},
					"location": {
						"value": "[parameters('location')]"
					}
				}
			}
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "KibanaFunctionApp",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"KibanaESDeployedVM"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/blobTriggerdFunction.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"storage_name": {
						"value": "[variables('storageAccountName')]"
					},
					"storageConnectionString": {
						"value": "[reference('storageAccount').outputs.clientAzureStorageConnectionString.value]"
					},
					"kibanaFunctionHost": {
						"value": "[Concat(variables('ES_Function_name'),'.azurewebsites.net')]"
					},
					"kibanaFunctionPath": {
						"value": "/api/AddKibanaDashboard"
					},
					"EsIP": {
						"value": "[reference('KibanaESDeployedVM').outputs.publicIpAddress.value]"
					},
					"_artifactsLocation": {
						"value": "[variables('_artifactsLocation')]"
					},
					"serverfarms_EastUS2Plan_name": {
						"value": "[variables('serverfarms_EastUS2Plan_name')]"
					},
					"sites_demotriggerapp1234_name": {
						"value": "[variables('ES_Function_name')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"config_web_name_4": {
						"value": "[variables('config_web_name_4')]"
					}
				}
			}
		}
	],
	"outputs": {
		"websiteUrl": {
			"type": "string",
			"value": "[Concat(reference('azureFunction').outputs.websiteUrl.value,'/api/quickstart_wizard')]"
		}
	}
}
<commit_msg>Update azureDeploy.json<commit_after>{
	"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
	"contentVersion": "1.0.0.0",
	"parameters": {
		"eventHubNamespaceName": {
			"type": "string",
			"metadata": {
				"description": "Name of the EventHub namespace"
			},
			"defaultValue": "[toLower(uniqueString(resourceGroup().id, 'eventhubs'))]"
		},
		"dataFactoryLocation": {
			"type": "string",
			"defaultValue": "East US 2",
			"allowedValues": [
				"East US 2",
				"East US"
			],
			"metadata": {
				"description": "Location of the data factory. Currently, only East US and East US 2 are supported. "
			}
		},
		"adlAnalyticsName": {
			"type": "string",
			"defaultValue": "datalakedemoadla",
			"metadata": {
				"description": "The name of the Data Lake Analytics account to create."
			}
		},
		"adlStoreName": {
			"type": "string",
			"defaultValue": "datalakedemoadls",
			"metadata": {
				"description": "The name of the Data Lake Store account to create."
			}
		},
		"captureTime": {
			"type": "int",
			"defaultValue": 300,
			"minValue": 60,
			"maxValue": 900,
			"metadata": {
				"description": "the time window in seconds for the archival"
			}
		},
		"captureSize": {
			"type": "int",
			"defaultValue": 10485760,
			"minValue": 10485760,
			"maxValue": 524288000,
			"metadata": {
				"description": "the size window in bytes for evetn hub capture"
			}
		},
		"vmSize": {
			"type": "string",
			"allowedValues": [
				"Standard_A1",
				"Standard_A2",
				"Standard_A3",
				"Standard_A4",
				"Standard_D1_v2",
				"Standard_D2_v2",
				"Standard_D3_v2",
				"Standard_D4_v2"
			],
			"defaultValue": "Standard_D1_v2",
			"metadata": {
				"description": "Size of vm"
			}
		},
		"vm_username": {
			"type": "string",
			"defaultValue": "azuredemo",
			"metadata": {
				"description": "Username for the Virtual Machine."
			}
		},
		"vm_password": {
			"type": "securestring",
			"metadata": {
				"description": "Password for the Virtual Machine."
			},
			"defaultValue": "<PASSWORD>",
		},
		"location": {
			"type": "string",
			"defaultValue":"[resourceGroup().location]",
			"metadata": {
				"description": "The location in which the resources will be created."
			}
		},
		"OptionalWizardInstall": {
			"type": "string",
			"allowedValues": [
				"Yes",
				"No"
			],
			"defaultValue": "Yes",
			"metadata": {
				"description": "Select whether the VM should be in production or not."
			}
		},
		"dataFactoryName": {
			"type": "string",
			"metadata": {
				"description": "Name of the data factory. Must be globally unique."
			},
			"defaultValue": "[toLower(uniqueString(resourceGroup().id, 'datafactory'))]"
		},
		"servicePrincipalId": {
			"type": "string",
			"defaultValue": "null",
			"metadata": {
				"description": "The ID of the service principal that has permissions to create HDInsight clusters in your subscription."
			}
		},
		"servicePrincipalKey": {
			"type": "string",
			"defaultValue": "null",
			"metadata": {
				"description": "The access key of the service principal that has permissions to create HDInsight clusters in your subscription."
			}
		},
		"eventhubSku": {
			"type": "string",
			"defaultValue": "Standard",
			"allowedValues": [
				"Basic",
				"Standard"
			],
			"metadata": {
				"description": "The messaging tier for service Bus namespace"
			}
		},
		"skuCapacity": {
			"type": "int",
			"defaultValue": 1,
			"allowedValues": [
				1,
				2,
				4
			],
			"metadata": {
				"description": "MessagingUnits for premium namespace"
			}
		},
		"isAutoInflateEnabled": {
			"type": "string",
			"defaultValue": "True",
			"allowedValues": [
				"True",
				"False"
			],
			"metadata": {
				"description": "Enable or disable AutoInflate"
			}
		},
		"messageRetentionInDays": {
			"type": "int",
			"minValue": 1,
			"defaultValue": 1,
			"maxValue": 7,
			"metadata": {
				"description": "How long to retain the data in Event Hub"
			}
		},
		"partitionCount": {
			"type": "int",
			"minValue": 2,
			"maxValue": 32,
			"defaultValue": 2,
			"metadata": {
				"description": "Number of partitions chosen"
			}
		},
		"captureEncodingFormat": {
			"type": "string",
			"defaultValue": "Avro",
			"allowedValues": [
				"Avro"
			],
			"metadata": {
				"description": "The encoding format Eventhub capture serializes the EventData when archiving to your storage"
			}
		},
		"_artifactsLocationSasToken": {
  			"type": "secureString",
  			"metadata": {
    			"description": "SAS Token required for connecting to Artifacts required by this template"	
  			},
			"defaultValue": ""
		},
	"tenantId": {
      "type": "string",
      "defaultValue": "[subscription().tenantId]",
      "metadata": {
        "description": "Specifies the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. Get it by using Get-AzSubscription cmdlet."
      }
    },
    "objectId": {
      "type": "string",
      "metadata": {
        "description": "Specifies the object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. Get it by using Get-AzADUser or Get-AzADServicePrincipal cmdlets."
      }
    },
    "keysPermissions": {
      "type": "array",
      "defaultValue": [
        "list"
      ],
      "metadata": {
        "description": "Specifies the permissions to keys in the vault. Valid values are: all, encrypt, decrypt, wrapKey, unwrapKey, sign, verify, get, list, create, update, import, delete, backup, restore, recover, and purge."
      }
    },
    "secretsPermissions": {
      "type": "array",
      "defaultValue": [
        "list"
      ],
      "metadata": {
        "description": "Specifies the permissions to secrets in the vault. Valid values are: all, get, list, set, delete, backup, restore, recover, and purge."
      }
    },
    "keyVaultName": {
      "type": "string",
      "metadata": {
        "description": "Specifies the name of the key vault."
      }
    }
	},
	"variables": {
		"storageAccountName": "[toLower(uniqueString(resourceGroup().id, 'storage'))]",
		"blobContainer": "raw",
		"storageAccountType": "Standard_LRS",
		"maximumThroughputUnits": 8,
		"DataCleaningInputStream": "datalakerawstream",
		"DataCleaningOutputStream": "datalakecleanstream",
		"captureNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}",
		"DataCleaningStreamAnalyticsJob": "cleanOrdersStreamAnalyticsJob",
		"DataAggregatorStreamAnalyticsJob1": "sellingProductPerMinJob",
		"DataAggregatorStreamAnalyticsJob2": "geoLocationsJob",
		"DataAggregatorStreamAnalyticsJob3": "ageGroupWiseRevenueJob",
		"appName": "azuredatalakeuiapp",
		"dnsLabelPrefix": "[concat('datalake',uniquestring(resourceGroup().id,deployment().name))]",
		"ES_Function_name": "elkstackfuntion",
		"serverfarms_EastUS2Plan_name": "EastUS2Plan",
		"config_web_name_4": "web",
		"_artifactsLocation": "https://raw.githubusercontent.com/ajos1993/yash-datalake/master/",
		"artloc": "https://azbotstorage.blob.core.windows.net/sample-artifacts/yash-datalake"	
	},
	"resources": [
    {
      "type": "Microsoft.KeyVault/vaults",
      "name": "[parameters('keyVaultName')]",
      "apiVersion": "2018-02-14",
      "location": "[parameters('location')]",
      "properties": {
        "enabledForDeployment": false,
        "enabledForDiskEncryption": false,
        "enabledForTemplateDeployment": true,
        "tenantId": "[parameters('tenantId')]",
        "accessPolicies": [
          {
            "objectId": "[parameters('objectId')]",
            "tenantId": "[parameters('tenantId')]",
            "permissions": {
              "keys": "[parameters('keysPermissions')]",
              "secrets": "[parameters('secretsPermissions')]"      
            }
          }
        ],
        "sku": {
          "name": "[parameters('skuName')]",
          "family": "A"
        },
        "networkAcls": {
          "value": {
            "defaultAction": "Allow",
            "bypass": "AzureServices"
          }
        }
      }
    },
	
	{
			"type": "Microsoft.Resources/deployments",
			"name": "storageAccount",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/storageAccount.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"storageAccountType": {
						"value": "[variables('storageAccountType')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"keyVaultName":{
						"value": "[parameters('keyVaultName')]"
					}
				}
			}
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "dataFactory",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/dataFactory.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"KibanaESDeployedVMIP": {
						"value": "[reference('KibanaESDeployedVM').outputs.publicIpAddress.value]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"_artifactsLocation": {
						"value": "[variables('artloc')]"
					},
					"dataFactoryName": {
						"value": "[parameters('dataFactoryName')]"
					},
					"dataFactoryLocation": {
						"value": "[parameters('dataFactoryLocation')]"
					},
					"blobContainer": {
						"value": "[variables('blobContainer')]"
					},
					"clientAzureStorageConnectionString": {
						"value": "[reference('storageAccount').outputs.clientAzureStorageConnectionString.value]"
					},
					"servicePrincipalId": {
						"value": "[parameters('servicePrincipalId')]"
					},
					"servicePrincipalKey": {
						"value": "[parameters('servicePrincipalKey')]"
					}
				}
			},
			"dependsOn": [
				"KibanaESDeployedVM"
			]
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "dataLakeAnalytics",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/datalakeAnalytics.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"adlAnalyticsName": {
						"value": "[parameters('adlAnalyticsName')]"
					},
					"adlStoreName": {
						"value": "[parameters('adlStoreName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"accessKey": {
						"value": "[reference('storageAccount').outputs.accessKey.value]"
					}
				}
			},
			"dependsOn": [
				"storageAccount"
			]
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "EventHubTemplate",
			"apiVersion": "2018-02-01",
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/eventHub.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"eventHubNamespaceName": {
						"value": "[parameters('eventHubNamespaceName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"eventhubSku": {
						"value": "[parameters('eventhubSku')]"
					},
					"skuCapacity": {
						"value": "[parameters('skuCapacity')]"
					},
					"isAutoInflateEnabled": {
						"value": "[parameters('isAutoInflateEnabled')]"
					},
					"maximumThroughputUnits": {
						"value": "[variables('maximumThroughputUnits')]"
					},
					"DataCleaningInputStream": {
						"value": "[variables('DataCleaningInputStream')]"
					},
					"DataCleaningOutputStream": {
						"value": "[variables('DataCleaningOutputStream')]"
					},
					"messageRetentionInDays": {
						"value": "[parameters('messageRetentionInDays')]"
					},
					"partitionCount": {
						"value": "[parameters('partitionCount')]"
					},
					"captureEncodingFormat": {
						"value": "[parameters('captureEncodingFormat')]"
					},
					"captureTime": {
						"value": "[parameters('captureTime')]"
					},
					"captureSize": {
						"value": "[parameters('captureSize')]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"captureNameFormat": {
						"value": "[variables('captureNameFormat')]"
					},
					"keyVaultName":{
						"value": "[parameters('keyVaultName')]"
					}
				}
			},
			"dependsOn": [
				"dataLakeAnalytics"
			]
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "streamAnalyticsJobsTemplate",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"EventHubTemplate"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/streamAnalytics.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"eventHubNamespaceName": {
						"value": "[parameters('eventHubNamespaceName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"DataCleaningInputStream": {
						"value": "[variables('DataCleaningInputStream')]"
					},
					"DataCleaningOutputStream": {
						"value": "[variables('DataCleaningOutputStream')]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"sharedAccessPolicyKey": {
						"value": "[reference('EventHubTemplate').outputs.SharedAccessPolicyPrimaryKey.value]"
					},
					"DataCleaningStreamAnalyticsJob": {
						"value": "[variables('DataCleaningStreamAnalyticsJob')]"
					},
					"DataAggregatorStreamAnalyticsJob1": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob1')]"
					},
					"DataAggregatorStreamAnalyticsJob2": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob2')]"
					},
					"DataAggregatorStreamAnalyticsJob3": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob3')]"
					}
				}
			}
		},
		{
			"condition": "[equals(parameters('OptionalWizardInstall'), 'Yes')]",
			"type": "Microsoft.Resources/deployments",
			"name": "azureFunction",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"KibanaESDeployedVM"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/azureFunction.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"KibanaESDeployedVMIP": {
						"value": "[reference('KibanaESDeployedVM').outputs.publicIpAddress.value]"
					},
					"storageAccountName": {
						"value": "[variables('storageAccountName')]"
					},
					"_artifactsLocation": {
						"value": "[variables('_artifactsLocation')]"
					},
					"_artifactsLocationSasToken":{
						"value": "[parameters('_artifactsLocationSasToken')]"
					},
					"storageAccountConnectionString": {
						"value": "[reference('storageAccount').outputs.clientAzureStorageConnectionString.value]"
					},
					"appName": {
						"value": "[variables('appName')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"web_app_id": {
						"value": "[parameters('servicePrincipalId')]"
					},
					"web_app_secret": {
						"value": "[parameters('servicePrincipalKey')]"
					},
					"datafactory_name": {
						"value": "[parameters('dataFactoryName')]"
					},
					"eventhub_name": {
						"value": "[variables('DataCleaningInputStream')]"
					},
					"eventhub_namespace": {
						"value": "[parameters('eventHubNamespaceName')]"
					},
					"sas_key": {
						"value": "[reference('EventHubTemplate').outputs.SharedAccessPolicyPrimaryKey.value]"
					},
					"adla_account_name": {
						"value": "[parameters('adlAnalyticsName')]"
					},
					"DataCleaningStreamAnalyticsJob": {
						"value": "[variables('DataCleaningStreamAnalyticsJob')]"
					},
					"DataAggregatorStreamAnalyticsJob1": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob1')]"
					},
					"DataAggregatorStreamAnalyticsJob2": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob2')]"
					},
					"DataAggregatorStreamAnalyticsJob3": {
						"value": "[variables('DataAggregatorStreamAnalyticsJob3')]"
					}
				}
			}
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "KibanaESDeployedVM",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"storageAccount"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/elasticSearchKibana.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"vmSize": {
						"value": "[parameters('vmSize')]"
					},
					"username": {
						"value": "[parameters('vm_username')]"
					},
					"password": {
						"value": "[parameters('vm_password')]"
					},
					"dnsLabelPrefix": {
						"value": "[variables('dnsLabelPrefix')]"
					},
					"location": {
						"value": "[parameters('location')]"
					}
				}
			}
		},
		{
			"type": "Microsoft.Resources/deployments",
			"name": "KibanaFunctionApp",
			"apiVersion": "2018-02-01",
			"dependsOn": [
				"KibanaESDeployedVM"
			],
			"properties": {
				"mode": "Incremental",
				"templateLink": {
					"uri": "[uri(variables('_artifactsLocation'),'nested/blobTriggerdFunction.json')]",
					"contentVersion": "1.0.0.0"
				},
				"parameters": {
					"storage_name": {
						"value": "[variables('storageAccountName')]"
					},
					"storageConnectionString": {
						"value": "[reference('storageAccount').outputs.clientAzureStorageConnectionString.value]"
					},
					"kibanaFunctionHost": {
						"value": "[Concat(variables('ES_Function_name'),'.azurewebsites.net')]"
					},
					"kibanaFunctionPath": {
						"value": "/api/AddKibanaDashboard"
					},
					"EsIP": {
						"value": "[reference('KibanaESDeployedVM').outputs.publicIpAddress.value]"
					},
					"_artifactsLocation": {
						"value": "[variables('_artifactsLocation')]"
					},
					"serverfarms_EastUS2Plan_name": {
						"value": "[variables('serverfarms_EastUS2Plan_name')]"
					},
					"sites_demotriggerapp1234_name": {
						"value": "[variables('ES_Function_name')]"
					},
					"location": {
						"value": "[parameters('location')]"
					},
					"config_web_name_4": {
						"value": "[variables('config_web_name_4')]"
					}
				}
			}
		}
	],
	"outputs": {
		"websiteUrl": {
			"type": "string",
			"value": "[Concat(reference('azureFunction').outputs.websiteUrl.value,'/api/quickstart_wizard')]"
		}
	}
}

{'fraction_non_alphanumeric': 0.17460483071626062, 'fraction_numerical': 0.010824769158537221, 'mean_word_length': 2.808383828350055, 'pattern_counts': {'":': 848, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 18, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5540654', 'n_tokens_mistral': 15725, 'n_tokens_neox': 11724, 'n_words': 1967}