Browse Source

Merge branch 'dev' into feature/enable-telemetry

pull/1663/head
Sumit Ghosh 3 years ago
parent
commit
8099d273d9
345 changed files with 60515 additions and 11963 deletions
  1. +50
    -0
      .github/workflows/basket-api-deploy.yml
  2. +35
    -1
      .github/workflows/basket-api.yml
  3. +50
    -0
      .github/workflows/catalog-api-deploy.yml
  4. +34
    -0
      .github/workflows/catalog-api.yml
  5. +50
    -0
      .github/workflows/identity-api-deploy.yml
  6. +50
    -0
      .github/workflows/mobileshoppingagg-deploy.yml
  7. +50
    -0
      .github/workflows/ordering-api-deploy.yml
  8. +34
    -0
      .github/workflows/ordering-api.yml
  9. +50
    -0
      .github/workflows/ordering-backgroundtasks-deploy.yml
  10. +50
    -0
      .github/workflows/ordering-signalrhub-deploy.yml
  11. +50
    -0
      .github/workflows/payment-api-deploy.yml
  12. +50
    -0
      .github/workflows/webhooks-api-deploy.yml
  13. +50
    -0
      .github/workflows/webmvc-deploy.yml
  14. +50
    -0
      .github/workflows/webshoppingagg-deploy.yml
  15. +50
    -0
      .github/workflows/webspa-deploy.yml
  16. +50
    -0
      .github/workflows/webstatus-deploy.yml
  17. +6
    -0
      README.md
  18. +199
    -0
      deploy/k8s/helm/deploy-chart.sh
  19. +2
    -2
      deploy/windows/add-firewall-rules-for-sts-auth-thru-docker.ps1
  20. BIN
      img/eshop-spa-app-home.png
  21. BIN
      img/eshop-webmvc-app-screenshot.png
  22. +1
    -1
      src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml
  23. +2
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
  24. +1
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop
  25. +0
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
  26. +6
    -3
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderApiClient.cs
  27. +1
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
  28. +2
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
  29. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop
  30. +6
    -3
      src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderApiClient.cs
  31. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
  32. +0
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
  33. +7
    -4
      src/BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj
  34. +1
    -1
      src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationEvent.cs
  35. +1
    -2
      src/BuildingBlocks/EventBus/EventBus/EventBus.csproj
  36. +5
    -5
      src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs
  37. +12
    -15
      src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs
  38. +1
    -2
      src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj
  39. +6
    -6
      src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs
  40. +1
    -2
      src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj
  41. +8
    -5
      src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs
  42. +2
    -2
      src/Services/Basket/Basket.API/Basket.API.csproj
  43. +2
    -1
      src/Services/Basket/Basket.API/Dockerfile
  44. +1
    -1
      src/Services/Basket/Basket.API/Dockerfile.develop
  45. +6
    -3
      src/Services/Basket/Basket.API/Infrastructure/Repositories/RedisBasketRepository.cs
  46. +6
    -3
      src/Services/Basket/Basket.API/Program.cs
  47. +1
    -1
      src/Services/Basket/Basket.API/Startup.cs
  48. +3
    -3
      src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs
  49. +2
    -1
      src/Services/Catalog/Catalog.API/Dockerfile
  50. +1
    -1
      src/Services/Catalog/Catalog.API/Dockerfile.develop
  51. BIN
      src/Services/Catalog/Catalog.API/Pics/1.png
  52. BIN
      src/Services/Catalog/Catalog.API/Pics/10.png
  53. BIN
      src/Services/Catalog/Catalog.API/Pics/11.png
  54. BIN
      src/Services/Catalog/Catalog.API/Pics/12.png
  55. BIN
      src/Services/Catalog/Catalog.API/Pics/13.png
  56. BIN
      src/Services/Catalog/Catalog.API/Pics/14.png
  57. BIN
      src/Services/Catalog/Catalog.API/Pics/2.png
  58. BIN
      src/Services/Catalog/Catalog.API/Pics/3.png
  59. BIN
      src/Services/Catalog/Catalog.API/Pics/4.png
  60. BIN
      src/Services/Catalog/Catalog.API/Pics/5.png
  61. BIN
      src/Services/Catalog/Catalog.API/Pics/6.png
  62. BIN
      src/Services/Catalog/Catalog.API/Pics/7.png
  63. BIN
      src/Services/Catalog/Catalog.API/Pics/8.png
  64. BIN
      src/Services/Catalog/Catalog.API/Pics/9.png
  65. +5
    -2
      src/Services/Catalog/Catalog.API/Program.cs
  66. +0
    -5
      src/Services/Catalog/Catalog.API/Setup/CatalogBrands.csv
  67. BIN
      src/Services/Catalog/Catalog.API/Setup/CatalogItems-MVC.zip
  68. BIN
      src/Services/Catalog/Catalog.API/Setup/CatalogItems-SPA.zip
  69. +5
    -4
      src/Services/Catalog/Catalog.API/Setup/CatalogItems.csv
  70. BIN
      src/Services/Catalog/Catalog.API/Setup/CatalogItems.zip
  71. +1
    -4
      src/Services/Catalog/Catalog.API/Setup/CatalogTypes.csv
  72. +10
    -0
      src/Services/Catalog/Catalog.API/Setup/README.md
  73. +2
    -1
      src/Services/Catalog/Catalog.API/Startup.cs
  74. +2
    -1
      src/Services/Identity/Identity.API/Dockerfile
  75. +1
    -1
      src/Services/Identity/Identity.API/Dockerfile.develop
  76. +0
    -4
      src/Services/Identity/Identity.API/Identity.API.csproj
  77. +5
    -2
      src/Services/Identity/Identity.API/Program.cs
  78. +19
    -53
      src/Services/Identity/Identity.API/Views/Account/Login.cshtml
  79. +21
    -99
      src/Services/Identity/Identity.API/Views/Account/Register.cshtml
  80. +54
    -0
      src/Services/Identity/Identity.API/Views/Account/_LoginPartial-MVC.cshtml
  81. +47
    -0
      src/Services/Identity/Identity.API/Views/Account/_LoginPartial-SPA.cshtml
  82. +100
    -0
      src/Services/Identity/Identity.API/Views/Account/_RegisterPartial-MVC.cshtml
  83. +100
    -0
      src/Services/Identity/Identity.API/Views/Account/_RegisterPartial-SPA.cshtml
  84. +54
    -0
      src/Services/Identity/Identity.API/Views/Shared/_Layout-SPA.cshtml
  85. +1062
    -0
      src/Services/Identity/Identity.API/wwwroot/css/site-spa.css
  86. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.eot
  87. +3184
    -0
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.svg
  88. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.ttf
  89. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.woff
  90. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.woff2
  91. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.eot
  92. +2860
    -0
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.svg
  93. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.ttf
  94. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.woff
  95. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.woff2
  96. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.eot
  97. +2902
    -0
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.svg
  98. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.ttf
  99. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.woff
  100. BIN
      src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.woff2

+ 50
- 0
.github/workflows/basket-api-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy basket-api
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["basket-api"]
branches: [dev]
types: [completed]
env:
CHART: basket-api
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 35
- 1
.github/workflows/basket-api.yml View File

