Added TSI launch settings and other improvements

This commit is contained in:
sushilraje 2018-10-05 11:53:47 -07:00 коммит произвёл GitHub
Родитель 1948fd275e
Коммит 1da2a36054
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 116 добавлений и 62 удалений

Просмотреть файл

@ -16,8 +16,10 @@ run_container() {
echo "Starting Device Simulation ..."
docker run -it -p 9003:9003 \
--network host \
-e PCS_IOTHUB_CONNSTRING \
-e PCS_STORAGEADAPTER_WEBSERVICE_URL \
-e PCS_SUBSCRIPTION_ID \
"$DOCKER_IMAGE:testing"
}

Просмотреть файл

@ -21,8 +21,10 @@ IF %ERRORLEVEL% NEQ 0 GOTO FAIL
:: Start the application
echo Starting Device Simulation ...
docker run -it -p 9003:9003 ^
--network host ^
-e PCS_IOTHUB_CONNSTRING ^
-e PCS_STORAGEADAPTER_WEBSERVICE_URL ^
-e PCS_SUBSCRIPTION_ID ^
%DOCKER_IMAGE%:testing
:: - - - - - - - - - - - - - -

Просмотреть файл

@ -5,8 +5,7 @@ Starting Microservices on local environment
1) Run the [start.cmd or start.sh](https://github.com/Azure/remote-monitoring-services-dotnet/blob/master/scripts/local/launch/) script (depending on your OS) located under launch *(scripts/local/launch)* folder.
2) Run the following script to set environment variables. The script is located under *(scripts/local/launch/os)* folder.\
i. [set-env-uri.cmd or set-env-uri.sh](https://github.com/Azure/remote-monitoring-services-dotnet/tree/master/scripts/local/launch/os)\
![start](https://user-images.githubusercontent.com/39531904/44435771-6ab08280-a566-11e8-93c9-e6f35e5df247.PNG)
![start_new](https://user-images.githubusercontent.com/39531904/46452369-514b4a80-c750-11e8-8fab-6b6351d98f2b.PNG)
**Please Note:**
1) *If you have cloned azure-iot-pcs-remote-monitoring-dotnet repository, the scripts folder is present under services submodule (folder).*
2) *The start script requires **Node.js** to execute, please install latest stable Node 8 (donot use Node 10) before using this script. Also, this script might require administartive privileges or sudo permission as it tries to install [pcs-cli](https://github.com/Azure/pcs-cli) a cli interface for remote-monitoring deployments.*
@ -18,7 +17,9 @@ For users who have already created the required azure resources, please do one o
2) **VS Code:** Set the environment variables in the launch configurations of the IDE i.e. launch.json
3) **Visual Studio:** Set the environment variables for WebService project of the microservices by adding it to Properties → Debug → Environment variables
*Although not recommended, environment variables can also be set in appsettings.ini file present under WebService folder for each of the microservices.*
**Please Note:**
1) *Although not recommended, environment variables can also be set in appsettings.ini file present under WebService folder for each of the microservices.*
2) *Build tasks depend upon env variables. If env variables are being set in IDE configurations OR in appsettings file, the tasks may not work. You will have to build services separately by settings env variables.*
### Walk through for importing new Solution into the IDE
##### VS Code

Просмотреть файл

