From ae4e263415f0d1068a9356cd69a963d85cd677e3 Mon Sep 17 00:00:00 2001 From: Sychev Igor Date: Tue, 3 Apr 2018 09:19:16 +0300 Subject: [PATCH] applicationinsights deploy template --- .../applicationinsights.json | 24 +++++++++++++++++++ .../applicationinsights.parameters.json | 9 +++++++ deploy/az/applicationinsights/readme.md | 19 +++++++++++++++ deploy/readme.md | 2 +- k8s/conf_cloud.yml | 3 ++- 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 deploy/az/applicationinsights/applicationinsights.json create mode 100644 deploy/az/applicationinsights/applicationinsights.parameters.json create mode 100644 deploy/az/applicationinsights/readme.md diff --git a/deploy/az/applicationinsights/applicationinsights.json b/deploy/az/applicationinsights/applicationinsights.json new file mode 100644 index 000000000..e7e7d2c7f --- /dev/null +++ b/deploy/az/applicationinsights/applicationinsights.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "type": "String" + } + }, + "variables": { + "appInsightsName": "[concat(parameters('name'), 'appinsights')]", + "appInsightsApplicationId": "parameters('name'" + }, + "resources": [ + { + "apiVersion": "2014-08-01", + "name": "[variables('appInsightsName')]", + "type": "Microsoft.Insights/components", + "location": "[resourceGroup().location]", + "properties": { + "ApplicationId": "[variables('appInsightsApplicationId')]" + } + } + ] +} \ No newline at end of file diff --git a/deploy/az/applicationinsights/applicationinsights.parameters.json b/deploy/az/applicationinsights/applicationinsights.parameters.json new file mode 100644 index 000000000..1cfc49a48 --- /dev/null +++ b/deploy/az/applicationinsights/applicationinsights.parameters.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "eshop" + } + } +} \ No newline at end of file diff --git a/deploy/az/applicationinsights/readme.md b/deploy/az/applicationinsights/readme.md new file mode 100644 index 000000000..0644ded80 --- /dev/null +++ b/deploy/az/applicationinsights/readme.md @@ -0,0 +1,19 @@ +# Deploying Azure Application Insights + +The ARM template `applicationinsights.json` and its parameter file (`applicationinsights.parameters.json`) are used to deploy Azure Application Insights + +## Deploy the template + +Once parameter file is edited you can deploy it using [create-resources script](../readme.md). + +i. e. if you are in Windows, to deploy the Azure Azure Application Insights in a new resourcegroup located in westus, go to `deploy\az` folder and type: + +``` +create-resources.cmd applicationinsights\applicationinsights newResourceGroup -c westus +``` + +## Setting Azure Application Insights InstrumentationKey in for projects + +Cope from Azure portal InstrumentationKey and add it in containers configuration. +For Kubernates - it can be done in k8s\conf_cloud.yml file as a value for Instrumentation_Key key. +For local docker environment remove # from INSTRUMENTATION_KEY key in .env file. \ No newline at end of file diff --git a/deploy/readme.md b/deploy/readme.md index 27b168713..fadea3dd0 100644 --- a/deploy/readme.md +++ b/deploy/readme.md @@ -24,7 +24,7 @@ Using `docker-machine` is the recommended way to create a VM with docker install 5. [Deploying Catalog Storage](az/storage/catalog/readme.md) 6. [Deploying Marketing Storage](az/storage/marketing/readme.md) 7. [Deploying Marketing Azure functions](az/azurefunctions/readme.md) - +8. [Deploying Azure Application Insights](az/applicationinsights/readme.md) diff --git a/k8s/conf_cloud.yml b/k8s/conf_cloud.yml index 624d3a59b..8c74ab71a 100644 --- a/k8s/conf_cloud.yml +++ b/k8s/conf_cloud.yml @@ -31,4 +31,5 @@ data: PaymentBus: CONNECTION_STRING (NAME OF RABBITMQ CONTAINER OR Endpoint=sb://XXXX for topic in case of using Azure) # Global entries UseAzureServiceBus: "TRUE" IF USE AZURE SB ("FALSE" FOR USING RABBITMQ) - keystore: REDIS CONNECTION STRING FOR KEYSTORE \ No newline at end of file + keystore: REDIS CONNECTION STRING FOR KEYSTORE + Instrumentation_Key: "" \ No newline at end of file