@ -1,6 +1,7 @@
name: basket-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -21,6 +22,7 @@ on:
env:
SERVICE: basket-api
IMAGE: basket.api
DOTNET_VERSION: 5.0.x
jobs:
@ -30,7 +32,23 @@ jobs:
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Basket/Basket.API
dotnet build --no-restore
cd -
cd Services/Basket/Basket.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
@ -46,6 +64,22 @@ jobs:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Basket/Basket.API
dotnet build --no-restore
cd -
cd Services/Basket/Basket.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json


+ 50
- 0
.github/workflows/catalog-api-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy catalog-api
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["catalog-api"]
branches: [dev]
types: [completed]
env:
CHART: catalog-api
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 34
- 0
.github/workflows/catalog-api.yml View File

@ -1,6 +1,7 @@
name: catalog-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -21,6 +22,7 @@ on:
env:
SERVICE: catalog-api
IMAGE: catalog.api
DOTNET_VERSION: 5.0.x
jobs:
@ -30,6 +32,22 @@ jobs:
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Catalog/Catalog.API
dotnet build --no-restore
cd -
cd Services/Catalog/Catalog.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
@ -46,6 +64,22 @@ jobs:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Catalog/Catalog.API
dotnet build --no-restore
cd -
cd Services/Catalog/Catalog.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json


+ 50
- 0
.github/workflows/identity-api-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy identity-api
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["identity-api"]
branches: [dev]
types: [completed]
env:
CHART: identity-api
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/mobileshoppingagg-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy mobileshoppingagg
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["mobileshoppingagg"]
branches: [dev]
types: [completed]
env:
CHART: mobileshoppingagg
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/ordering-api-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy ordering-api
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["ordering-api"]
branches: [dev]
types: [completed]
env:
CHART: ordering-api
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 34
- 0
.github/workflows/ordering-api.yml View File

@ -1,6 +1,7 @@
name: ordering-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -21,6 +22,7 @@ on:
env:
SERVICE: ordering-api
IMAGE: ordering.api
DOTNET_VERSION: 5.0.x
jobs:
@ -30,6 +32,22 @@ jobs:
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Ordering/Ordering.API
dotnet build --no-restore
cd -
cd Services/Ordering/Ordering.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
@ -45,6 +63,22 @@ jobs:
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Ordering/Ordering.API
dotnet build --no-restore
cd -
cd Services/Ordering/Ordering.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Enable experimental features for the Docker daemon and CLI
run: |


+ 50
- 0
.github/workflows/ordering-backgroundtasks-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy ordering-backgroundtasks
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["ordering-backgroundtasks"]
branches: [dev]
types: [completed]
env:
CHART: ordering-backgroundtasks
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/ordering-signalrhub-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy ordering-signalrhub
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["ordering-signalrhub"]
branches: [dev]
types: [completed]
env:
CHART: ordering-signalrhub
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/payment-api-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy payment-api
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["payment-api"]
branches: [dev]
types: [completed]
env:
CHART: payment-api
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/webhooks-api-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy webhooks-api
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["webhooks-api"]
branches: [dev]
types: [completed]
env:
CHART: webhooks-api
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/webmvc-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy webmvc
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["webmvc"]
branches: [dev]
types: [completed]
env:
CHART: webmvc
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/webshoppingagg-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy webshoppingagg
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["webshoppingagg"]
branches: [dev]
types: [completed]
env:
CHART: webshoppingagg
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/webspa-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy webspa
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["webspa"]
branches: [dev]
types: [completed]
env:
CHART: webspa
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 50
- 0
.github/workflows/webstatus-deploy.yml View File

@ -0,0 +1,50 @@
name: Deploy webstatus
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
workflow_run:
workflows: ["webstatus"]
branches: [dev]
types: [completed]
env:
CHART: webstatus
NAMESPACE: eshop
CHART_ROOT: deploy/k8s/helm
jobs:
deploy-to-k8s:
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}

+ 6
- 0
README.md View File

@ -6,6 +6,12 @@
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
## SPA Application (Angular)
![](img/eshop-spa-app-home.png)
## MVC application (ASP.NET Core)
![](img/eshop-webmvc-app-screenshot.png)
## Build Status (GitHub Actions)


+ 199
- 0
deploy/k8s/helm/deploy-chart.sh View File