@ -4,11 +4,17 @@
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"env": {
// Note: Any setting made in this file will override the operating system environment variable of that name.
// See https://docs.microsoft.com/aspnet/core/fundamentals/environments
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Development",
"PCS_APPLICATION_SECRET": "${env:PCS_APPLICATION_SECRET}",
"PCS_AUTH_ISSUER": "${env:PCS_AUTH_ISSUER}",
"PCS_AUTH_AUDIENCE": "${env:PCS_AUTH_AUDIENCE}",
"PCS_AUTH_REQUIRED": "${env:PCS_AUTH_REQUIRED}",
"PCS_CORS_WHITELIST": "${env:PCS_CORS_WHITELIST}"
// Environment variables used in appsettings.ini.
// Optional Settings. For additonal optional settings, refer to appsettings.ini directly.
},
@ -32,10 +38,10 @@
},
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "source-env",
"program": "${workspaceRoot}/auth/WebService/bin/Debug/netcoreapp2.0/Microsoft.Azure.IoTSolutions.Auth.WebService.dll",
//"preLaunchTask": "build-auth",
"program": "${workspaceRoot}/auth/WebService/bin/Release/netcoreapp2.0/Microsoft.Azure.IoTSolutions.Auth.WebService.dll",
"args": [],
"cwd": "${workspaceRoot}/auth/WebService/bin/Debug/netcoreapp2.0",
"cwd": "${workspaceRoot}/auth/WebService/bin/Release/netcoreapp2.0",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart"
@ -47,6 +53,7 @@
"ASPNETCORE_ENVIRONMENT": "Development",
// Environment variables used in appsettings.ini.
// Required Settings.
"PCS_TELEMETRY_STORAGE_TYPE": "${env:PCS_TELEMETRY_STORAGE_TYPE}",
"PCS_TELEMETRY_DOCUMENTDB_CONNSTRING": "${env:PCS_TELEMETRY_DOCUMENTDB_CONNSTRING}",
"PCS_TELEMETRY_WEBSERVICE_URL": "http://localhost:9004/v1",
"PCS_CONFIG_WEBSERVICE_URL": "http://localhost:9005/v1",
@ -56,6 +63,11 @@
"PCS_ASA_DATA_AZUREBLOB_ENDPOINT_SUFFIX": "${env:PCS_ASA_DATA_AZUREBLOB_ENDPOINT_SUFFIX}",
"PCS_EVENTHUB_CONNSTRING": "${env:PCS_EVENTHUB_CONNSTRING}",
"PCS_EVENTHUB_NAME": "${env:PCS_EVENTHUB_NAME}",
"PCS_APPLICATION_SECRET": "${env:PCS_APPLICATION_SECRET}",
"PCS_AUTH_ISSUER": "${env:PCS_AUTH_ISSUER}",
"PCS_AUTH_AUDIENCE": "${env:PCS_AUTH_AUDIENCE}",
"PCS_AUTH_REQUIRED": "${env:PCS_AUTH_REQUIRED}",
"PCS_CORS_WHITELIST": "${env:PCS_CORS_WHITELIST}",
// Optional Settings. For additonal optional settings, refer to appsettings.ini directly.
"PCS_LOG_LEVEL": "Debug"
},
@ -79,10 +91,10 @@
},
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "source-env",
"program": "${workspaceRoot}/asa-manager/WebService/bin/Debug/netcoreapp2.0/Microsoft.Azure.IoTSolutions.AsaManager.WebService.dll",
//"preLaunchTask": "build-asamanager",
"program": "${workspaceRoot}/asa-manager/WebService/bin/Release/netcoreapp2.0/Microsoft.Azure.IoTSolutions.AsaManager.WebService.dll",
"args": [],
"cwd": "${workspaceRoot}/asa-manager/WebService/bin/Debug/netcoreapp2.0",
"cwd": "${workspaceRoot}/asa-manager/WebService/bin/Release/netcoreapp2.0",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart"
@ -95,8 +107,19 @@
// Environment variables used in appsettings.ini.
// Required Settings.
"PCS_TELEMETRY_DOCUMENTDB_CONNSTRING": "${env:PCS_TELEMETRY_DOCUMENTDB_CONNSTRING}",
"PCS_STORAGEADAPTER_WEBSERVICE_URL": "http://localhost:9022/v1/",
"PCS_AUTH_WEBSERVICE_URL": "http://localhost:9001/v1/",
"PCS_STORAGEADAPTER_WEBSERVICE_URL": "http://localhost:9022/v1",
"PCS_AUTH_WEBSERVICE_URL": "http://localhost:9001/v1",
"PCS_DIAGNOSTICS_WEBSERVICE_URL": "",
"PCS_TSI_FQDN": "${env:PCS_TSI_FQDN}",
"PCS_TELEMETRY_STORAGE_TYPE": "${env:PCS_TELEMETRY_STORAGE_TYPE}",
"PCS_AAD_TENANT": "${env:PCS_AAD_TENANT}",
"PCS_AAD_APPID": "${env:PCS_AAD_APPID}",
"PCS_AAD_APPSECRET": "${env:PCS_AAD_APPSECRET}",
"PCS_AUTH_REQUIRED": "${env:PCS_AUTH_REQUIRED}",
"PCS_APPLICATION_SECRET": "${env:PCS_APPLICATION_SECRET}",
"PCS_AUTH_ISSUER": "${env:PCS_AUTH_ISSUER}",
"PCS_AUTH_AUDIENCE": "${env:PCS_AUTH_AUDIENCE}",
"PCS_CORS_WHITELIST": "${env:PCS_CORS_WHITELIST}",
// Optional Settings. For additonal optional settings, refer to appsettings.ini directly.
"PCS_LOG_LEVEL": "Debug"
},
@ -120,10 +143,10 @@
},
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "source-env",
"program": "${workspaceRoot}/device-telemetry/WebService/bin/Debug/netcoreapp2.0/Microsoft.Azure.IoTSolutions.DeviceTelemetry.WebService.dll",
//"preLaunchTask": "build-telemetry",
"program": "${workspaceRoot}/device-telemetry/WebService/bin/Release/netcoreapp2.0/Microsoft.Azure.IoTSolutions.DeviceTelemetry.WebService.dll",
"args": [],
"cwd": "${workspaceRoot}/device-telemetry/WebService/bin/Debug/netcoreapp2.0",
"cwd": "${workspaceRoot}/device-telemetry/WebService/bin/Release/netcoreapp2.0",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart"
@ -136,8 +159,13 @@
// Environment variables used in appsettings.ini.
// Required Settings.
"PCS_IOTHUB_CONNSTRING": "${env:PCS_IOTHUB_CONNSTRING}",
"PCS_STORAGEADAPTER_WEBSERVICE_URL": "http://localhost:9022/v1/",
"PCS_AUTH_WEBSERVICE_URL": "http://localhost:9001/v1/",
"PCS_STORAGEADAPTER_WEBSERVICE_URL": "http://localhost:9022/v1",
"PCS_AUTH_WEBSERVICE_URL": "http://localhost:9001/v1",
"PCS_APPLICATION_SECRET": "${env:PCS_APPLICATION_SECRET}",
"PCS_AUTH_ISSUER": "${env:PCS_AUTH_ISSUER}",
"PCS_AUTH_AUDIENCE": "${env:PCS_AUTH_AUDIENCE}",
"PCS_AUTH_REQUIRED": "${env:PCS_AUTH_REQUIRED}",
"PCS_CORS_WHITELIST": "${env:PCS_CORS_WHITELIST}",
// Optional Settings. For additonal optional settings, refer to appsettings.ini directly.
"PCS_LOG_LEVEL": "Debug"
},
@ -161,10 +189,10 @@
},
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "source-env",
"program": "${workspaceRoot}/iothub-manager/WebService/bin/Debug/netcoreapp2.0/Microsoft.Azure.IoTSolutions.IotHubManager.WebService.dll",
//"preLaunchTask": "build-iothubmanager",
"program": "${workspaceRoot}/iothub-manager/WebService/bin/Release/netcoreapp2.0/Microsoft.Azure.IoTSolutions.IotHubManager.WebService.dll",
"args": [],
"cwd": "${workspaceRoot}/iothub-manager/WebService/bin/Debug/netcoreapp2.0",
"cwd": "${workspaceRoot}/iothub-manager/WebService/bin/Release/netcoreapp2.0",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart"
@ -178,14 +206,22 @@
// Required Settings.
"PCS_AZUREMAPS_KEY": "${env:PCS_AZUREMAPS_KEY}",
"PCS_DEVICESIMULATION_WEBSERVICE_URL": "http://localhost:9003/v1",
"PCS_STORAGEADAPTER_WEBSERVICE_URL": "http://localhost:9022/v1/",
"PCS_STORAGEADAPTER_WEBSERVICE_URL": "http://localhost:9022/v1",
"PCS_TELEMETRY_WEBSERVICE_URL": "http://telemetry:9004/v1",
"PCS_AUTH_REQUIRED": "${env:PCS_AUTH_REQUIRED}",
"PCS_SEED_TEMPLATE": "default",
"PCS_SOLUTION_TYPE": "remotemonitoring",
"PCS_APPLICATION_SECRET": "${env:PCS_APPLICATION_SECRET}",
// Optional Settings. For additonal optional settings, refer to appsettings.ini directly.
"PCS_AUTH_WEBSERVICE_URL": "http://localhost:9001/v1/",
"PCS_AUTH_WEBSERVICE_URL": "http://localhost:9001/v1",
"PCS_AUTH_ISSUER": "${env:PCS_AUTH_ISSUER}",
"PCS_AUTH_AUDIENCE": "${env:PCS_AUTH_AUDIENCE}",
"PCS_CORS_WHITELIST": "${env:PCS_CORS_WHITELIST}"
},
"stopAtEntry": false,
"justMyCode": false,
"enableStepFiltering": true,
"name": "UIConfig",
"name": "Config",
"launchBrowser": {
"enabled": false,
"args": "${auto-detect-url}",
@ -202,11 +238,10 @@
},
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "source-env",
"preLaunchTask":"device-simulation-launch" ,
"program": "${workspaceRoot}/config/WebService/bin/Debug/netcoreapp2.0/Microsoft.Azure.IoTSolutions.UIConfig.WebService.dll",
"program": "${workspaceRoot}/config/WebService/bin/Release/netcoreapp2.0/Microsoft.Azure.IoTSolutions.UIConfig.WebService.dll",
"args": [],
"cwd": "${workspaceRoot}/config/WebService/bin/Debug/netcoreapp2.0",
"cwd": "${workspaceRoot}/config/WebService/bin/Release/netcoreapp2.0",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart"
@ -222,6 +257,11 @@
// Required Settings.
"PCS_STORAGEADAPTER_DOCUMENTDB_CONNSTRING": "${env:PCS_STORAGEADAPTER_DOCUMENTDB_CONNSTRING}",
// Optional Settings. For additonal optional settings, refer to appsettings.ini directly.
"PCS_APPLICATION_SECRET": "${env:PCS_APPLICATION_SECRET}",
"PCS_AUTH_ISSUER": "${env:PCS_AUTH_ISSUER}",
"PCS_AUTH_AUDIENCE": "${env:PCS_AUTH_AUDIENCE}",
"PCS_AUTH_REQUIRED": "${env:PCS_AUTH_REQUIRED}",
"PCS_CORS_WHITELIST": "${env:PCS_CORS_WHITELIST}"
},
"stopAtEntry": false,
"justMyCode": false,
@ -243,10 +283,10 @@
},
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "source-env",
"program": "${workspaceRoot}/storage-adapter/WebService/bin/Debug/netcoreapp2.0/Microsoft.Azure.IoTSolutions.StorageAdapter.WebService.dll",
//"preLaunchTask": "build-storageadapter",
"program": "${workspaceRoot}/storage-adapter/WebService/bin/Release/netcoreapp2.0/Microsoft.Azure.IoTSolutions.StorageAdapter.WebService.dll",
"args": [],
"cwd": "${workspaceRoot}/storage-adapter/WebService/bin/Debug/netcoreapp2.0",
"cwd": "${workspaceRoot}/storage-adapter/WebService/bin/Release/netcoreapp2.0",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart"
@ -255,8 +295,9 @@
"compounds": [
{
"name": "Run All microservices",
"configurations": ["StorageAdapter", "UIConfig", "IotHubManager", "DeviceTelemetry", "AsaManager", "Auth", "devicesimulation"],
"configurations": ["StorageAdapter", "Config", "IotHubManager", "DeviceTelemetry", "AsaManager", "Auth"]
}
]
}

