diff --git a/.env b/.env index 797e5fc5c..9deb66be7 100644 --- a/.env +++ b/.env @@ -23,3 +23,5 @@ ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92 #ESHOP_AZURE_STORAGE_MARKETING_KEY= #ESHOP_SERVICE_BUS_USERNAME= #ESHOP_SERVICE_BUS_PASSWORD= +#INSTRUMENTATION_KEY= +#ORCHESTRATOR_TYPE= \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 39110c1be..81a6ba959 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -19,6 +19,8 @@ services: - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME} - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD} - AzureServiceBusEnabled=False + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5103:80" @@ -36,6 +38,8 @@ services: - UseCustomizationData=True - AzureServiceBusEnabled=False - AzureStorageEnabled=False + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5101:80" @@ -51,7 +55,9 @@ services: - MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110 - BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103 - OrderingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102 - - UseCustomizationData=True + - UseCustomizationData=True + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5105:80" @@ -69,6 +75,8 @@ services: - AzureServiceBusEnabled=False - CheckUpdateTime=30000 - GracePeriodTime=1 + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5102:80" @@ -90,6 +98,8 @@ services: - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_MARKETING_KEY} - AzureServiceBusEnabled=False - AzureStorageEnabled=False + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5110:80" @@ -110,6 +120,8 @@ services: - MarketingUrlHC=http://marketing.api/hc - PaymentUrlHC=http://payment.api/hc - UseCustomizationData=True + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5104:80" @@ -130,6 +142,8 @@ services: - MarketingUrlHC=http://marketing.api/hc - PaymentUrlHC=http://payment.api/hc - UseCustomizationData=True + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5100:80" @@ -146,6 +160,8 @@ services: - PaymentUrl=http://payment.api/hc - mvc=http://webmvc/hc - spa=http://webspa/hc + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5107:80" @@ -157,6 +173,7 @@ services: - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME} - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD} - AzureServiceBusEnabled=False + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} ports: - "5108:80" @@ -172,6 +189,8 @@ services: - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME} - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD} - AzureServiceBusEnabled=False + - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} + - OrchestratorType=${ORCHESTRATOR_TYPE} ports: - "5109:80" diff --git a/k8s/conf_local.yml b/k8s/conf_local.yml index 00d1c2398..a605ff7aa 100644 --- a/k8s/conf_local.yml +++ b/k8s/conf_local.yml @@ -25,5 +25,7 @@ data: keystore: keystore-data GracePeriodManager_GracePeriodTime: "1" GracePeriodManager_CheckUpdateTime: "15000" + Instrumentation_Key: "" + diff --git a/k8s/deployments.yaml b/k8s/deployments.yaml index 2a9d6862e..14b5ac31b 100644 --- a/k8s/deployments.yaml +++ b/k8s/deployments.yaml @@ -32,11 +32,18 @@ spec: configMapKeyRef: name: externalcfg key: UseAzureServiceBus + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key - name: IdentityUrl valueFrom: configMapKeyRef: name: urls key: IdentityUrl + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -95,6 +102,13 @@ spec: configMapKeyRef: name: externalcfg key: CatalogBus + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -133,7 +147,7 @@ spec: env: - name: PATH_BASE value: /identity - - name: ConnectionStrings__DefaultConnection + - name: ConnectionString valueFrom: configMapKeyRef: name: externalcfg @@ -174,7 +188,14 @@ spec: valueFrom: configMapKeyRef: name: urls - key: OrderingApiClient + key: OrderingApiClient + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -242,7 +263,14 @@ spec: valueFrom: configMapKeyRef: name: externalcfg - key: GracePeriodManager_GracePeriodTime + key: GracePeriodManager_GracePeriodTime + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -310,7 +338,14 @@ spec: valueFrom: configMapKeyRef: name: urls - key: IdentityUrl + key: IdentityUrl + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -388,7 +423,14 @@ spec: valueFrom: configMapKeyRef: name: urls - key: Marketing_PicBaseUrl + key: Marketing_PicBaseUrl + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -437,6 +479,13 @@ spec: configMapKeyRef: name: externalcfg key: PaymentBus + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -546,7 +595,14 @@ spec: valueFrom: configMapKeyRef: name: urls - key: PaymentHealthCheckUrl + key: PaymentHealthCheckUrl + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: @@ -629,7 +685,14 @@ spec: valueFrom: configMapKeyRef: name: urls - key: PaymentHealthCheckUrl + key: PaymentHealthCheckUrl + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 imagePullSecrets: @@ -726,6 +789,13 @@ spec: configMapKeyRef: name: urls key: PaymentHealthCheckUrl + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: Instrumentation_Key + - name: OrchestratorType + value: 'K8S' ports: - containerPort: 80 readinessProbe: diff --git a/mssql/.system/instance_id b/mssql/.system/instance_id deleted file mode 100644 index c04def3e2..000000000 --- a/mssql/.system/instance_id +++ /dev/null @@ -1 +0,0 @@ -42e93c96-946a-448e-9d1f-182c8ccc5005 \ No newline at end of file diff --git a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Crypto/RSA/S-1-5-21-4137405425-2340124300-2890394999-500/42e7704ae40b0d75de00736cc66b813a_67aaedee-1e4a-4132-b8ba-5397448c74de b/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Crypto/RSA/S-1-5-21-4137405425-2340124300-2890394999-500/42e7704ae40b0d75de00736cc66b813a_67aaedee-1e4a-4132-b8ba-5397448c74de deleted file mode 100644 index 38c6581ad..000000000 Binary files a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Crypto/RSA/S-1-5-21-4137405425-2340124300-2890394999-500/42e7704ae40b0d75de00736cc66b813a_67aaedee-1e4a-4132-b8ba-5397448c74de and /dev/null differ diff --git a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/CREDHIST b/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/CREDHIST deleted file mode 100644 index ce6eac207..000000000 Binary files a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/CREDHIST and /dev/null differ diff --git a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/S-1-5-21-4137405425-2340124300-2890394999-500/48e880fa-19d4-4fd8-b209-07cff1308993 b/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/S-1-5-21-4137405425-2340124300-2890394999-500/48e880fa-19d4-4fd8-b209-07cff1308993 deleted file mode 100644 index 874116296..000000000 Binary files a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/S-1-5-21-4137405425-2340124300-2890394999-500/48e880fa-19d4-4fd8-b209-07cff1308993 and /dev/null differ diff --git a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/S-1-5-21-4137405425-2340124300-2890394999-500/Preferred b/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/S-1-5-21-4137405425-2340124300-2890394999-500/Preferred deleted file mode 100644 index abafa2248..000000000 Binary files a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/Protect/S-1-5-21-4137405425-2340124300-2890394999-500/Preferred and /dev/null differ diff --git a/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/SystemCertificates/My/AppContainerUserCertRead b/mssql/.system/profiles/Client/AppData/Roaming/Microsoft/SystemCertificates/My/AppContainerUserCertRead deleted file mode 100644 index e69de29bb..000000000 diff --git a/mssql/.system/profiles/Temp/1a541f5da82a46408b4fbfc4cbc88b2 b/mssql/.system/profiles/Temp/1a541f5da82a46408b4fbfc4cbc88b2 deleted file mode 100644 index 52b94b650..000000000 Binary files a/mssql/.system/profiles/Temp/1a541f5da82a46408b4fbfc4cbc88b2 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/1b42c59ee5d0b243aaf792ba47169816 b/mssql/.system/profiles/Temp/1b42c59ee5d0b243aaf792ba47169816 deleted file mode 100644 index af94535ff..000000000 Binary files a/mssql/.system/profiles/Temp/1b42c59ee5d0b243aaf792ba47169816 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/1c81b699afe567302ac6ebbccfe58faf b/mssql/.system/profiles/Temp/1c81b699afe567302ac6ebbccfe58faf deleted file mode 100644 index f81bd84dd..000000000 Binary files a/mssql/.system/profiles/Temp/1c81b699afe567302ac6ebbccfe58faf and /dev/null differ diff --git a/mssql/.system/profiles/Temp/1e42979f514909df4e55f88bc5f33d2f b/mssql/.system/profiles/Temp/1e42979f514909df4e55f88bc5f33d2f deleted file mode 100644 index 08e7df176..000000000 Binary files a/mssql/.system/profiles/Temp/1e42979f514909df4e55f88bc5f33d2f and /dev/null differ diff --git a/mssql/.system/profiles/Temp/23d74814f69031dbc0ccc2df7136e49d b/mssql/.system/profiles/Temp/23d74814f69031dbc0ccc2df7136e49d deleted file mode 100644 index 439401d70..000000000 Binary files a/mssql/.system/profiles/Temp/23d74814f69031dbc0ccc2df7136e49d and /dev/null differ diff --git a/mssql/.system/profiles/Temp/2aa13217ef04d399db1f5bf837df6133 b/mssql/.system/profiles/Temp/2aa13217ef04d399db1f5bf837df6133 deleted file mode 100644 index dda426bec..000000000 Binary files a/mssql/.system/profiles/Temp/2aa13217ef04d399db1f5bf837df6133 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/2ceaf558dea6ea34749579158b71cd81 b/mssql/.system/profiles/Temp/2ceaf558dea6ea34749579158b71cd81 deleted file mode 100644 index 0e6c2d966..000000000 Binary files a/mssql/.system/profiles/Temp/2ceaf558dea6ea34749579158b71cd81 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/30ebb5aa7a83a397d7be7db38866066 b/mssql/.system/profiles/Temp/30ebb5aa7a83a397d7be7db38866066 deleted file mode 100644 index 339576ff2..000000000 Binary files a/mssql/.system/profiles/Temp/30ebb5aa7a83a397d7be7db38866066 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/32f4099bd7615b9e5661802aa7f5263c b/mssql/.system/profiles/Temp/32f4099bd7615b9e5661802aa7f5263c deleted file mode 100644 index 68445f636..000000000 Binary files a/mssql/.system/profiles/Temp/32f4099bd7615b9e5661802aa7f5263c and /dev/null differ diff --git a/mssql/.system/profiles/Temp/3381e0697f2e1f4d0a8ec84906e38be b/mssql/.system/profiles/Temp/3381e0697f2e1f4d0a8ec84906e38be deleted file mode 100644 index 89cd80135..000000000 Binary files a/mssql/.system/profiles/Temp/3381e0697f2e1f4d0a8ec84906e38be and /dev/null differ diff --git a/mssql/.system/profiles/Temp/3d358c0071446cfcdf51d001911f0a76 b/mssql/.system/profiles/Temp/3d358c0071446cfcdf51d001911f0a76 deleted file mode 100644 index 35ddc2b82..000000000 Binary files a/mssql/.system/profiles/Temp/3d358c0071446cfcdf51d001911f0a76 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/42b29843fc2cb7da8c24ad9c1610bf0b b/mssql/.system/profiles/Temp/42b29843fc2cb7da8c24ad9c1610bf0b deleted file mode 100644 index 0e087dfd3..000000000 Binary files a/mssql/.system/profiles/Temp/42b29843fc2cb7da8c24ad9c1610bf0b and /dev/null differ diff --git a/mssql/.system/profiles/Temp/4322133a39682df51341c921988ba43e b/mssql/.system/profiles/Temp/4322133a39682df51341c921988ba43e deleted file mode 100644 index bfacc733e..000000000 Binary files a/mssql/.system/profiles/Temp/4322133a39682df51341c921988ba43e and /dev/null differ diff --git a/mssql/.system/profiles/Temp/43359794eab4b6542013fa43abadfaa3 b/mssql/.system/profiles/Temp/43359794eab4b6542013fa43abadfaa3 deleted file mode 100644 index d21f64f37..000000000 Binary files a/mssql/.system/profiles/Temp/43359794eab4b6542013fa43abadfaa3 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/4f00a20180e71c01826e3251bef80fd8 b/mssql/.system/profiles/Temp/4f00a20180e71c01826e3251bef80fd8 deleted file mode 100644 index 54431aad3..000000000 Binary files a/mssql/.system/profiles/Temp/4f00a20180e71c01826e3251bef80fd8 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/6015d19ff83133aab7fbc00e055c31a b/mssql/.system/profiles/Temp/6015d19ff83133aab7fbc00e055c31a deleted file mode 100644 index 792194531..000000000 Binary files a/mssql/.system/profiles/Temp/6015d19ff83133aab7fbc00e055c31a and /dev/null differ diff --git a/mssql/.system/profiles/Temp/732d238512e92e4ef9089fb4c61a4808 b/mssql/.system/profiles/Temp/732d238512e92e4ef9089fb4c61a4808 deleted file mode 100644 index 4ef688250..000000000 Binary files a/mssql/.system/profiles/Temp/732d238512e92e4ef9089fb4c61a4808 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/7907394830ef17d4ba0175bd9826da51 b/mssql/.system/profiles/Temp/7907394830ef17d4ba0175bd9826da51 deleted file mode 100644 index d44e1316d..000000000 Binary files a/mssql/.system/profiles/Temp/7907394830ef17d4ba0175bd9826da51 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/7bcc896c1f2df666851a1f73c84e9cff b/mssql/.system/profiles/Temp/7bcc896c1f2df666851a1f73c84e9cff deleted file mode 100644 index 41d173bd0..000000000 Binary files a/mssql/.system/profiles/Temp/7bcc896c1f2df666851a1f73c84e9cff and /dev/null differ diff --git a/mssql/.system/profiles/Temp/7d1bf98b298a3c8850d74e5b660332fb b/mssql/.system/profiles/Temp/7d1bf98b298a3c8850d74e5b660332fb deleted file mode 100644 index 8e067d5b0..000000000 Binary files a/mssql/.system/profiles/Temp/7d1bf98b298a3c8850d74e5b660332fb and /dev/null differ diff --git a/mssql/.system/profiles/Temp/8129f518dd51573cf4133f18ec1b91f5 b/mssql/.system/profiles/Temp/8129f518dd51573cf4133f18ec1b91f5 deleted file mode 100644 index 17a6f5993..000000000 Binary files a/mssql/.system/profiles/Temp/8129f518dd51573cf4133f18ec1b91f5 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/84c18e096493bccd90c998b08df6a21d b/mssql/.system/profiles/Temp/84c18e096493bccd90c998b08df6a21d deleted file mode 100644 index 6103150db..000000000 Binary files a/mssql/.system/profiles/Temp/84c18e096493bccd90c998b08df6a21d and /dev/null differ diff --git a/mssql/.system/profiles/Temp/8e7242dcdb663928bc35e846ec723a6 b/mssql/.system/profiles/Temp/8e7242dcdb663928bc35e846ec723a6 deleted file mode 100644 index 060e114b5..000000000 Binary files a/mssql/.system/profiles/Temp/8e7242dcdb663928bc35e846ec723a6 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/9d3bc5ac6d976a983b53e8e6fbb3a24e b/mssql/.system/profiles/Temp/9d3bc5ac6d976a983b53e8e6fbb3a24e deleted file mode 100644 index ef4d7859f..000000000 Binary files a/mssql/.system/profiles/Temp/9d3bc5ac6d976a983b53e8e6fbb3a24e and /dev/null differ diff --git a/mssql/.system/profiles/Temp/a248390ce868079187416f934759fba9 b/mssql/.system/profiles/Temp/a248390ce868079187416f934759fba9 deleted file mode 100644 index 08e7df176..000000000 Binary files a/mssql/.system/profiles/Temp/a248390ce868079187416f934759fba9 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/a2b2d2c1e3374a928a751febe0395fd b/mssql/.system/profiles/Temp/a2b2d2c1e3374a928a751febe0395fd deleted file mode 100644 index cb16554b8..000000000 Binary files a/mssql/.system/profiles/Temp/a2b2d2c1e3374a928a751febe0395fd and /dev/null differ diff --git a/mssql/.system/profiles/Temp/ae5574d6c15bd1a63341127b45e498da b/mssql/.system/profiles/Temp/ae5574d6c15bd1a63341127b45e498da deleted file mode 100644 index aa55e3a1a..000000000 Binary files a/mssql/.system/profiles/Temp/ae5574d6c15bd1a63341127b45e498da and /dev/null differ diff --git a/mssql/.system/profiles/Temp/af09a9c0f1aac9656097f623fc81d159 b/mssql/.system/profiles/Temp/af09a9c0f1aac9656097f623fc81d159 deleted file mode 100644 index 4481e270b..000000000 Binary files a/mssql/.system/profiles/Temp/af09a9c0f1aac9656097f623fc81d159 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/b0be8059be14de098ad41f86831e1da1 b/mssql/.system/profiles/Temp/b0be8059be14de098ad41f86831e1da1 deleted file mode 100644 index 8f349a6d3..000000000 Binary files a/mssql/.system/profiles/Temp/b0be8059be14de098ad41f86831e1da1 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/b457fe0369797a89bff03c6e1fc69fa2 b/mssql/.system/profiles/Temp/b457fe0369797a89bff03c6e1fc69fa2 deleted file mode 100644 index c8b62bbc0..000000000 Binary files a/mssql/.system/profiles/Temp/b457fe0369797a89bff03c6e1fc69fa2 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/b71273b08a354ee7e274d621bf431e90 b/mssql/.system/profiles/Temp/b71273b08a354ee7e274d621bf431e90 deleted file mode 100644 index 882b1bc08..000000000 Binary files a/mssql/.system/profiles/Temp/b71273b08a354ee7e274d621bf431e90 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/be6eef1d8f9b5ffbc7282050e4c34197 b/mssql/.system/profiles/Temp/be6eef1d8f9b5ffbc7282050e4c34197 deleted file mode 100644 index 08e7df176..000000000 Binary files a/mssql/.system/profiles/Temp/be6eef1d8f9b5ffbc7282050e4c34197 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/c33e2c07b053ed06080e18f9cc59f77 b/mssql/.system/profiles/Temp/c33e2c07b053ed06080e18f9cc59f77 deleted file mode 100644 index 71dd0225e..000000000 Binary files a/mssql/.system/profiles/Temp/c33e2c07b053ed06080e18f9cc59f77 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/c3eca02fc0502f7786376d0cd281d604 b/mssql/.system/profiles/Temp/c3eca02fc0502f7786376d0cd281d604 deleted file mode 100644 index 1651e390b..000000000 Binary files a/mssql/.system/profiles/Temp/c3eca02fc0502f7786376d0cd281d604 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/c428f4c0244fbb9b4a888ddfe25fcb03 b/mssql/.system/profiles/Temp/c428f4c0244fbb9b4a888ddfe25fcb03 deleted file mode 100644 index 54b448dd4..000000000 Binary files a/mssql/.system/profiles/Temp/c428f4c0244fbb9b4a888ddfe25fcb03 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/c460f565e5f9bf596e84618bae567754 b/mssql/.system/profiles/Temp/c460f565e5f9bf596e84618bae567754 deleted file mode 100644 index 69e39a0ff..000000000 Binary files a/mssql/.system/profiles/Temp/c460f565e5f9bf596e84618bae567754 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/c7fff830bc209b3cb2d2a9541c61aa6 b/mssql/.system/profiles/Temp/c7fff830bc209b3cb2d2a9541c61aa6 deleted file mode 100644 index 08e7df176..000000000 Binary files a/mssql/.system/profiles/Temp/c7fff830bc209b3cb2d2a9541c61aa6 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/d1136286d24fd64a5a957a3d86bc0576 b/mssql/.system/profiles/Temp/d1136286d24fd64a5a957a3d86bc0576 deleted file mode 100644 index 2e738812a..000000000 Binary files a/mssql/.system/profiles/Temp/d1136286d24fd64a5a957a3d86bc0576 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/d38e57dc354641377a0a21444180bc92 b/mssql/.system/profiles/Temp/d38e57dc354641377a0a21444180bc92 deleted file mode 100644 index d5a5c6bbd..000000000 Binary files a/mssql/.system/profiles/Temp/d38e57dc354641377a0a21444180bc92 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/d68589df980066c61cbc6b6e0781bb b/mssql/.system/profiles/Temp/d68589df980066c61cbc6b6e0781bb deleted file mode 100644 index 08e7df176..000000000 Binary files a/mssql/.system/profiles/Temp/d68589df980066c61cbc6b6e0781bb and /dev/null differ diff --git a/mssql/.system/profiles/Temp/d71268d41db313db8113907726e7bad b/mssql/.system/profiles/Temp/d71268d41db313db8113907726e7bad deleted file mode 100644 index b6fae64b5..000000000 Binary files a/mssql/.system/profiles/Temp/d71268d41db313db8113907726e7bad and /dev/null differ diff --git a/mssql/.system/profiles/Temp/d9afcc42ac8e8fa3d7f426545902b6d5 b/mssql/.system/profiles/Temp/d9afcc42ac8e8fa3d7f426545902b6d5 deleted file mode 100644 index f6721d8e9..000000000 Binary files a/mssql/.system/profiles/Temp/d9afcc42ac8e8fa3d7f426545902b6d5 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/e18b66c54da5d9742837799f70ac6d31 b/mssql/.system/profiles/Temp/e18b66c54da5d9742837799f70ac6d31 deleted file mode 100644 index f78950d7d..000000000 Binary files a/mssql/.system/profiles/Temp/e18b66c54da5d9742837799f70ac6d31 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/e464d86334b854c8f93090881f82e70d b/mssql/.system/profiles/Temp/e464d86334b854c8f93090881f82e70d deleted file mode 100644 index 969221a30..000000000 Binary files a/mssql/.system/profiles/Temp/e464d86334b854c8f93090881f82e70d and /dev/null differ diff --git a/mssql/.system/profiles/Temp/e7c8cf705009960cb96991c9207c386 b/mssql/.system/profiles/Temp/e7c8cf705009960cb96991c9207c386 deleted file mode 100644 index 0601ef9a0..000000000 Binary files a/mssql/.system/profiles/Temp/e7c8cf705009960cb96991c9207c386 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/ec4c7e8181ae15da5710fd3d87d1e7 b/mssql/.system/profiles/Temp/ec4c7e8181ae15da5710fd3d87d1e7 deleted file mode 100644 index e8d09937e..000000000 Binary files a/mssql/.system/profiles/Temp/ec4c7e8181ae15da5710fd3d87d1e7 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/f68cc8518fc6f0388dd468caa5024e62 b/mssql/.system/profiles/Temp/f68cc8518fc6f0388dd468caa5024e62 deleted file mode 100644 index 11b37ff01..000000000 Binary files a/mssql/.system/profiles/Temp/f68cc8518fc6f0388dd468caa5024e62 and /dev/null differ diff --git a/mssql/.system/profiles/Temp/f6960589693f36be384813057950420c b/mssql/.system/profiles/Temp/f6960589693f36be384813057950420c deleted file mode 100644 index 5405517a6..000000000 Binary files a/mssql/.system/profiles/Temp/f6960589693f36be384813057950420c and /dev/null differ diff --git a/mssql/.system/profiles/Temp/f94a5478dc3f78f6c45943eda1a0285e b/mssql/.system/profiles/Temp/f94a5478dc3f78f6c45943eda1a0285e deleted file mode 100644 index 83dd22e6d..000000000 Binary files a/mssql/.system/profiles/Temp/f94a5478dc3f78f6c45943eda1a0285e and /dev/null differ diff --git a/mssql/.system/programdata/Microsoft/NetFramework/BreadcrumbStore/Microsoft.Diagnostics.Tracing.EventSource, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a b/mssql/.system/programdata/Microsoft/NetFramework/BreadcrumbStore/Microsoft.Diagnostics.Tracing.EventSource, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a deleted file mode 100644 index e69de29bb..000000000 diff --git a/mssql/.system/programdata/Microsoft/NetFramework/BreadcrumbStore/Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.26.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a b/mssql/.system/programdata/Microsoft/NetFramework/BreadcrumbStore/Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.26.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a deleted file mode 100644 index e69de29bb..000000000 diff --git a/mssql/.system/system/licensing.hiv b/mssql/.system/system/licensing.hiv deleted file mode 100644 index b94e22df3..000000000 Binary files a/mssql/.system/system/licensing.hiv and /dev/null differ diff --git a/mssql/.system/system/lsa.hiv b/mssql/.system/system/lsa.hiv deleted file mode 100644 index f307ac578..000000000 Binary files a/mssql/.system/system/lsa.hiv and /dev/null differ diff --git a/mssql/.system/system/security.hiv b/mssql/.system/system/security.hiv deleted file mode 100644 index d0123dd13..000000000 Binary files a/mssql/.system/system/security.hiv and /dev/null differ diff --git a/mssql/.system/system/system32/Microsoft/Protect/S-1-5-18/User/Preferred b/mssql/.system/system/system32/Microsoft/Protect/S-1-5-18/User/Preferred deleted file mode 100644 index fec27ea55..000000000 Binary files a/mssql/.system/system/system32/Microsoft/Protect/S-1-5-18/User/Preferred and /dev/null differ diff --git a/mssql/.system/system/system32/Microsoft/Protect/S-1-5-18/User/d01f9596-8a07-4854-9c5a-348703ee814c b/mssql/.system/system/system32/Microsoft/Protect/S-1-5-18/User/d01f9596-8a07-4854-9c5a-348703ee814c deleted file mode 100644 index 1dc713246..000000000 Binary files a/mssql/.system/system/system32/Microsoft/Protect/S-1-5-18/User/d01f9596-8a07-4854-9c5a-348703ee814c and /dev/null differ diff --git a/mssql/secrets/machine-key b/mssql/secrets/machine-key deleted file mode 100644 index e4995d7f6..000000000 Binary files a/mssql/secrets/machine-key and /dev/null differ diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index 8864c9d06..5e07fbddb 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -16,6 +16,9 @@ + + + diff --git a/src/Services/Basket/Basket.API/Program.cs b/src/Services/Basket/Basket.API/Program.cs index 53b6f311f..19bbf2c24 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using System.IO; @@ -23,12 +24,17 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API .UseHealthChecks("/hc") .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup() + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); }) + .UseApplicationInsights() .Build(); } } diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index b82a912d8..ae65a8486 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -43,7 +43,9 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API // This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) - { + { + services.AddApplicationInsightsTelemetry(Configuration); + // Add framework services. services.AddMvc(options => { @@ -63,6 +65,12 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API services.Configure(Configuration); + if(Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + //By connecting here we are making sure that our service //cannot start until redis is ready. This might slow down startup, //but given that there is a delay on resolving the ip address @@ -167,14 +175,17 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) { app.UsePathBase(pathBase); - } + } + app.UseStaticFiles(); app.UseCors("CorsPolicy"); @@ -198,8 +209,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API // prevent from mapping "sub" claim to nameidentifier. JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); - var identityUrl = Configuration.GetValue("IdentityUrl"); - + var identityUrl = Configuration.GetValue("IdentityUrl"); + services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; diff --git a/src/Services/Basket/Basket.API/appsettings.json b/src/Services/Basket/Basket.API/appsettings.json index f062f76d7..027fe9d23 100644 --- a/src/Services/Basket/Basket.API/appsettings.json +++ b/src/Services/Basket/Basket.API/appsettings.json @@ -10,5 +10,8 @@ "IdentityUrl": "http://localhost:5105", "ConnectionString": "127.0.0.1", "AzureServiceBusEnabled": false, - "SubscriptionClientName": "Basket" + "SubscriptionClientName": "Basket", + "ApplicationInsights": { + "InstrumentationKey": "" + } } \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 0d8c77efd..5d5812953 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -35,6 +35,9 @@ + + + diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 1eeeeb5ec..bef3fa360 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -31,15 +32,20 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() + .UseApplicationInsights() .UseHealthChecks("/hc") - .UseContentRoot(Directory.GetCurrentDirectory()) + .UseContentRoot(Directory.GetCurrentDirectory()) .UseWebRoot("Pics") + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); - }) + }) .Build(); } } \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 31a3e88fb..78c2d7ace 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -13,7 +13,6 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; - using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling; @@ -41,6 +40,14 @@ { // Add framework services. + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + services.AddHealthChecks(checks => { var minutes = 1; @@ -171,6 +178,8 @@ loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) diff --git a/src/Services/Catalog/Catalog.API/appsettings.json b/src/Services/Catalog/Catalog.API/appsettings.json index dafeca845..dc4e0aa5c 100644 --- a/src/Services/Catalog/Catalog.API/appsettings.json +++ b/src/Services/Catalog/Catalog.API/appsettings.json @@ -12,5 +12,8 @@ }, "AzureServiceBusEnabled": false, "AzureStorageEnabled": false, - "SubscriptionClientName": "Catalog" + "SubscriptionClientName": "Catalog", + "ApplicationInsights": { + "InstrumentationKey": "" + } } diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index cee95b94f..84b1c280c 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -16,6 +16,9 @@ + + + diff --git a/src/Services/Identity/Identity.API/Program.cs b/src/Services/Identity/Identity.API/Program.cs index 0b32b4549..7b73838e6 100644 --- a/src/Services/Identity/Identity.API/Program.cs +++ b/src/Services/Identity/Identity.API/Program.cs @@ -43,12 +43,17 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup() + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); }) + .UseApplicationInsights() .Build(); } } diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index ea5e49102..da93e1a51 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -31,6 +31,14 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API // This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + // Add framework services. services.AddDbContext(options => options.UseSqlServer(Configuration["ConnectionString"], @@ -114,7 +122,9 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); - + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); diff --git a/src/Services/Identity/Identity.API/appsettings.json b/src/Services/Identity/Identity.API/appsettings.json index 5633c1022..05e06c441 100644 --- a/src/Services/Identity/Identity.API/appsettings.json +++ b/src/Services/Identity/Identity.API/appsettings.json @@ -12,5 +12,8 @@ "System": "Information", "Microsoft": "Information" } + }, + "ApplicationInsights": { + "InstrumentationKey": "" } } diff --git a/src/Services/Location/Locations.API/Locations.API.csproj b/src/Services/Location/Locations.API/Locations.API.csproj index b1b322708..f6a2b0e98 100644 --- a/src/Services/Location/Locations.API/Locations.API.csproj +++ b/src/Services/Location/Locations.API/Locations.API.csproj @@ -11,6 +11,9 @@ + + + diff --git a/src/Services/Location/Locations.API/Program.cs b/src/Services/Location/Locations.API/Program.cs index 7ebc0ab8a..85f3191cc 100644 --- a/src/Services/Location/Locations.API/Program.cs +++ b/src/Services/Location/Locations.API/Program.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using System.IO; @@ -18,11 +19,17 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API .UseHealthChecks("/hc") .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup() + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); - }).Build(); + }) + .UseApplicationInsights() + .Build(); } } diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index 442210216..115fa5f32 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -37,6 +37,14 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API public IServiceProvider ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + services.AddMvc(options => { options.Filters.Add(typeof(HttpGlobalExceptionFilter)); @@ -142,6 +150,9 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) { diff --git a/src/Services/Location/Locations.API/appsettings.json b/src/Services/Location/Locations.API/appsettings.json index 511bb5c6a..0064466af 100644 --- a/src/Services/Location/Locations.API/appsettings.json +++ b/src/Services/Location/Locations.API/appsettings.json @@ -11,5 +11,8 @@ } }, "AzureServiceBusEnabled": false, - "SubscriptionClientName": "Locations" + "SubscriptionClientName": "Locations", + "ApplicationInsights": { + "InstrumentationKey": "" + } } \ No newline at end of file diff --git a/src/Services/Marketing/Marketing.API/Marketing.API.csproj b/src/Services/Marketing/Marketing.API/Marketing.API.csproj index 2afba2204..a462eb04e 100644 --- a/src/Services/Marketing/Marketing.API/Marketing.API.csproj +++ b/src/Services/Marketing/Marketing.API/Marketing.API.csproj @@ -7,9 +7,12 @@ $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; aspnet-Marketing.API-20161122013619 + /subscriptions/6c22bb55-0221-4ce4-9bf1-3c4a10a7294c/resourcegroups/eshop-log/providers/microsoft.insights/components/eshopappinsights + /subscriptions/6c22bb55-0221-4ce4-9bf1-3c4a10a7294c/resourcegroups/eshop-log/providers/microsoft.insights/components/eshopappinsights + PreserveNewest @@ -18,6 +21,9 @@ + + + @@ -45,4 +51,8 @@ PreserveNewest + + + + diff --git a/src/Services/Marketing/Marketing.API/Program.cs b/src/Services/Marketing/Marketing.API/Program.cs index 32852073c..70b2362e1 100644 --- a/src/Services/Marketing/Marketing.API/Program.cs +++ b/src/Services/Marketing/Marketing.API/Program.cs @@ -3,6 +3,7 @@ using AspNetCore.Hosting; using Microsoft.AspNetCore; using Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure; + using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System.IO; @@ -25,15 +26,22 @@ public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) + .UseApplicationInsights() .UseHealthChecks("/hc") .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup() .UseWebRoot("Pics") + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); - }).Build(); + }) + .UseApplicationInsights() + .Build(); } } diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index 0df0285d8..540cb8a12 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -44,6 +44,14 @@ // This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + // Add framework services. services.AddMvc(options => { @@ -172,6 +180,9 @@ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env,ILoggerFactory loggerFactory) { + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) @@ -195,7 +206,7 @@ ConfigureEventBus(app); } - private void ConfigureAuthService(IServiceCollection services) + private void ConfigureAuthService(IServiceCollection services, ILoggerFactory loggerFactory) { // prevent from mapping "sub" claim to nameidentifier. JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); diff --git a/src/Services/Marketing/Marketing.API/appsettings.json b/src/Services/Marketing/Marketing.API/appsettings.json index 21aae065a..cc55a4052 100644 --- a/src/Services/Marketing/Marketing.API/appsettings.json +++ b/src/Services/Marketing/Marketing.API/appsettings.json @@ -1,4 +1,4 @@ -{ +{ "Logging": { "IncludeScopes": false, "LogLevel": { @@ -12,6 +12,8 @@ "PicBaseUrl": "http://localhost:5110/api/v1/campaigns/[0]/pic/", "AzureServiceBusEnabled": false, "SubscriptionClientName": "Marketing", - "AzureStorageEnabled": false - -} + "AzureStorageEnabled": false, + "ApplicationInsights": { + "InstrumentationKey": "" + } +} \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index 123f9e838..89a3b81a6 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -37,6 +37,9 @@ + + + diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index 46221b42c..011f3004f 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -30,16 +31,22 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API } public static IWebHost BuildWebHost(string[] args) => - WebHost.CreateDefaultBuilder(args) + WebHost.CreateDefaultBuilder(args) .UseStartup() .UseHealthChecks("/hc") .UseContentRoot(Directory.GetCurrentDirectory()) + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddJsonFile("settings.json"); + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); }) + .UseApplicationInsights() .Build(); } } diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index 1a32a97c4..79de89394 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -46,6 +46,14 @@ public IServiceProvider ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + // Add framework services. services.AddMvc(options => { @@ -196,6 +204,8 @@ { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) @@ -203,7 +213,7 @@ loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'"); app.UsePathBase(pathBase); } - + app.UseCors("CorsPolicy"); ConfigureAuth(app); diff --git a/src/Services/Ordering/Ordering.API/settings.json b/src/Services/Ordering/Ordering.API/settings.json index d2068fcab..f20261e31 100644 --- a/src/Services/Ordering/Ordering.API/settings.json +++ b/src/Services/Ordering/Ordering.API/settings.json @@ -13,5 +13,8 @@ "AzureServiceBusEnabled": false, "SubscriptionClientName": "Ordering", "GracePeriodTime": "1", - "CheckUpdateTime": "30000" + "CheckUpdateTime": "30000", + "ApplicationInsights": { + "InstrumentationKey": "" + } } diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index ab28a210d..465acae4c 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -8,6 +8,9 @@ + + + diff --git a/src/Services/Payment/Payment.API/Program.cs b/src/Services/Payment/Payment.API/Program.cs index a373e2695..aff7bf359 100644 --- a/src/Services/Payment/Payment.API/Program.cs +++ b/src/Services/Payment/Payment.API/Program.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using System.IO; @@ -18,11 +19,17 @@ namespace Payment.API .UseHealthChecks("/hc") .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup() + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); - }).Build(); + }) + .UseApplicationInsights() + .Build(); } } diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index 0fc94fc1d..e20b2fd76 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -32,9 +32,16 @@ namespace Payment.API // This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); services.Configure(Configuration); + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => @@ -84,8 +91,11 @@ namespace Payment.API } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) { diff --git a/src/Services/Payment/Payment.API/appsettings.json b/src/Services/Payment/Payment.API/appsettings.json index 9aef99a14..ad668a388 100644 --- a/src/Services/Payment/Payment.API/appsettings.json +++ b/src/Services/Payment/Payment.API/appsettings.json @@ -7,5 +7,8 @@ }, "PaymentSucceded": true, "AzureServiceBusEnabled": false, - "SubscriptionClientName": "Payment" + "SubscriptionClientName": "Payment", + "ApplicationInsights": { + "InstrumentationKey": "" + } } diff --git a/src/Web/WebMVC/Program.cs b/src/Web/WebMVC/Program.cs index ec711b2ae..07332a02a 100644 --- a/src/Web/WebMVC/Program.cs +++ b/src/Web/WebMVC/Program.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using System.IO; @@ -17,11 +18,17 @@ namespace Microsoft.eShopOnContainers.WebMVC .UseContentRoot(Directory.GetCurrentDirectory()) .UseHealthChecks("/hc") .UseStartup() + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); - }).Build(); + }) + .UseApplicationInsights() + .Build(); } } diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index a5b690296..509a55947 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -31,6 +31,14 @@ namespace Microsoft.eShopOnContainers.WebMVC // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + services.AddMvc(); services.AddSession(); @@ -115,6 +123,8 @@ namespace Microsoft.eShopOnContainers.WebMVC loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); if (env.IsDevelopment()) { diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index e8cdbc528..d1a957b27 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -36,6 +36,9 @@ --> + + + diff --git a/src/Web/WebMVC/appsettings.json b/src/Web/WebMVC/appsettings.json index a9a73120f..b68e719dd 100644 --- a/src/Web/WebMVC/appsettings.json +++ b/src/Web/WebMVC/appsettings.json @@ -18,5 +18,8 @@ "System": "Information", "Microsoft": "Information" } + }, + "ApplicationInsights": { + "InstrumentationKey": "" } } \ No newline at end of file diff --git a/src/Web/WebSPA/Program.cs b/src/Web/WebSPA/Program.cs index 92a6af2da..c1a7da269 100644 --- a/src/Web/WebSPA/Program.cs +++ b/src/Web/WebSPA/Program.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Hosting; using System.IO; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Configuration; namespace eShopConContainers.WebSPA { @@ -17,12 +18,17 @@ namespace eShopConContainers.WebSPA .UseStartup() .UseHealthChecks("/hc") .UseContentRoot(Directory.GetCurrentDirectory()) + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); }) + .UseApplicationInsights() .Build(); } } diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 0e9585c8c..9315088cf 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -36,6 +36,14 @@ namespace eShopConContainers.WebSPA // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + services.AddHealthChecks(checks => { var minutes = 1; @@ -76,6 +84,10 @@ namespace eShopConContainers.WebSPA // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IAntiforgery antiforgery) { + + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); diff --git a/src/Web/WebSPA/WebSPA.csproj b/src/Web/WebSPA/WebSPA.csproj index 1efcb89e6..f3fa64cdc 100644 --- a/src/Web/WebSPA/WebSPA.csproj +++ b/src/Web/WebSPA/WebSPA.csproj @@ -27,6 +27,9 @@ + + + diff --git a/src/Web/WebSPA/appsettings.json b/src/Web/WebSPA/appsettings.json index 7f8a004f8..7b1930f84 100644 --- a/src/Web/WebSPA/appsettings.json +++ b/src/Web/WebSPA/appsettings.json @@ -15,5 +15,8 @@ "System": "Information", "Microsoft": "Information" } + }, + "ApplicationInsights": { + "InstrumentationKey": "" } } \ No newline at end of file diff --git a/src/Web/WebStatus/Program.cs b/src/Web/WebStatus/Program.cs index 6a895f9e7..adab0e6b3 100644 --- a/src/Web/WebStatus/Program.cs +++ b/src/Web/WebStatus/Program.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using System.IO; @@ -16,11 +17,17 @@ namespace WebStatus WebHost.CreateDefaultBuilder(args) .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup() + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddEnvironmentVariables(); + }) .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); - }).Build(); + }) + .UseApplicationInsights() + .Build(); } } diff --git a/src/Web/WebStatus/Startup.cs b/src/Web/WebStatus/Startup.cs index acbe9edcb..f869fbb9b 100644 --- a/src/Web/WebStatus/Startup.cs +++ b/src/Web/WebStatus/Startup.cs @@ -23,6 +23,14 @@ namespace WebStatus // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + services.AddApplicationInsightsTelemetry(Configuration); + + if (Configuration.GetValue("OrchestratorType").Equals("K8S")) + { + // Enable K8s telemetry initializer + services.EnableKubernetes(); + } + services.AddOptions(); // Add framework services. @@ -49,8 +57,11 @@ namespace WebStatus } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { + loggerFactory.AddAzureWebAppDiagnostics(); + loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index 7939b146a..9a547e3fc 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -5,6 +5,9 @@ ..\..\..\docker-compose.dcproj + + + diff --git a/src/Web/WebStatus/appsettings.json b/src/Web/WebStatus/appsettings.json index e8d5a9f60..bf413fcbf 100644 --- a/src/Web/WebStatus/appsettings.json +++ b/src/Web/WebStatus/appsettings.json @@ -13,5 +13,8 @@ "IdentityUrl": "http://localhost:5105/hc", "MarketingUrl": "http://localhost:5110/hc", "LocationsUrl": "http://localhost:5109/hc", - "PaymentUrl": "http://localhost:5108/hc" + "PaymentUrl": "http://localhost:5108/hc", + "ApplicationInsights": { + "InstrumentationKey": "" + } }