@ -0,0 +1,199 @@
#!/usr/bin/env bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode
set -euo pipefail
usage()
{
cat <<END
deploy.sh: deploys the $app_name application to a Kubernetes cluster using Helm.
Parameters:
--aks-name <AKS cluster name>
The name of the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
--aks-rg <AKS resource group>
The resource group for the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
-c | --chart <name of chart>
The name of the chart to upgrade (or install)
-d | --dns <dns or ip address> | --dns aks
Specifies the external DNS/ IP address of the Kubernetes cluster.
If 'aks' is set as value, the DNS value is retrieved from the AKS. --aks-name and --aks-rg are needed.
When --use-local-k8s is specified the external DNS is automatically set to localhost.
-h | --help
Displays this help text and exits the script.
-n | --app-name <the name of the app>
Specifies the name of the application (default: eshop).
--namespace <namespace name>
Specifies the namespace name to deploy the app. If it doesn't exists it will be created (default: eshop).
-p | --docker-password <docker password>
The Docker password used to logon to the custom registry, supplied using the -r parameter.
-r | --registry <container registry>
Specifies the container registry to use (required), e.g. myregistry.azurecr.io.
--skip-clean
Do not clean the Kubernetes helm chart. Default is to clean the chart.
-t | --tag <docker image tag>
The tag used for the newly created docker images. Default: latest.
-u | --docker-username <docker username>
The Docker username used to logon to the custom registry, supplied using the -r parameter.
--use-local-k8s
Deploy to a locally installed Kubernetes (default: false).
It is assumed that the Kubernetes cluster has been granted access to the container registry.
If using AKS and ACR see link for more info:
https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks
WARNING! THE SCRIPT WILL COMPLETELY DESTROY ALL DEPLOYMENTS AND SERVICES VISIBLE
FROM THE CURRENT CONFIGURATION CONTEXT AND NAMESPACE.
It is recommended that you check your selected namespace, 'eshop' by default, is already in use.
Every deployment and service done in the namespace will be deleted.
For more information see https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
END
}
acr_connected=''
app_name='eshop'
aks_name=''
aks_rg=''
chart=''
clean='yes'
container_registry=''
docker_password=''
docker_username=''
dns=''
image_tag='latest'
skip_infrastructure=''
use_local_k8s=''
namespace='eshop'
while [[ $# -gt 0 ]]; do
case "$1" in
--acr-connected )
acr_connected='yes'; shift ;;
--aks-name )
aks_name="$2"; shift 2;;
--aks-rg )
aks_rg="$2"; shift 2;;
-c | --chart )
chart="$2"; shift 2;;
-d | --dns )
dns="$2"; shift 2;;
-h | --help )
usage; exit 1 ;;
-n | --app-name )
app_name="$2"; shift 2;;
-p | --docker-password )
docker_password="$2"; shift 2;;
-r | --registry )
container_registry="$2"; shift 2;;
--skip-clean )
clean=''; shift ;;
--image-build )
build_images='yes'; shift ;;
--image-push )
push_images='yes'; shift ;;
--skip-infrastructure )
skip_infrastructure='yes'; shift ;;
-t | --tag )
image_tag="$2"; shift 2;;
-u | --docker-username )
docker_username="$2"; shift 2;;
--use-local-k8s )
use_local_k8s='yes'; shift ;;
--namespace )
namespace="$2"; shift 2;;
*)
echo "Unknown option $1"
usage; exit 2 ;;
esac
done
export TAG=$image_tag
use_custom_registry=''
if [[ -n $container_registry ]] && [[ -z $acr_connected ]]; then
echo "################ Log into custom registry $container_registry ##################"
use_custom_registry='yes'
if [[ -z $docker_username ]] || [[ -z $docker_password ]]; then
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry"
exit 1
fi
docker login -u $docker_username -p $docker_password $container_registry
fi
ingress_values_file="ingress_values.yaml"
if [[ $use_local_k8s ]]; then
ingress_values_file="ingress_values_dockerk8s.yaml"
dns="localhost"
fi
if [[ $dns == "aks" ]]; then
echo "#################### Begin AKS discovery based on the --dns aks setting. ####################"
if [[ -z $aks_name ]] || [[ -z $aks_rg ]]; then
echo "Error: When using -dns aks, MUST set -aksName and -aksRg too."
echo ''
usage
exit 1
fi
echo "Getting AKS cluster $aks_name AKS (in resource group $aks_rg)"
# JMESPath queries are case sensitive and httpapplicationrouting can be lowercase sometimes
jmespath_dnsqueries=(\
addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName \
addonProfiles.httpapplicationrouting.config.HTTPApplicationRoutingZoneName \
)
for q in "${jmespath_dnsqueries[@]}"
do
dns="$(az aks show -n $aks_name -g $aks_rg --query $q -o tsv)"
if [[ -n $dns ]]; then break; fi
done
if [[ -z $dns ]]; then
echo "Error: when getting DNS of AKS $aks_name (in resource group $aks_rg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged in and is of version 2.0.37 or higher."
exit 1
fi
echo "DNS base found is $dns. Will use $aks_name.$dns for the app!"
dns="$aks_name.$dns"
fi
# Initialization & check commands
if [[ -z $dns ]]; then
echo "No DNS specified. Ingress resources will be bound to public IP."
fi
previous_install=''
if [[ -z $(helm ls -q --namespace $namespace | grep "$app_name-$chart") ]]; then
echo "No previous release found"
else
previous_install='yes'
fi
if [[ $clean ]] && [[ $previous_install ]]; then
echo "Cleaning previous helm releases..."
helm uninstall "$app_name-$chart" --namespace $namespace
echo "Previous release deleted"
waitsecs=5; while [ $waitsecs -gt 0 ]; do echo -ne "$waitsecs\033[0K\r"; sleep 1; : $((waitsecs--)); done
previous_install=''
fi
echo "#################### Begin $app_name $chart installation using Helm ####################"
if [[ $use_custom_registry ]] || [[ $acr_connected ]]; then
if [[ -z $acr_connected ]]; then
if [[ -z $previous_install ]]; then
helm upgrade --install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
else
helm upgrade --install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
fi
elif [[ $chart != "eshop-common" ]]; then
# ACR is already connected, so we don't need username/password
if [[ -z $previous_install ]]; then
helm install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --set inf.registry.server=$container_registry --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
else
# don't set the image repo since it's already set
helm upgrade "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
fi
fi
elif [[ $chart != "eshop-common" ]]; then # eshop-common is ignored when no secret must be deployed
helm upgrade --install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
fi
echo "FINISHED: Helm chart installed."

+ 2
- 2
deploy/windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 View File