Просмотреть файл

@ -4,7 +4,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "build-asa-manager",
"label": "build-asamanager",
"command": "${workspaceFolder}/asa-manager/scripts/build",
"windows": {
"command": "${workspaceFolder}\\asa-manager\\scripts\\build.cmd"
@ -14,10 +14,7 @@
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile",
//"dependsOn":[
// "source-env"
//]
"problemMatcher": "$msCompile"
},
{
"label": "build-telemetry",
@ -31,15 +28,18 @@
"reveal": "silent"
},
"problemMatcher": "$msCompile",
//"dependsOn":[
// "source-env"
//]
"options": {
"env": {
"PCS_AUTH_ISSUER": "fake",
"PCS_AUTH_AUDIENCE": "fake"
}
}
},
{
"label": "build-iothub-manager",
"label": "build-iothubmanager",
"command": "${workspaceFolder}/iothub-manager/scripts/build",
"windows": {
"command": "${workspaceFolder}\\iothub-manager\\scripts/build.cmd"
"command": "${workspaceFolder}\\iothub-manager\\scripts\\build.cmd"
},
"type": "shell",
"group": "build",
@ -47,9 +47,12 @@
"reveal": "silent"
},
"problemMatcher": "$msCompile",
//"dependsOn":[
// "source-env"
//]
"options": {
"env": {
"PCS_AUTH_ISSUER": "fake",
"PCS_AUTH_AUDIENCE": "fake"
}
}
},
{
"label": "build-auth",
@ -62,10 +65,7 @@
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile",
//"dependsOn":[
// "source-env"
//]
"problemMatcher": "$msCompile"
},
{
"label": "build-config",
@ -78,13 +78,10 @@
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile",
//"dependsOn":[
// "source-env"
//]
"problemMatcher": "$msCompile"
},
{
"label": "build-storage-adapter",
"label": "build-storageadapter",
"command": "${workspaceFolder}/storage-adapter/scripts/build",
"windows": {
"command": "${workspaceFolder}\\storage-adapter\\scripts\\build.cmd"
@ -92,27 +89,38 @@
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent",
"reveal": "silent"
},
"problemMatcher": "$msCompile",
//"dependsOn":[
// "source-env"
//]
"problemMatcher": "$msCompile"
},
{
"label": "device-simulation-launch",
"command": "${workspaceFolder}/scripts/local/launch/start_device_simulation.sh",
"command": "${workspaceFolder}/scripts/local/launch/start-device-simulation.sh",
"windows": {
//Separate file for windows
"command": "${workspaceFolder}\\scripts\\local\\launch\\start_device_simulation.cmd"
"command": "${workspaceFolder}\\scripts\\local\\launch\\start-device-simulation.cmd"
},
"type": "shell",
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "build",
"dependsOn": ["build-storage-adapter", "build-config", "build-auth", "build-iothub-manager", "build-telemetry", "build-asa-manager"]
"label": "Build All",
"dependsOn": [
"build-storage-adapter",
"build-config",
"build-auth",
"build-iothub-manager",
"build-telemetry",
"build-asa-manager"
],
"problemMatcher": []
},
{
"label": "build-config-start-simulation",
"dependsOn": [
"device-simulation-launch",
"build-config"
]
}
]
}