diff --git a/.env b/.env index e677e97df..f77f64682 100644 --- a/.env +++ b/.env @@ -8,8 +8,8 @@ ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92 #ESHOP_AZURE_REDIS_BASKET_DB= -#ESHOP_AZURE_STORAGE_CATALOG= -#ESHOP_AZURE_STORAGE_MARKETING= +#ESHOP_AZURE_STORAGE_CATALOG_URL= +#ESHOP_AZURE_STORAGE_MARKETING_URL= #ESHOP_AZURE_SERVICE_BUS= #ESHOP_AZURE_COSMOSDB= #ESHOP_AZURE_CATALOG_DB= diff --git a/README.md b/README.md index ae28f7951..9271da0b7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.

**Note for Pull Requests**: We accept pull request from the community. When doing it, please do it onto the DEV branch which is the consolidated work-in-progress branch. Do not request it onto Master, if possible. +## Moving to .NET Core 2.0 "wave" +NOTE: During August/September 2017 we'll be moving the solution to .NET Core "wave". Not just compilation but also new recommended code in EF Core 2.0, ASP.NET Core 2.0, and other new related versions. + >**PLEASE** Read our [branch guide](./branch-guide.md) to know about our branching policy > ### DISCLAIMER diff --git a/cli-linux/build-bits-linux.sh b/cli-linux/build-bits-linux.sh index 75ace0938..21f633dbf 100755 --- a/cli-linux/build-bits-linux.sh +++ b/cli-linux/build-bits-linux.sh @@ -32,9 +32,9 @@ do pushd $path/$project rm -rf obj/Docker/publish echo -e "\e[33m\tRestoring project $project" - dotnet restore + dotnet restore --verbosity minimal echo -e "\e[33m\tBuilding and publishing $project" - dotnet publish -o obj/Docker/publish + dotnet publish -c Release -o obj/Docker/publish --verbosity minimal popd done @@ -50,4 +50,5 @@ done # No need to build the images, docker build or docker compose will # do that using the images and containers defined in the docker-compose.yml file. +# # \ No newline at end of file diff --git a/deploy/az/azurefunctions/azurefunctionsdeploy.parameters.json b/deploy/az/azurefunctions/azurefunctionsdeploy.parameters.json index 8472e9998..9ef07000d 100644 --- a/deploy/az/azurefunctions/azurefunctionsdeploy.parameters.json +++ b/deploy/az/azurefunctions/azurefunctionsdeploy.parameters.json @@ -1,5 +1,9 @@ { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": {} + "contentVersion": "1.0.0.0", + "parameters": { + "SitesEshopfunctionsName": { + "value": "eshopfunctionsapp" + } + } } \ No newline at end of file diff --git a/deploy/az/azurefunctions/readme.md b/deploy/az/azurefunctions/readme.md index 5716bf615..6ce3630b2 100644 --- a/deploy/az/azurefunctions/readme.md +++ b/deploy/az/azurefunctions/readme.md @@ -4,20 +4,22 @@ The ARM template `azurefunctionsdeploy.json` and its parameter file (`azurefunct ## Editing azurefunctionsdeploy.parameters.json file -You can edit the `azurefunctionsdeploy.parameters.parameters.json` file to set your values, but is not needed. +You can edit the `azurefunctionsdeploy.parameters.parameters.json` file to set your values, but is not needed. The only parameter that can be set is: + +1. `SitesEshopfunctionsName` is a string that is used to create the Azure function app name. ## 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 sql databases in a new resourcegroup located in westus, go to `deploy\az` folder and type: +i. e. if you are in Windows, to deploy the Azure Functions environment in a new resourcegroup located in westus, go to `deploy\az` folder and type: ``` create-resources.cmd azurefunctions\azurefunctionsdeploy newResourceGroup -c westus ``` ## Deploy Marketing azure function with Visual Studio. -Alternatively, instead of using ARM templates, you can deploy Marketing azure function directly by publishing the project Marketing-functions in eShopOnContainers-AzureFunctions.sln with Visual Studio publish tool. +You need to deploy the Marketing azure function from Visual Studio 2017 15.3 from the the Marketing-functions project in the solution eShopOnContainers-AzureFunctions.sln (Visual Studio publish tool). ## Setting Azure function configurations diff --git a/deploy/az/cosmos/readme.md b/deploy/az/cosmos/readme.md new file mode 100644 index 000000000..ae040ae95 --- /dev/null +++ b/deploy/az/cosmos/readme.md @@ -0,0 +1,31 @@ +# Deploying Azure Cosmosdb + +The ARM template `deploycosmos.json` and its parameter file (`deploycosmos.parameters.json`) are used to deploy following resources: + +1. One Cosmosdb database + +## Editing deploycosmos.parameters.json file + +You can edit the `deploycosmos.parameters.json` file to set your values, but is not needed. The only parameter that can +be set is: + +1. `name` is a string that is used to create the database name. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. + +## 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 a Cosmosdb database in a new resourcegroup located in westus, go to `deploy\az` folder and type: + +``` +create-resources.cmd cosmos\deploycosmos newResourceGroup -c westus +``` + + + + + + + + + diff --git a/deploy/az/redis/readme.md b/deploy/az/redis/readme.md index 093a9af14..61be1f6f9 100644 --- a/deploy/az/redis/readme.md +++ b/deploy/az/redis/readme.md @@ -15,7 +15,7 @@ be set is: Once parameter file is edited you can deploy it using [create-resources script](../readme.md). -i. e. if you are in windows, to deploy sql databases in a new resourcegroup located in westus, go to `deploy\az` folder and type: +i. e. if you are in windows, to deploy a Redis cache in a new Azure Resource Group located in westus, go to `deploy\az` folder and type: ``` create-resources.cmd redis\redisdeploy newResourceGroup -c westus diff --git a/deploy/az/storage/catalog/deploystorage.json b/deploy/az/storage/catalog/deploystorage.json index e3fced6b2..2e2ed1b4b 100644 --- a/deploy/az/storage/catalog/deploystorage.json +++ b/deploy/az/storage/catalog/deploystorage.json @@ -7,11 +7,14 @@ }, "profileName" : { "type": "string" + }, + "endpointName" : { + "type": "string" } }, "variables": { "catalogstorage": "[concat(parameters('catalogstorage'), uniqueString(resourceGroup().id))]", - "endpointName": "[concat('endpoint-', uniqueString(resourceGroup().id))]", + "endpointName": "[concat(parameters('endpointName'), uniqueString(resourceGroup().id))]", "profileName": "[parameters('profileName')]" }, "resources": [ diff --git a/deploy/az/storage/catalog/deploystorage.parameters.json b/deploy/az/storage/catalog/deploystorage.parameters.json index 2c5256a09..b54e546fe 100644 --- a/deploy/az/storage/catalog/deploystorage.parameters.json +++ b/deploy/az/storage/catalog/deploystorage.parameters.json @@ -7,6 +7,9 @@ }, "profileName":{ "value": "eshopcatalog" + }, + "endpointName":{ + "value": "catalog-endpoint" } } } \ No newline at end of file diff --git a/deploy/az/storage/catalog/readme.md b/deploy/az/storage/catalog/readme.md new file mode 100644 index 000000000..f3ece6fed --- /dev/null +++ b/deploy/az/storage/catalog/readme.md @@ -0,0 +1,37 @@ +# Deploying Catalog Storage + +The ARM template `deploystorage.json` and its parameter file (`deploystorage.parameters.json`) are used to deploy following resources: + +1. One Storage Account +2. One CDN profile +3. One Endpoint + +## Editing deploystorage.parameters.json file + +You can edit the `deploystorage.parameters.json` file to set your values, but is not needed. The only parameters that can +be set are: + +1. `catalogstorage` is a string that is used to create the storage account name. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. + +2. `profileName` is a string that is used to create the CDN profile name. + +3. `endpointName` is a string that is used to create the storage endpoint name. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. + +## 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 a Storage Account in a new resourcegroup located in westus, go to `deploy\az` folder and type: + +``` +create-resources.cmd catalog\deploystorage newResourceGroup -c westus +``` + + + + + + + + + diff --git a/deploy/az/storage/marketing/deploystorage.json b/deploy/az/storage/marketing/deploystorage.json index cceb524d0..632e0d09a 100644 --- a/deploy/az/storage/marketing/deploystorage.json +++ b/deploy/az/storage/marketing/deploystorage.json @@ -7,11 +7,14 @@ }, "profileName" : { "type": "string" + }, + "endpointName" : { + "type": "string" } }, "variables": { "marketingstorage": "[concat(parameters('marketingstorage'), uniqueString(resourceGroup().id))]", - "endpointName": "[concat('endpoint-', uniqueString(resourceGroup().id))]", + "endpointName": "[concat(parameters('endpointName'), uniqueString(resourceGroup().id))]", "profileName": "[parameters('profileName')]" }, "resources": [ diff --git a/deploy/az/storage/marketing/deploystorage.parameters.json b/deploy/az/storage/marketing/deploystorage.parameters.json index 1608fd34a..40f7b3a1b 100644 --- a/deploy/az/storage/marketing/deploystorage.parameters.json +++ b/deploy/az/storage/marketing/deploystorage.parameters.json @@ -7,6 +7,9 @@ }, "profileName":{ "value": "eshopmarketing" + }, + "endpointName":{ + "value": "marketing-endpoint" } } } \ No newline at end of file diff --git a/deploy/az/storage/marketing/readme.md b/deploy/az/storage/marketing/readme.md new file mode 100644 index 000000000..2b457b608 --- /dev/null +++ b/deploy/az/storage/marketing/readme.md @@ -0,0 +1,37 @@ +# Deploying Marketing Storage + +The ARM template `deploystorage.json` and its parameter file (`deploystorage.parameters.json`) are used to deploy following resources: + +1. One Storage Account +2. One CDN profile +3. One Endpoint + +## Editing deploystorage.parameters.json file + +You can edit the `deploystorage.parameters.json` file to set your values, but is not needed. The only parameters that can +be set are: + +1. `marketingstorage` is a string that is used to create the storage account name. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. + +2. `profileName` is a string that is used to create the CDN profile name. + +3. `endpointName` is a string that is used to create the storage endpoint name. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. + +## 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 a Storage account in a new resourcegroup located in westus, go to `deploy\az` folder and type: + +``` +create-resources.cmd marketing\deploystorage newResourceGroup -c westus +``` + + + + + + + + + diff --git a/deploy/readme.md b/deploy/readme.md index 7d760c6bd..27b168713 100644 --- a/deploy/readme.md +++ b/deploy/readme.md @@ -20,6 +20,10 @@ Using `docker-machine` is the recommended way to create a VM with docker install 1. [Deploying SQL Server and databases](az/sql/readme.md) 2. [Deploying Azure Service Bus](az/servicebus/readme.md) 3. [Deploying Redis Cache](az/redis/readme.md) +4. [Deploying Cosmosdb](az/cosmos/readme.md) +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) diff --git a/docker-compose-windows.override.yml b/docker-compose-windows.override.yml index 84dc5487d..4237d9c96 100644 --- a/docker-compose-windows.override.yml +++ b/docker-compose-windows.override.yml @@ -31,6 +31,7 @@ services: - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_CATALOG_KEY} - UseCustomizationData=True - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5101:80" @@ -133,6 +134,7 @@ services: - AzureStorageAccountName=${ESHOP_AZURE_STORAGE_MARKETING_NAME} - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_MARKETING_KEY} - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5110:80" @@ -140,7 +142,7 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word + - ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word} - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - AzureServiceBusEnabled=False diff --git a/docker-compose-windows.prod.yml b/docker-compose-windows.prod.yml index 57873ccfa..5dc00aa9a 100644 --- a/docker-compose-windows.prod.yml +++ b/docker-compose-windows.prod.yml @@ -21,6 +21,7 @@ services: - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} + - AzureServiceBusEnabled=False ports: - "5103:5103" @@ -29,11 +30,13 @@ services: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://0.0.0.0:80 - ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word} - - PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG} #Local: You need to open your local dev-machine firewall at range 5100-5110. + - PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG:-http://localhost:5101/api/v1/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110. - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - AzureStorageAccountName=${ESHOP_AZURE_STORAGE_CATALOG_NAME} - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_CATALOG_KEY} - UseCustomizationData=True + - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5101:80" @@ -62,6 +65,7 @@ services: - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - UseCustomizationData=True + - AzureServiceBusEnabled=False ports: - "5102:80" @@ -92,6 +96,7 @@ services: - IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. - BasketUrl=http://basket.api - MarketingUrl=http://marketing.api + - UseCustomizationData=True #Remote: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser. ports: - "5100:80" @@ -106,9 +111,11 @@ services: - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - CampaignDetailFunctionUri=${ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI} - - PicBaseUrl=${ESHOP_AZURE_STORAGE_MARKETING} + - PicBaseUrl=${ESHOP_AZURE_STORAGE_MARKETING:-http://localhost:5110/api/v1/campaigns/[0]/pic/} - AzureStorageAccountName=${ESHOP_AZURE_STORAGE_MARKETING_NAME} - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_MARKETING_KEY} + - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5110:80" @@ -116,7 +123,7 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word + - ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word} - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} sql.data: @@ -151,6 +158,7 @@ services: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://0.0.0.0:5108 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} + - AzureServiceBusEnabled=False ports: - "5108:80" @@ -163,5 +171,6 @@ services: - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} + - AzureServiceBusEnabled=False ports: - "5109:80" \ No newline at end of file diff --git a/docker-compose.ci.build.yml b/docker-compose.ci.build.yml index 2a4c88724..c755ad1c3 100644 --- a/docker-compose.ci.build.yml +++ b/docker-compose.ci.build.yml @@ -11,7 +11,7 @@ services: # Next line is using the .sln file to compile all the projects. # Sometime there is an issue in msbuild exits the process before finishing building the bits: (https://github.com/Microsoft/msbuild/issues/2153) # Random error: error MSB4017: The build stopped unexpectedly be cause of an unexpected logger failure. - #command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && popd && dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish" + #command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && popd && dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln --verbosity minimal && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish --verbosity minimal" # NOTE: Using build-bits-linux.sh from Linux build container exits before ending. command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && popd && pushd /cli-linux && ./build-bits-linux.sh /src" diff --git a/docker-compose.dcproj b/docker-compose.dcproj index 92590035d..23547b577 100644 --- a/docker-compose.dcproj +++ b/docker-compose.dcproj @@ -15,12 +15,6 @@ docker-compose.yml - - - docker-compose.yml - - - docker-compose.yml diff --git a/docker-compose.override.yml b/docker-compose.override.yml index f3576eb87..1a0129ac3 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -25,12 +25,13 @@ services: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:80 - ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word} - - PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG:-http://localhost:5101/api/v1/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110. + - PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5101/api/v1/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110. - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - AzureStorageAccountName=${ESHOP_AZURE_STORAGE_CATALOG_NAME} - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_CATALOG_KEY} - UseCustomizationData=True - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5101:80" @@ -74,10 +75,11 @@ services: - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. - IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 - CampaignDetailFunctionUri=${ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI} - - PicBaseUrl=${ESHOP_AZURE_STORAGE_MARKETING:-http://localhost:5110/api/v1/campaigns/[0]/pic/} + - PicBaseUrl=${ESHOP_AZURE_STORAGE_MARKETING_URL:-http://localhost:5110/api/v1/campaigns/[0]/pic/} - AzureStorageAccountName=${ESHOP_AZURE_STORAGE_MARKETING_NAME} - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_MARKETING_KEY} - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5110:80" @@ -85,7 +87,7 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word + - ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word} - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - AzureServiceBusEnabled=False @@ -121,17 +123,6 @@ services: ports: - "5100:80" - sql.data: - environment: - - SA_PASSWORD=Pass@word - - ACCEPT_EULA=Y - ports: - - "5433:1433" - - nosql.data: - ports: - - "27017:27017" - webstatus: environment: - ASPNETCORE_ENVIRONMENT=Development @@ -168,3 +159,14 @@ services: - AzureServiceBusEnabled=False ports: - "5109:80" + + sql.data: + environment: + - SA_PASSWORD=Pass@word + - ACCEPT_EULA=Y + ports: + - "5433:1433" + + nosql.data: + ports: + - "27017:27017" diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 3b5ff6779..cb53a1d00 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -21,6 +21,7 @@ services: - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} + - AzureServiceBusEnabled=False ports: - "5103:80" @@ -29,11 +30,13 @@ services: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://0.0.0.0:80 - ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word} - - PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG} #Local: You need to open your local dev-machine firewall at range 5100-5110. + - PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5101/api/v1/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110. - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - AzureStorageAccountName=${ESHOP_AZURE_STORAGE_CATALOG_NAME} - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_CATALOG_KEY} - UseCustomizationData=True + - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5101:80" @@ -62,6 +65,7 @@ services: - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - UseCustomizationData=True + - AzureServiceBusEnabled=False ports: - "5102:80" @@ -73,12 +77,14 @@ services: - MongoConnectionString=${ESHOP_AZURE_COSMOSDB:-mongodb://nosql.data} - MongoDatabase=MarketingDb - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. + - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - CampaignDetailFunctionUri=${ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI} - - PicBaseUrl=${ESHOP_AZURE_STORAGE_MARKETING} + - PicBaseUrl=${ESHOP_AZURE_STORAGE_MARKETING_URL:-http://localhost:5110/api/v1/campaigns/[0]/pic/} - AzureStorageAccountName=${ESHOP_AZURE_STORAGE_MARKETING_NAME} - AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_MARKETING_KEY} + - AzureServiceBusEnabled=False + - AzureStorageEnabled=False ports: - "5110:80" @@ -86,8 +92,9 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word + - ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word} - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} + - AzureServiceBusEnabled=False webspa: environment: @@ -113,9 +120,11 @@ services: - ASPNETCORE_URLS=http://0.0.0.0:80 - CatalogUrl=http://catalog.api - OrderingUrl=http://ordering.api - - IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. - BasketUrl=http://basket.api - - MarketingUrl=http://marketing.api + - IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. + - MarketingUrl=http://marketing.api #Local: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. + #Remote: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser. + - UseCustomizationData=True ports: - "5100:80" @@ -151,6 +160,7 @@ services: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://0.0.0.0:5108 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} + - AzureServiceBusEnabled=False ports: - "5108:80" @@ -163,5 +173,6 @@ services: - identityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110. - IdentityUrlExternal=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} + - AzureServiceBusEnabled=False ports: - "5109:80" \ No newline at end of file diff --git a/docker-compose.vs.debug.yml b/docker-compose.vs.debug.yml deleted file mode 100644 index 9c4879f61..000000000 --- a/docker-compose.vs.debug.yml +++ /dev/null @@ -1,166 +0,0 @@ -version: '2.1' - -services: - basket.api: - image: eshop/basket.api:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Services/Basket/Basket.API:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - catalog.api: - image: eshop/catalog.api:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Services/Catalog/Catalog.API:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - identity.api: - image: eshop/identity.api:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Services/Identity/Identity.API:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - ordering.api: - image: eshop/ordering.api:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Services/Ordering/Ordering.API:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - marketing.api: - image: eshop/marketing.api:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Services/Marketing/Marketing.API:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - - webspa: - image: eshop/webspa:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Web/WebSPA:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - webmvc: - image: eshop/webmvc:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Web/WebMVC:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - webstatus: - image: eshop/webstatus:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Web/WebStatus:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - payment.api: - image: eshop/payment.api:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Services/Payment/Payment.API:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - graceperiodmanager: - image: eshop/graceperiodmanager:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ./src/Services/GracePeriod/GracePeriodManager:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - locations.api: - image: eshop/locations.api:dev - build: - args: - source: ${DOCKER_BUILD_SOURCE} - environment: - - DOTNET_USE_POLLING_FILE_WATCHER=1 - volumes: - - ./src/Services/Location/Locations.API:/app - - ~/.nuget/packages:/root/.nuget/packages:ro - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" diff --git a/docker-compose.vs.release.yml b/docker-compose.vs.release.yml deleted file mode 100644 index 92be2557b..000000000 --- a/docker-compose.vs.release.yml +++ /dev/null @@ -1,112 +0,0 @@ -version: '2.1' - -services: - basket.api: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - catalog.api: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - identity.api: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - ordering.api: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - marketing.api: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - webspa: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - webmvc: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - webstatus: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - payment.api: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - graceperiodmanager: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" - - locations.api: - build: - args: - source: ${DOCKER_BUILD_SOURCE} - volumes: - - ~/clrdbg:/clrdbg:ro - entrypoint: tail -f /dev/null - labels: - - "com.microsoft.visualstudio.targetoperatingsystem=linux" diff --git a/docker-compose.yml b/docker-compose.yml index 3d60489b5..86931228e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,8 +64,11 @@ services: context: ./src/Web/WebSPA dockerfile: Dockerfile depends_on: + - catalog.api + - ordering.api - identity.api - basket.api + - marketing.api webmvc: image: eshop/webmvc:${TAG:-latest} @@ -79,22 +82,6 @@ services: - basket.api - marketing.api - sql.data: - image: microsoft/mssql-server-linux - - nosql.data: - image: mongo - - basket.data: - image: redis - ports: - - "6379:6379" - - rabbitmq: - image: rabbitmq - ports: - - "5672:5672" - webstatus: image: eshop/webstatus:${TAG:-latest} build: @@ -117,3 +104,20 @@ services: depends_on: - nosql.data - rabbitmq + + sql.data: + image: microsoft/mssql-server-linux + + nosql.data: + image: mongo + + basket.data: + image: redis + ports: + - "6379:6379" + + rabbitmq: + image: rabbitmq:3-management + ports: + - "15672:15672" + - "5672:5672" \ No newline at end of file diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs index 50f588ac3..1458b7198 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs @@ -1,18 +1,17 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus { - using System; + using Autofac; + using Microsoft.Azure.ServiceBus; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using Microsoft.Extensions.Logging; - using Microsoft.Azure.ServiceBus; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; + using System.Reflection; using System.Text; using System.Threading.Tasks; - using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; - using System.Reflection; - using Microsoft.Azure.ServiceBus.Filters; - using Autofac; - using Newtonsoft.Json.Linq; public class EventBusServiceBus : IEventBus { @@ -129,11 +128,25 @@ _subscriptionClient.RegisterMessageHandler( async (message, token) => { - var eventName = message.Label; + var eventName = $"{message.Label}{INTEGRATION_EVENT_SUFIX}"; var messageData = Encoding.UTF8.GetString(message.Body); await ProcessEvent(eventName, messageData); + + // Complete the message so that it is not received again. + await _subscriptionClient.CompleteAsync(message.SystemProperties.LockToken); }, - new MessageHandlerOptions() { MaxConcurrentCalls = 10, AutoComplete = true }); + new MessageHandlerOptions(ExceptionReceivedHandler) { MaxConcurrentCalls = 10, AutoComplete = false }); + } + + private Task ExceptionReceivedHandler(ExceptionReceivedEventArgs exceptionReceivedEventArgs) + { + Console.WriteLine($"Message handler encountered an exception {exceptionReceivedEventArgs.Exception}."); + var context = exceptionReceivedEventArgs.ExceptionReceivedContext; + Console.WriteLine("Exception context for troubleshooting:"); + Console.WriteLine($"- Endpoint: {context.Endpoint}"); + Console.WriteLine($"- Entity Path: {context.EntityPath}"); + Console.WriteLine($"- Executing Action: {context.Action}"); + return Task.CompletedTask; } private async Task ProcessEvent(string eventName, string message) @@ -169,13 +182,13 @@ try { _subscriptionClient - .RemoveRuleAsync(SubscriptionClient.DefaultRule) + .RemoveRuleAsync(RuleDescription.DefaultRuleName) .GetAwaiter() .GetResult(); } catch (MessagingEntityNotFoundException) { - _logger.LogInformation($"The messaging entity {SubscriptionClient.DefaultRule} Could not be found."); + _logger.LogInformation($"The messaging entity { RuleDescription.DefaultRuleName } Could not be found."); } } } diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj index 5be30800e..b0d6f0cc2 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/AzureHealthCheckBuilderExtensions.cs b/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/AzureHealthCheckBuilderExtensions.cs index 4c917f223..5a06a3ba2 100644 --- a/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/AzureHealthCheckBuilderExtensions.cs +++ b/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/AzureHealthCheckBuilderExtensions.cs @@ -70,7 +70,7 @@ namespace Microsoft.Extensions.HealthChecks var properties = await tableClient.GetServicePropertiesAsync().ConfigureAwait(false); - if (String.IsNullOrWhiteSpace(tableName)) + if (!String.IsNullOrWhiteSpace(tableName)) { var table = tableClient.GetTableReference(tableName); @@ -150,7 +150,7 @@ namespace Microsoft.Extensions.HealthChecks var properties = await queueClient.GetServicePropertiesAsync().ConfigureAwait(false); - if (String.IsNullOrWhiteSpace(queueName)) + if (!String.IsNullOrWhiteSpace(queueName)) { var queue = queueClient.GetQueueReference(queueName); diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml index b86ae54c8..79b0ff307 100644 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml +++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml @@ -1,12 +1,11 @@ - + #ffffff @@ -18,6 +17,69 @@ #00857D #e2e2e2 #ff5252 + #757575 + #FFFFFF + #979797 + #007aff + #CCCCCC + #C9C9C9 + Transparent + Transparent + #007aff + #FFFFFF + #007aff + Transparent + #FFFFFF + #1FAECE + Transparent + Transparent + + + + + + + + + + + + + + + + + - + + + + + + @@ -108,7 +187,7 @@ - + + + + + + + + + + + + + + + + +