@ -10,10 +10,10 @@ function Check-Admin {
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
function Add-InboundRule {
New-NetFirewallRule -DisplayName $InboundDisplayName -Confirm -Description "$Name Inbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound
New-NetFirewallRule -DisplayName $InboundDisplayName -Confirm -Description "$Name Inbound Rule for port range 5100-5205" -LocalAddress Any -LocalPort 5100-5205 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound
}
function Add-OutboundRule {
New-NetFirewallRule -DisplayName $OutboundDisplayName -Confirm -Description "$Name Outbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound
New-NetFirewallRule -DisplayName $OutboundDisplayName -Confirm -Description "$Name Outbound Rule for port range 5100-5205" -LocalAddress Any -LocalPort 5100-5205 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound
}
if ((Check-Admin) -eq $false) {


BIN
img/eshop-spa-app-home.png View File

Before After
Width: 1055  |  Height: 999  |  Size: 1.1 MiB

BIN
img/eshop-webmvc-app-screenshot.png View File

Before After
Width: 1413  |  Height: 952  |  Size: 1.1 MiB Width: 1055  |  Height: 999  |  Size: 1.1 MiB

+ 1
- 1
src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml View File

@ -103,7 +103,7 @@ static_resources:
lb_policy: round_robin
hosts:
- socket_address:
address: webshoppingagg
address: mobileshoppingagg
port_value: 80
- name: catalog
connect_timeout: 0.25s


+ 2
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile View File

@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
@ -13,6 +13,7 @@ COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"


+ 1
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:5.0
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true


+ 0
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj View File

@ -24,7 +24,6 @@
<PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />


+ 6
- 3
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderApiClient.cs View File

@ -2,9 +2,9 @@
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text.Json;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
{
@ -24,14 +24,17 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
public async Task<OrderData> GetOrderDraftFromBasketAsync(BasketData basket)
{
var uri = _urls.Orders + UrlsConfig.OrdersOperations.GetOrderDraft();
var content = new StringContent(JsonConvert.SerializeObject(basket), System.Text.Encoding.UTF8, "application/json");
var content = new StringContent(JsonSerializer.Serialize(basket), System.Text.Encoding.UTF8, "application/json");
var response = await _apiClient.PostAsync(uri, content);
response.EnsureSuccessStatusCode();
var ordersDraftResponse = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<OrderData>(ordersDraftResponse);
return JsonSerializer.Deserialize<OrderData>(ordersDraftResponse, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
}
}
}

+ 1
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs View File

@ -117,7 +117,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
services.Configure<UrlsConfig>(configuration.GetSection("urls"));
services.AddControllers()
.AddNewtonsoftJson();
.AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true);
services.AddSwaggerGen(options =>
{


+ 2
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile View File

@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
@ -13,6 +13,7 @@ COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"


+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:5.0
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true


+ 6
- 3
src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderApiClient.cs View File

@ -2,9 +2,9 @@
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text.Json;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
{
@ -24,14 +24,17 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
public async Task<OrderData> GetOrderDraftFromBasketAsync(BasketData basket)
{
var url = _urls.Orders + UrlsConfig.OrdersOperations.GetOrderDraft();
var content = new StringContent(JsonConvert.SerializeObject(basket), System.Text.Encoding.UTF8, "application/json");
var content = new StringContent(JsonSerializer.Serialize(basket), System.Text.Encoding.UTF8, "application/json");
var response = await _apiClient.PostAsync(url, content);
response.EnsureSuccessStatusCode();
var ordersDraftResponse = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<OrderData>(ordersDraftResponse);
return JsonSerializer.Deserialize<OrderData>(ordersDraftResponse, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
}
}
}

+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs View File

@ -140,7 +140,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
services.Configure<UrlsConfig>(configuration.GetSection("urls"));
services.AddControllers()
.AddNewtonsoftJson();
.AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true);
services.AddSwaggerGen(options =>
{


+ 0
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj View File

@ -25,7 +25,6 @@
<PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />


+ 7
- 4
src/BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj View File

@ -1,13 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>
<ItemGroup>


+ 1
- 1
src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationEvent.cs View File

@ -5,7 +5,7 @@ using System.Text;
namespace EventBus.Tests
{
public class TestIntegrationEvent : IntegrationEvent
public record TestIntegrationEvent : IntegrationEvent
{
}
}

+ 1
- 2
src/BuildingBlocks/EventBus/EventBus/EventBus.csproj View File

@ -5,8 +5,7 @@
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBus</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<ItemGroup>
</ItemGroup>
</Project>

+ 5
- 5
src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs View File

@ -1,10 +1,10 @@
using Newtonsoft.Json;
using System;
using System;
using System.Text.Json.Serialization;
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events
{
public record IntegrationEvent
{
{
public IntegrationEvent()
{
Id = Guid.NewGuid();
@ -18,10 +18,10 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events
CreationDate = createDate;
}
[JsonProperty]
[JsonInclude]
public Guid Id { get; private init; }
[JsonProperty]
[JsonInclude]
public DateTime CreationDate { get; private init; }
}
}

+ 12
- 15
src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs View File

@ -4,8 +4,6 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Polly;
using Polly.Retry;
using RabbitMQ.Client;
@ -15,6 +13,7 @@ using System;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json;
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
{
@ -89,9 +88,11 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
_logger.LogTrace("Declaring RabbitMQ exchange to publish event: {EventId}", @event.Id);
channel.ExchangeDeclare(exchange: BROKER_NAME, type: "direct");
var message = JsonConvert.SerializeObject(@event);
var body = Encoding.UTF8.GetBytes(message);
var body = JsonSerializer.SerializeToUtf8Bytes(@event, @event.GetType(), new JsonSerializerOptions
{
WriteIndented = true
});
policy.Execute(() =>
{
@ -142,13 +143,10 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
{
_persistentConnection.TryConnect();
}
using (var channel = _persistentConnection.CreateModel())
{
channel.QueueBind(queue: _queueName,
exchange: BROKER_NAME,
routingKey: eventName);
}
_consumerChannel.QueueBind(queue: _queueName,
exchange: BROKER_NAME,
routingKey: eventName);
}
}
@ -272,8 +270,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
{
var handler = scope.ResolveOptional(subscription.HandlerType) as IDynamicIntegrationEventHandler;
if (handler == null) continue;
dynamic eventData = JObject.Parse(message);
using dynamic eventData = JsonDocument.Parse(message);
await Task.Yield();
await handler.Handle(eventData);
}
@ -282,7 +279,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
var handler = scope.ResolveOptional(subscription.HandlerType);
if (handler == null) continue;
var eventType = _subsManager.GetEventTypeByName(eventName);
var integrationEvent = JsonConvert.DeserializeObject(message, eventType);
var integrationEvent = JsonSerializer.Deserialize(message, eventType, new JsonSerializerOptions() { PropertyNameCaseInsensitive= true});
var concreteType = typeof(IIntegrationEventHandler<>).MakeGenericType(eventType);
await Task.Yield();


+ 1
- 2
src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj View File

@ -8,8 +8,7 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="6.1.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Polly" Version="7.2.1" />
<PackageReference Include="RabbitMQ.Client" Version="6.2.1" />
</ItemGroup>


+ 6
- 6
src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs View File

@ -5,11 +5,10 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Logging;
using System;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class EventBusServiceBus : IEventBus
@ -36,7 +35,7 @@
public void Publish(IntegrationEvent @event)
{
var eventName = @event.GetType().Name.Replace(INTEGRATION_EVENT_SUFFIX, "");
var jsonMessage = JsonConvert.SerializeObject(@event);
var jsonMessage = JsonSerializer.Serialize(@event);
var body = Encoding.UTF8.GetBytes(jsonMessage);
var message = new Message
@ -165,7 +164,8 @@
{
var handler = scope.ResolveOptional(subscription.HandlerType) as IDynamicIntegrationEventHandler;
if (handler == null) continue;
dynamic eventData = JObject.Parse(message);
using dynamic eventData = JsonDocument.Parse(message);
await handler.Handle(eventData);
}
else
@ -173,7 +173,7 @@
var handler = scope.ResolveOptional(subscription.HandlerType);
if (handler == null) continue;
var eventType = _subsManager.GetEventTypeByName(eventName);
var integrationEvent = JsonConvert.DeserializeObject(message, eventType);
var integrationEvent = JsonSerializer.Deserialize(message, eventType);
var concreteType = typeof(IIntegrationEventHandler<>).MakeGenericType(eventType);
await (Task)concreteType.GetMethod("Handle").Invoke(handler, new object[] { integrationEvent });
}


+ 1
- 2
src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj View File

@ -12,8 +12,7 @@
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.2" />
</ItemGroup>
<ItemGroup>


+ 8
- 5
src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs View File

@ -1,6 +1,6 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
using Newtonsoft.Json;
using System;
using System.Text.Json;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
@ -13,8 +13,11 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF
{
EventId = @event.Id;
CreationTime = @event.CreationDate;
EventTypeName = @event.GetType().FullName;
Content = JsonConvert.SerializeObject(@event);
EventTypeName = @event.GetType().FullName;
Content = JsonSerializer.Serialize(@event, @event.GetType(), new JsonSerializerOptions
{
WriteIndented = true
});
State = EventStateEnum.NotPublished;
TimesSent = 0;
TransactionId = transactionId.ToString();
@ -32,8 +35,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF
public string TransactionId { get; private set; }
public IntegrationEventLogEntry DeserializeJsonContent(Type type)
{
IntegrationEvent = JsonConvert.DeserializeObject(Content, type) as IntegrationEvent;
{
IntegrationEvent = JsonSerializer.Deserialize(Content, type, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true }) as IntegrationEvent;
return this;
}
}


+ 2
- 2
src/Services/Basket/Basket.API/Basket.API.csproj View File

@ -28,6 +28,8 @@
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.1" />
<PackageReference Include="Azure.Identity" Version="1.4.0" />
<PackageReference Include="Google.Protobuf" Version="3.14.0" />
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.34.0" />
<PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" />
@ -37,8 +39,6 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.11" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="5.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />


+ 2
- 1
src/Services/Basket/Basket.API/Dockerfile View File

@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
@ -13,6 +13,7 @@ COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"


+ 1
- 1
src/Services/Basket/Basket.API/Dockerfile.develop View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:5.0
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true


+ 6
- 3
src/Services/Basket/Basket.API/Infrastructure/Repositories/RedisBasketRepository.cs View File

@ -1,10 +1,10 @@
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using StackExchange.Redis;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Text.Json;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories
{
@ -43,12 +43,15 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Reposit
return null;
}
return JsonConvert.DeserializeObject<CustomerBasket>(data);
return JsonSerializer.Deserialize<CustomerBasket>(data, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
}
public async Task<CustomerBasket> UpdateBasketAsync(CustomerBasket basket)
{
var created = await _database.StringSetAsync(basket.BuyerId, JsonConvert.SerializeObject(basket));
var created = await _database.StringSetAsync(basket.BuyerId, JsonSerializer.Serialize(basket));
if (!created)
{


+ 6
- 3
src/Services/Basket/Basket.API/Program.cs View File

@ -5,10 +5,12 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.eShopOnContainers.Services.Basket.API;
using Microsoft.Extensions.Configuration;
using Azure.Identity;
using Serilog;
using System;
using System.IO;
using System.Net;
using Azure.Core;
var configuration = GetConfiguration();
@ -88,10 +90,11 @@ IConfiguration GetConfiguration()
if (config.GetValue<bool>("UseVault", false))
{
builder.AddAzureKeyVault(
$"https://{config["Vault:Name"]}.vault.azure.net/",
TokenCredential credential = new ClientSecretCredential(
config["Vault:TenantId"],
config["Vault:ClientId"],
config["Vault:ClientSecret"]);
builder.AddAzureKeyVault(new Uri($"https://{config["Vault:Name"]}.vault.azure.net/"), credential);
}
return builder.Build();
@ -109,4 +112,4 @@ public class Program
public static string Namespace = typeof(Startup).Namespace;
public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
}
}

+ 1
- 1
src/Services/Basket/Basket.API/Startup.cs View File

@ -69,7 +69,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
}) // Added for functional tests
.AddApplicationPart(typeof(BasketController).Assembly)
.AddNewtonsoftJson();
.AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true);
services.AddSwaggerGen(options =>
{


+ 3
- 3
src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs View File

@ -1,9 +1,9 @@
using Basket.FunctionalTests.Base;
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Xunit;
@ -68,7 +68,7 @@ namespace Basket.FunctionalTests
Quantity = 1
});
return JsonConvert.SerializeObject(order);
return JsonSerializer.Serialize(order);
}
string BuildCheckout()
@ -89,7 +89,7 @@ namespace Basket.FunctionalTests
RequestId = Guid.NewGuid()
};
return JsonConvert.SerializeObject(checkoutBasket);
return JsonSerializer.Serialize(checkoutBasket);
}
}
}

