From eb75fb52cb85a6982dce1d44c9f8500eb8647ae4 Mon Sep 17 00:00:00 2001 From: RamonTC Date: Thu, 30 Nov 2017 10:23:56 +0100 Subject: [PATCH] Updated 14. Using Application Insights in eShopOnContainers (markdown) --- ...plication-Insights-in-eShopOnContainers.md | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/14.-Using-Application-Insights-in-eShopOnContainers.md b/14.-Using-Application-Insights-in-eShopOnContainers.md index 2fd9f95..27787b8 100644 --- a/14.-Using-Application-Insights-in-eShopOnContainers.md +++ b/14.-Using-Application-Insights-in-eShopOnContainers.md @@ -1 +1,69 @@ -TBD \ No newline at end of file +## eShopOnContainers Application Insights + +Follow the steps bellow to configure App Insights as a logging service. It is included the instructions for setting up App Insights in case you decide to register eShopOnContainers logs locally, or for instance in a cluster environment with Kubernetes or Service Fabric. + +### Create an App Insights service +Go to the Azure portal and create the service: +- Create Azure AppInsights + + +In case of using App Insights for logging eShopOnContainers in a cluster environment, Multi-role application map must be enabled: +- Enable Multi-role application map + + +Retrive the Instrumentation Key generated to be used later on. Go to properties in the portal and copy the key. + +### Setting up Application Insights locally +Open the **.env** file where all the environment variables are set, uncomment the **INSTRUMENTATION_KEY** variable and set the Instrumentation Key from your App Insights service that has previously been created: + +``` +#ESHOP_AZURE_REDIS_BASKET_DB= +#ESHOP_AZURE_STORAGE_CATALOG_URL= +#ESHOP_AZURE_STORAGE_MARKETING_URL= +#ESHOP_AZURE_SERVICE_BUS= +#ESHOP_AZURE_COSMOSDB= +#ESHOP_AZURE_CATALOG_DB= +#ESHOP_AZURE_IDENTITY_DB= +#ESHOP_AZURE_ORDERING_DB= +#ESHOP_AZURE_MARKETING_DB= +#ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI= +#ESHOP_AZURE_STORAGE_CATALOG_NAME= +#ESHOP_AZURE_STORAGE_CATALOG_KEY= +#ESHOP_AZURE_STORAGE_MARKETING_NAME= +#ESHOP_AZURE_STORAGE_MARKETING_KEY= +#ESHOP_SERVICE_BUS_USERNAME= +#ESHOP_SERVICE_BUS_PASSWORD= +**INSTRUMENTATION_KEY=** +#USE_LOADTEST= +``` + +### Setting up Application Insights in Service Fabric +- Retrieve the Instrumentation Key from your AppInsights service properties and set it in the cloud.xml config file of each SF app. + + +### Setting up Application Insights in Kubernetes +- Retrieve the Instrumentation Key from your AppInsights service properties. Open the **conf_local.yml** config file located in '/k8s' directory and set the variable **Instrumentation_Key** with the key. +``` + BasketBus: rabbitmq + BasketRedisConStr: basket-data + CatalogBus: rabbitmq + CatalogSqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word; + CatalogAzureStorageEnabled: "False" + IdentitySqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word; + LocationsBus: rabbitmq + LocationsNoSqlDb: mongodb://nosql-data + LocationsNoSqlDbName: LocationsDb + MarketingBus: rabbitmq + MarketingNoSqlDb: mongodb://nosql-data + MarketingNoSqlDbName: MarketingDb + MarketingSqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.MarketingDb;User Id=sa;Password=Pass@word; + OrderingBus: rabbitmq + OrderingSqlDb: Server=sql-data;Initial Catalog=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word; + PaymentBus: rabbitmq + UseAzureServiceBus: "False" + EnableLoadTest: "False" + keystore: keystore-data + GracePeriodManager_GracePeriodTime: "1" + GracePeriodManager_CheckUpdateTime: "15000" + **Instrumentation_Key: ""** +``` \ No newline at end of file