+ 2
- 1
src/Services/Catalog/Catalog.API/Dockerfile View File

@ -3,7 +3,7 @@ WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
@ -14,6 +14,7 @@ COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"


+ 1
- 1
src/Services/Catalog/Catalog.API/Dockerfile.develop View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:5.0
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true


BIN
src/Services/Catalog/Catalog.API/Pics/1.png View File

Before After
Width: 370  |  Height: 241  |  Size: 148 KiB Width: 320  |  Height: 332  |  Size: 64 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/10.png View File

Before After
Width: 372  |  Height: 242  |  Size: 223 KiB Width: 320  |  Height: 332  |  Size: 40 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/11.png View File

Before After
Width: 371  |  Height: 243  |  Size: 212 KiB Width: 320  |  Height: 332  |  Size: 23 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/12.png View File

Before After
Width: 370  |  Height: 243  |  Size: 165 KiB Width: 320  |  Height: 332  |  Size: 82 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/13.png View File

Before After
Width: 320  |  Height: 332  |  Size: 24 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/14.png View File

Before After
Width: 320  |  Height: 332  |  Size: 24 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/2.png View File

Before After
Width: 371  |  Height: 240  |  Size: 41 KiB Width: 320  |  Height: 332  |  Size: 40 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/3.png View File

Before After
Width: 371  |  Height: 242  |  Size: 170 KiB Width: 320  |  Height: 332  |  Size: 60 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/4.png View File

Before After
Width: 372  |  Height: 240  |  Size: 152 KiB Width: 320  |  Height: 332  |  Size: 100 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/5.png View File

Before After
Width: 369  |  Height: 243  |  Size: 226 KiB Width: 320  |  Height: 332  |  Size: 39 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/6.png View File

Before After
Width: 372  |  Height: 242  |  Size: 179 KiB Width: 320  |  Height: 332  |  Size: 98 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/7.png View File

Before After
Width: 372  |  Height: 243  |  Size: 182 KiB Width: 320  |  Height: 332  |  Size: 96 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/8.png View File

Before After
Width: 371  |  Height: 242  |  Size: 167 KiB Width: 320  |  Height: 332  |  Size: 90 KiB

BIN
src/Services/Catalog/Catalog.API/Pics/9.png View File

Before After
Width: 370  |  Height: 242  |  Size: 40 KiB Width: 320  |  Height: 332  |  Size: 28 KiB

+ 5
- 2
src/Services/Catalog/Catalog.API/Program.cs View File

@ -14,6 +14,8 @@ using Serilog;
using System;
using System.IO;
using System.Net;
using Azure.Identity;
using Azure.Core;
var configuration = GetConfiguration();
@ -108,10 +110,11 @@ IConfiguration GetConfiguration()
if (config.GetValue<bool>("UseVault", false))
{
builder.AddAzureKeyVault(
$"https://{config["Vault:Name"]}.vault.azure.net/",
TokenCredential credential = new ClientSecretCredential(
config["Vault:TenantId"],
config["Vault:ClientId"],
config["Vault:ClientSecret"]);
builder.AddAzureKeyVault(new Uri($"https://{config["Vault:Name"]}.vault.azure.net/"), credential);
}
return builder.Build();


+ 0
- 5
src/Services/Catalog/Catalog.API/Setup/CatalogBrands.csv View File

@ -1,8 +1,3 @@
CatalogBrand
Azure
.NET
Visual Studio
SQL Server
Other
CatalogBrandTestOne
CatalogBrandTestTwo

BIN
src/Services/Catalog/Catalog.API/Setup/CatalogItems-MVC.zip View File


BIN
src/Services/Catalog/Catalog.API/Setup/CatalogItems-SPA.zip View File


+ 5
- 4
src/Services/Catalog/Catalog.API/Setup/CatalogItems.csv View File

@ -3,12 +3,13 @@ T-Shirt,.NET,".NET Bot Black Hoodie, and more",.NET Bot Black Hoodie,19.5,1.png,
Mug,.NET,.NET Black & White Mug,.NET Black & White Mug,8.50,2.png,89,true
T-Shirt,Other,Prism White T-Shirt,Prism White T-Shirt,12,3.png,56,false
T-Shirt,.NET,.NET Foundation T-shirt,.NET Foundation T-shirt,12,4.png,120,false
Sheet,Other,Roslyn Red Sheet,Roslyn Red Sheet,8.5,5.png,55,false
Pin,Other,Roslyn Red Pin,Roslyn Red Pin,8.5,5.png,55,false
T-Shirt,.NET,.NET Blue Hoodie,.NET Blue Hoodie,12,6.png,17,false
T-Shirt,Other,Roslyn Red T-Shirt,Roslyn Red T-Shirt,12,7.png,8,false
T-Shirt,Other,Kudu Purple Hoodie,Kudu Purple Hoodie,8.5,8.png,34,false
Mug,Other,Cup<T> White Mug,Cup<T> White Mug,12,9.png,76,false
Sheet,.NET,.NET Foundation Sheet,.NET Foundation Sheet,12,10.png,11,false
Sheet,.NET,Cup<T> Sheet,Cup<T> Sheet,8.5,11.png,3,false
Pin,.NET,.NET Foundation Pin,.NET Foundation Pin,12,10.png,11,false
Pin,.NET,Cup<T> Pin,Cup<T> Pin,8.5,11.png,3,false
T-Shirt,Other,Prism White TShirt,Prism White TShirt,12,12.png,0,false
Mug, Other, De los Palotes, pepito, 12, 12.png, 0, false
Mug,.NET,Modern .NET Black & White Mug,Modern .NET Black & White Mug,8.50,13.png,89,true
Mug,Other,Modern Cup<T> White Mug,Modern Cup<T> White Mug,12,14.png,76,false

BIN
src/Services/Catalog/Catalog.API/Setup/CatalogItems.zip View File


+ 1
- 4
src/Services/Catalog/Catalog.API/Setup/CatalogTypes.csv View File

@ -1,7 +1,4 @@
CatalogType
Mug
T-Shirt
Sheet
USB Memory Stick
CatalogTypeTestOne
CatalogTypeTestTwo
Pin

+ 10
- 0
src/Services/Catalog/Catalog.API/Setup/README.md View File

@ -0,0 +1,10 @@
# Catalog set up
The catalog images have been updated to the new SPA looks.
If you want to use the classical images:
1. Drop the `Microsoft.eShopOnContainers.Services.CatalogDb` database from the `sqldata` container.
2. Rename `CatalogItems-MVC.zip` as `CatalogItems.zip`
3. Rebuild the `catalog-api` service with `docker-compose build catalog-api`
4. Restart the application as usual

+ 2
- 1
src/Services/Catalog/Catalog.API/Startup.cs View File

@ -146,7 +146,8 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
services.AddControllers(options =>
{
options.Filters.Add(typeof(HttpGlobalExceptionFilter));
}).AddNewtonsoftJson();
})
.AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true);
services.AddCors(options =>
{


+ 2
- 1
src/Services/Identity/Identity.API/Dockerfile View File

@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
@ -13,6 +13,7 @@ COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"


+ 1
- 1
src/Services/Identity/Identity.API/Dockerfile.develop View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
FROM mcr.microsoft.com/dotnet/sdk:5.0
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true


+ 0
- 4
src/Services/Identity/Identity.API/Identity.API.csproj View File

@ -15,10 +15,6 @@
</Content>
</ItemGroup>
<ItemGroup>
<Compile Remove="Extensions\OpenTelemetryExtensions.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />


+ 5
- 2
src/Services/Identity/Identity.API/Program.cs View File

@ -11,6 +11,8 @@ using Microsoft.Extensions.Options;
using Serilog;
using System;
using System.IO;
using Azure.Identity;
using Azure.Core;
string Namespace = typeof(Startup).Namespace;
string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
@ -93,10 +95,11 @@ IConfiguration GetConfiguration()
if (config.GetValue<bool>("UseVault", false))
{
builder.AddAzureKeyVault(
$"https://{config["Vault:Name"]}.vault.azure.net/",
TokenCredential credential = new ClientSecretCredential(
config["Vault:TenantId"],
config["Vault:ClientId"],
config["Vault:ClientSecret"]);
builder.AddAzureKeyVault(new Uri($"https://{config["Vault:Name"]}.vault.azure.net/"), credential);
}
return builder.Build();

+ 19
- 53
src/Services/Identity/Identity.API/Views/Account/Login.cshtml View File

@ -1,61 +1,27 @@
@model Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels.LoginViewModel
@{
ViewData["Title"] = "Log in";
var requestQuery = ViewContext.HttpContext.Request.Query;
requestQuery.TryGetValue("ReturnUrl", out var returnUrl);
string partialView;
if (returnUrl[0].Contains("client_id=js"))
{
Layout = "_Layout-SPA";
partialView = "_LoginPartial-SPA.cshtml";
}
else
{
partialView = "_LoginPartial-MVC.cshtml";
}
}
<div class="brand-header-block">
<ul class="container">
<li><a asp-area="" asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">REGISTER</a></li>
<li class="active" style="margin-right: 65px;">LOGIN</li>
</ul>
</div>
<div class="container account-login-container">
<div class="row">
<div class="col-md-12">
<section>
<form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<input type="hidden" asp-for="ReturnUrl" />
<h4>ARE YOU REGISTERED?</h4>
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Email" class="control-label form-label"></label>
<input asp-for="Email" class="form-control form-input form-input-center" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Password" class="control-label form-label"></label>
<input asp-for="Password" class="form-control form-input form-input-center" />
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<div class="form-group">
<div class="checkbox">
<label asp-for="RememberMe">
<input asp-for="RememberMe" />
@Html.DisplayNameFor(m => m.RememberMe)
</label>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-default btn-brand btn-brand-big">&nbsp;LOG IN&nbsp;</button>
</div>
<p>
<a asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" class="text">Register as a new user?</a>
</p>
<p>
Note that for demo purposes you don't need to register and can login with these credentials:
</p>
<p>
User: <b>demouser@microsoft.com</b>
</p>
<p>
Password: <b>Pass@word1</b>
</p>
</form>
</section>
</div>
</div>
</div>
<partial name=@partialView model=@Model />
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }


+ 21
- 99
src/Services/Identity/Identity.API/Views/Account/Register.cshtml View File

@ -1,106 +1,28 @@
@model Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels.RegisterViewModel
@{
ViewData["Title"] = "Register";
var requestQuery = ViewContext.HttpContext.Request.Query;
requestQuery.TryGetValue("ReturnUrl", out var returnUrl);
string partialView;
if (returnUrl[0].Contains("client_id=js"))
{
Layout = "_Layout-SPA";
partialView = "_RegisterPartial-SPA.cshtml";
}
else
{
partialView = "_RegisterPartial-MVC.cshtml";
}
}
<div class="brand-header-block">
<ul class="container">
<li class="active">REGISTER</li>
<li style="margin-right: 65px;"><a asp-area="" asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]">LOGIN</a></li>
</ul>
</div>
<div class="container register-container">
<form asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<h4 class="order-create-section-title">CREATE NEW ACCOUNT</h4>
<div asp-validation-summary="All" class="text-danger"></div>
<div class="row">
<div class="form-group col-sm-6">
<label asp-for="User.Name" class="control-label form-label">NAME</label>
<input asp-for="User.Name" class="form-control form-input" />
<span asp-validation-for="User.Name" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.LastName" class="control-label form-label">LAST NAME</label>
<input asp-for="User.LastName" class="form-control form-input" />
<span asp-validation-for="User.LastName" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.Street" class="control-label form-label">ADDRESS</label>
<input asp-for="User.Street" class="form-control form-input" />
<span asp-validation-for="User.Street" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.City" class="control-label form-label"></label>
<input asp-for="User.City" class="form-control form-input" />
<span asp-validation-for="User.City" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.State" class="control-label form-label"></label>
<input asp-for="User.State" class="form-control form-input" />
<span asp-validation-for="User.State" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.Country" class="control-label form-label"></label>
<input asp-for="User.Country" class="form-control form-input" />
<span asp-validation-for="User.Country" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.ZipCode" class="control-label form-label">POSTCODE</label>
<input asp-for="User.ZipCode" class="form-control form-input" />
<span asp-validation-for="User.ZipCode" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.PhoneNumber" class="control-label form-label">PHONE NUMBER</label>
<input asp-for="User.PhoneNumber" class="form-control form-input" />
<span asp-validation-for="User.PhoneNumber" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.CardNumber" class="control-label form-label">Card Number</label>
<input asp-for="User.CardNumber" class="form-control form-input" />
<span asp-validation-for="User.CardNumber" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.CardHolderName" class="control-label form-label">Cardholder Name</label>
<input asp-for="User.CardHolderName" class="form-control form-input" />
<span asp-validation-for="User.CardHolderName" class="text-danger" />
</div>
<div class="form-group col-sm-3">
<label asp-for="User.Expiration" class="control-label form-label">Expiration Date</label>
<input asp-for="User.Expiration" placeholder="MM/YY" class="form-control form-input form-input-small" />
<span asp-validation-for="User.Expiration" class="text-danger" />
</div>
<div class="form-group col-sm-3">
<label asp-for="User.SecurityNumber" class="control-label form-label">Security Code</label>
<input asp-for="User.SecurityNumber" class="form-control form-input form-input-small" />
<span asp-validation-for="User.SecurityNumber" class="text-danger" />
</div>
</div>
<br /><br />
<div class="row">
<div class="form-group col-sm-6">
<label asp-for="Email" class="control-label form-label"></label>
<input asp-for="Email" class="form-control form-input" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group col-sm-offset-6"></div>
<div class="form-group col-sm-6">
<label asp-for="Password" class="control-label form-label"></label>
<input asp-for="Password" class="form-control form-input" />
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<div class="form-group col-sm-6">
<label asp-for="ConfirmPassword" class="control-label form-label"></label>
<input asp-for="ConfirmPassword" class="form-control form-input" />
<span asp-validation-for="ConfirmPassword" class="text-danger"></span>
</div>
</div>
<br /><br />
<div class="form-group">
<button type="submit" class="btn btn-default btn-brand">&nbsp;Register&nbsp;</button>
</div>
<br /><br />
</form>
</div>
<partial name=@partialView model=@Model />
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}

+ 54
- 0
src/Services/Identity/Identity.API/Views/Account/_LoginPartial-MVC.cshtml View File

@ -0,0 +1,54 @@
@model Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels.LoginViewModel
<div class="brand-header-block">
<ul class="container">
<li><a asp-area="" asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">REGISTER</a></li>
<li class="active" style="margin-right: 65px;">LOGIN</li>
</ul>
</div>
<div class="container account-login-container">
<div class="row">
<div class="col-md-12">
<section>
<form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<input type="hidden" asp-for="ReturnUrl" />
<h4>ARE YOU REGISTERED?</h4>
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Email" class="control-label form-label"></label>
<input asp-for="Email" class="form-control form-input form-input-center" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Password" class="control-label form-label"></label>
<input asp-for="Password" class="form-control form-input form-input-center" />
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<div class="form-group">
<div class="checkbox">
<label asp-for="RememberMe">
<input asp-for="RememberMe" />
@Html.DisplayNameFor(m => m.RememberMe)
</label>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-default btn-brand btn-brand-big">&nbsp;LOG IN&nbsp;</button>
</div>
<p>
<a asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" class="text">Register as a new user?</a>
</p>
<p>
Note that for demo purposes you don't need to register and can login with these credentials:
</p>
<p>
User: <b>demouser@microsoft.com</b>
</p>
<p>
Password: <b>Pass@word1</b>
</p>
</form>
</section>
</div>
</div>
</div>

+ 47
- 0
src/Services/Identity/Identity.API/Views/Account/_LoginPartial-SPA.cshtml View File

@ -0,0 +1,47 @@
@model Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels.LoginViewModel
<div class="container">
<div class="row">
<div class="col-md-12">
<section>
<form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-login">
<input type="hidden" asp-for="ReturnUrl" />
<h4 class="text-left mb-4">ARE YOU REGISTERED?</h4>
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Email" class="control-label form-label"></label>
<input asp-for="Email" class="form-control form-input w-100" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Password" class="control-label form-label"></label>
<input asp-for="Password" class="form-control form-input w-100" />
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<div class="d-flex align-items-center justify-content-between">
<div class="checkbox">
<label asp-for="RememberMe">
<input asp-for="RememberMe" class="mr-1" />
@Html.DisplayNameFor(m => m.RememberMe)
</label>
</div>
<button type="submit" class="btn btn-primary">LOG IN</button>
</div>
<div class="form-login-register-link text-center mt-3">
<a class="text-link" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">Register as a new user?</a>
</div>
</form>
<div class="form-login-details">
<div>
Note that for demo purposes you don't need to register and can login with these credentials:
</div>
<div>
User: <strong>demouser@microsoft.com</strong> Password: <strong>Pass@word1</strong>
</div>
</div>
</section>
</div>
</div>
</div>

+ 100
- 0
src/Services/Identity/Identity.API/Views/Account/_RegisterPartial-MVC.cshtml View File

@ -0,0 +1,100 @@
@model Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels.RegisterViewModel
<div class="brand-header-block">
<ul class="container">
<li class="active">REGISTER</li>
<li style="margin-right: 65px;"><a asp-area="" asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]">LOGIN</a></li>
</ul>
</div>
<div class="container register-container">
<form asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
<h4 class="order-create-section-title">CREATE NEW ACCOUNT</h4>
<div asp-validation-summary="All" class="text-danger"></div>
<div class="row">
<div class="form-group col-sm-6">
<label asp-for="User.Name" class="control-label form-label">NAME</label>
<input asp-for="User.Name" class="form-control form-input" />
<span asp-validation-for="User.Name" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.LastName" class="control-label form-label">LAST NAME</label>
<input asp-for="User.LastName" class="form-control form-input" />
<span asp-validation-for="User.LastName" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.Street" class="control-label form-label">ADDRESS</label>
<input asp-for="User.Street" class="form-control form-input" />
<span asp-validation-for="User.Street" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.City" class="control-label form-label"></label>
<input asp-for="User.City" class="form-control form-input" />
<span asp-validation-for="User.City" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.State" class="control-label form-label"></label>
<input asp-for="User.State" class="form-control form-input" />
<span asp-validation-for="User.State" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.Country" class="control-label form-label"></label>
<input asp-for="User.Country" class="form-control form-input" />
<span asp-validation-for="User.Country" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.ZipCode" class="control-label form-label">POSTCODE</label>
<input asp-for="User.ZipCode" class="form-control form-input" />
<span asp-validation-for="User.ZipCode" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.PhoneNumber" class="control-label form-label">PHONE NUMBER</label>
<input asp-for="User.PhoneNumber" class="form-control form-input" />
<span asp-validation-for="User.PhoneNumber" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.CardNumber" class="control-label form-label">Card Number</label>
<input asp-for="User.CardNumber" class="form-control form-input" />
<span asp-validation-for="User.CardNumber" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.CardHolderName" class="control-label form-label">Cardholder Name</label>
<input asp-for="User.CardHolderName" class="form-control form-input" />
<span asp-validation-for="User.CardHolderName" class="text-danger" />
</div>
<div class="form-group col-sm-3">
<label asp-for="User.Expiration" class="control-label form-label">Expiration Date</label>
<input asp-for="User.Expiration" placeholder="MM/YY" class="form-control form-input form-input-small" />
<span asp-validation-for="User.Expiration" class="text-danger" />
</div>
<div class="form-group col-sm-3">
<label asp-for="User.SecurityNumber" class="control-label form-label">Security Code</label>
<input asp-for="User.SecurityNumber" class="form-control form-input form-input-small" />
<span asp-validation-for="User.SecurityNumber" class="text-danger" />
</div>
</div>
<br /><br />
<div class="row">
<div class="form-group col-sm-6">
<label asp-for="Email" class="control-label form-label"></label>
<input asp-for="Email" class="form-control form-input" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group col-sm-offset-6"></div>
<div class="form-group col-sm-6">
<label asp-for="Password" class="control-label form-label"></label>
<input asp-for="Password" class="form-control form-input" />
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<div class="form-group col-sm-6">
<label asp-for="ConfirmPassword" class="control-label form-label"></label>
<input asp-for="ConfirmPassword" class="form-control form-input" />
<span asp-validation-for="ConfirmPassword" class="text-danger"></span>
</div>
</div>
<br /><br />
<div class="form-group">
<button type="submit" class="btn btn-default btn-brand">&nbsp;Register&nbsp;</button>
</div>
<br /><br />
</form>
</div>

+ 100
- 0
src/Services/Identity/Identity.API/Views/Account/_RegisterPartial-SPA.cshtml View File

@ -0,0 +1,100 @@
@model Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels.RegisterViewModel
<div class="container">
<h1 class="mb-4 mt-5">[ New Account ]</h1>
<form asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-register">
<h4 class="order-create-section-title">Information</h4>
<div asp-validation-summary="All" class="text-danger"></div>
<div class="row">
<div class="form-group col-sm-6">
<label asp-for="User.Name" class="control-label form-label">Name</label>
<input asp-for="User.Name" class="form-control form-input" />
<span asp-validation-for="User.Name" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.LastName" class="control-label form-label">Last Name</label>
<input asp-for="User.LastName" class="form-control form-input" />
<span asp-validation-for="User.LastName" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.Street" class="control-label form-label">Address</label>
<input asp-for="User.Street" class="form-control form-input" />
<span asp-validation-for="User.Street" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.City" class="control-label form-label"></label>
<input asp-for="User.City" class="form-control form-input" />
<span asp-validation-for="User.City" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.State" class="control-label form-label"></label>
<input asp-for="User.State" class="form-control form-input" />
<span asp-validation-for="User.State" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.Country" class="control-label form-label"></label>
<input asp-for="User.Country" class="form-control form-input" />
<span asp-validation-for="User.Country" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.ZipCode" class="control-label form-label">Postcode</label>
<input asp-for="User.ZipCode" class="form-control form-input" />
<span asp-validation-for="User.ZipCode" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.PhoneNumber" class="control-label form-label">Phone Number</label>
<input asp-for="User.PhoneNumber" class="form-control form-input" />
<span asp-validation-for="User.PhoneNumber" class="text-danger" />
</div>
</div>
<div class="mt-4">
<h4 class="order-create-section-title">Credit Card</h4>
</div>
<div class="row">
<div class="form-group col-sm-6">
<label asp-for="User.CardNumber" class="control-label form-label">Card Number</label>
<input asp-for="User.CardNumber" class="form-control form-input" />
<span asp-validation-for="User.CardNumber" class="text-danger" />
</div>
<div class="form-group col-sm-6">
<label asp-for="User.CardHolderName" class="control-label form-label">Cardholder Name</label>
<input asp-for="User.CardHolderName" class="form-control form-input" />
<span asp-validation-for="User.CardHolderName" class="text-danger" />
</div>
<div class="form-group col-sm-3">
<label asp-for="User.Expiration" class="control-label form-label">Expiration Date</label>
<input asp-for="User.Expiration" placeholder="MM/YY" class="form-control form-input form-input-small" />
<span asp-validation-for="User.Expiration" class="text-danger" />
</div>
<div class="form-group col-sm-3">
<label asp-for="User.SecurityNumber" class="control-label form-label">Security Code</label>
<input asp-for="User.SecurityNumber" class="form-control form-input form-input-small" />
<span asp-validation-for="User.SecurityNumber" class="text-danger" />
</div>
</div>
<br /><br />
<div class="row">
<div class="form-group col-sm-6">
<label asp-for="Email" class="control-label form-label"></label>
<input asp-for="Email" class="form-control form-input" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
<div class="form-group col-sm-offset-6"></div>
<div class="form-group col-sm-6">
<label asp-for="Password" class="control-label form-label"></label>
<input asp-for="Password" class="form-control form-input" />
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<div class="form-group col-sm-6">
<label asp-for="ConfirmPassword" class="control-label form-label"></label>
<input asp-for="ConfirmPassword" class="form-control form-input" />
<span asp-validation-for="ConfirmPassword" class="text-danger"></span>
</div>
</div>
<br /><br />
<div class="d-flex mt-3 justify-content-end">
<button type="submit" class="btn btn-primary">Register</button>
</div>
<br /><br />
</form>
</div>

+ 54
- 0
src/Services/Identity/Identity.API/Views/Shared/_Layout-SPA.cshtml View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-inline'; script-src-elem 'unsafe-inline'">
<title>eShopOnContainers - Identity</title>
<link rel="icon" type="image/x-icon" href="~/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="~/favicon.ico" />
<environment names="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/css/site-spa.css" />
</environment>
<environment names="Staging,Production">
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site-spa.min.css" asp-append-version="true" />
</environment>
</head>
<body>
<div class="es-header">
<div class="container">
<article class="d-flex align-content-center justify-content-between">
<section>
<a asp-controller="home" asp-action="ReturnToOriginalApplication" asp-route-returnUrl="@ViewData["ReturnUrl"]">
<img class="es-header-brand" src="~/images/logo_color.svg">
</a>
</section>
</article>
</div>
</div>
<div class="content">
@RenderBody()
</div>
<footer class="footer">
<div class="container">
<article class="d-flex w-100 h-100 justify-content-between align-items-center">
<section>
<img class="footer-brand" src="~/images/logo.svg">
</section>
<section> © e-Shoponcontainers. All rights reserved </section>
</article>
</div>
</footer>
<script src="~/lib/jquery/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
@RenderSection("scripts", required: false)
</body>
</html>

+ 1062
- 0
src/Services/Identity/Identity.API/wwwroot/css/site-spa.css
File diff suppressed because it is too large
View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.eot View File


+ 3184
- 0
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.svg
File diff suppressed because it is too large
View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.ttf View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.woff View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Bold.woff2 View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.eot View File


+ 2860
- 0
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.svg
File diff suppressed because it is too large
View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.ttf View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.woff View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-ExtraLight.woff2 View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.eot View File


+ 2902
- 0
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.svg
File diff suppressed because it is too large
View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.ttf View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.woff View File


BIN
src/Services/Identity/Identity.API/wwwroot/fonts/Oswald-Light.woff2 View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save