GithubHelp home page GithubHelp logo

microsoft / contosotraders Goto Github PK

View Code? Open in Web Editor NEW
18.0 5.0 36.0 71.05 MB

This is a repo for all of the demo assets for Contoso Traders, a fictional company that we have built infrastructure and resources for to help developers understand the capabilities of App Innovation products and services.

Home Page: https://www.contosotraders.com

License: MIT License

Bicep 6.66% PowerShell 0.05% C# 13.55% Dockerfile 0.29% HTML 0.52% JavaScript 56.68% CSS 4.06% SCSS 18.13% Shell 0.06%
acr aks appservice architecture azure azurefunctions cosmosdb devops dotnet github

contosotraders's Introduction

Contoso Traders

Logo

Documentation and Resources

Demo Scripts

Scenario Documentation
Cloud Native App Architecture Walkthrough Overview | Technical Walkthrough
Autoscaling Cloud Native Apps in Azure Overview | Technical Walkthrough
DevSecOps Journey with GitHub + Azure Overview | Technical Walkthrough
Low Code App Development Power Platform Overview | Technical Walkthrough
Intelligent Apps with Azure AI Services Overview | Technical Walkthrough

Architecture

Architecture

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

contosotraders's People

Contributors

amalik99 avatar divyasri199 avatar gokulsm avatar jbofficial avatar microsoft-github-operations[bot] avatar microsoftopensource avatar mithunshanbhag avatar nikitaspektra avatar seenakhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

contosotraders's Issues

Update architecture diagram, documentation

Tasks:

  • Remove API gateway / APIM from architecture diagram, documentation
  • Remove Redis Cache from architecture diagram, documentation
  • Replace UI's App Service with Storage Account for architecture diagram, documentation
  • Remove ImageRecognition App Service for architecture diagram, documentation
  • Mention Load Testing Service
  • Mention Chaos Studio

Demo script: L300: intelligent-apps-with-azure-ai-services

CC: @jbofficial

Existing demo-script: https://github.com/microsoft/ContosoTraders/blob/main/demo-scripts/intelligent-apps-with-azure-ai-services/technical-walkthrough.md

Basic Expectations:

  • We will start with launching the application https://www.contosotraders.com and give an overview of app with focus on need for AI/Visual Search 
  • Search for a product through Image 
  • Technical details of AI Services used in App and hosting demo 
  • Review the Computer Vision components used in App (Technical) 
  • Review the Computer Vision hosting service used in App (Technical)

Required Structure:

  • Key takeaways (i.e bullet points explaining key value adds)
  • Before you begin (i.e. prerequisites)
  • Walkthrough (step by step guidance)
    • Note: We can have multiple (mini) walkthroughs per document.
    • Note: Each walkthrough can have a lead-in statements explaining what we are doing / why we are doing before we get into steps
    • Note: Ideally there should be a screenshot with each step.
  • Summary (i.e. conclusion)
  • Cleanup (i.e. if anything needs to be deleted which was created as part of earlier steps)

Notes: L100 is just "how to use the app". L300 is "what happens behind the scenes in Azure/github/visual studio".

Use these for reference:

Fix AKS Scaling (Cluster Autoscaler)

We're investigating the following options for AKS scaling:

1. ACI VIRTUAL NODES

Status

Currently BLOCKED.

Where

Change Description

  • Redeployed AKS cluster via bicep template from mithun/hpa2 branch, which has the Azure CNI network policy (instead of the default kubenet policy).
  • Had to manually modify AKS's vnet to create a new subnet aci-subnet with address space 10.255.0.0/16.
  • Tethered it to existing AKS cluster using az aks enable-addons (full instructions here).
  • Applied the Deployment.yaml manifest from mithun/hpa2 branch, which has the nodeSelector, tolerations changes to configure pods to only run in virtual nodes.

Issue Details

The pods (configured to run in ACI virtual nodes) are stuck in waiting state.

image

The logs only show that an active endpoint is not being detected for the services / ingress

image

Hypothesis

  • Could have something to do with the fact that we switched over to Azure CNI network policy instead of the default kubenet policy.
  • Could have something to do with the nodeSelector, tolerations changes made in the Deployment.yaml file to configure pod to only run in virtual nodes.

2. CLUSTER AUTOSCALER

Status

Currently INVESTIGATING

Where

  • The changes are in my fork in [mithun/enable-autoscal](mithunshanbhag:mithun/cluster-autoscaler) branch (See PR #81)
  • Deployed in Jithin's MSDN subscription.

Change Description

  • Enable autoscaling with minCount: 1 and maxCount: 10

Issue Details

Hypothesis

Currently none, still investigating.

Misc Notes

Ingress controller was stuck in PENDING state for a few minutes after provisioning. Then automatically went to OK state.

image

[CUT] Move UI to ACA

Tasks

  • Create dockerfile
  • Update bicep
  • Update github workflow
  • Update any necessary documentation

Api returns error 500 in add to bag

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.contosotraders.com/
  2. Click on buy now
  3. Click on Add to bag
  4. See the error "The product could not be added to the cart."

Expected behavior
Item added to the cart.

Screenshots
image

Desktop (please complete the following information):

  • OS: [iOS]
  • Browser [chrome, safari]
  • Version [115]

Github workflow: Handle soft-deleted resources on redeployment.

Even if you delete the contoso-traders-rg resource group, the following resources are only soft-deleted.

  • key vault
  • cognitive service.

Consequently, when you attempt to redeploy using bicep, the deployment fails since the above resources are in a soft-deleted state.

Manual workaround is to either recover (recommended) or purge (not recommended) the soft-deleted resources using the portal.

[HIGH PRI] Deploy UI to app service to pick up env-vars from app settings.

Possible alternatives:

  • find-and-replace tokens in configureService.js file
  • investigate static web apps
  • investigate app service
  • investigate containerization
  • investigate env-vars (@todo: just a half-baked thought, not sure how)

Tasks

  • provision app service
  • investigate if possible to extract app settings as env vars
  • workflow (deployment to app service) changes
  • CDN fixup (point to app service as origin
  • remove storage account + related powershell script

Demo Script: L300: cloud-native-app-architecture-walkthrough

Existing demo-script: https://github.com/microsoft/ContosoTraders/blob/main/demo-scripts/intelligent-apps-with-azure-ai-services/technical-walkthrough.md

Basic Expectations:

  • Technical Walkthrough of App Architecture Diagram  
  • Azure Services leveraged for each component.  
  • Technical Walkthrough of Azure Deployment  
  • Demo of Azure deployment  
  • Launch App (at the end)  

Required Structure:

  • Key takeaways (i.e bullet points explaining key value adds)
  • Before you begin (i.e. prerequisites)
  • Walkthrough (step by step guidance)
    • Note: We can have multiple (mini) walkthroughs per document.
    • Note: Each walkthrough can have a lead-in statements explaining what we are doing / why we are doing before we get into steps
    • Note: Ideally there should be a screenshot with each step.
  • Summary (i.e. conclusion)
  • Cleanup (i.e. if anything needs to be deleted which was created as part of earlier steps)

Notes: L100 is just "how to use the app". L300 is "what happens behind the scenes in Azure/github/visual studio".

Use these for reference:

Demo script: L100: intelligent-apps-with-azure-ai-services

CC: @jbofficial

Existing demo-script: https://github.com/microsoft/ContosoTraders/blob/main/demo-scripts/intelligent-apps-with-azure-ai-services/overview.md

Basic Expectations:

  • We will start with launching the application https://www.contosotraders.com and give an overview of app with focus on need for AI/Visual Search 
  • Search for a product through image.

Required Structure:

  • Key takeaways (i.e bullet points explaining key value adds)
  • Before you begin (i.e. prerequisites)
  • Walkthrough (step by step guidance)
    • Note: We can have multiple (mini) walkthroughs per document.
    • Note: Each walkthrough can have a lead-in statements explaining what we are doing / why we are doing before we get into steps
    • Note: Ideally there should be a screenshot with each step.
  • Summary (i.e. conclusion)
  • Cleanup (i.e. if anything needs to be deleted which was created as part of earlier steps)

Notes: L100 is just "how to use the app". L300 is "what happens behind the scenes in Azure/github/visual studio".

Use these for reference:

Demo Script: L100: cloud-native-app-architecture-walkthrough

Existing demo-script: https://github.com/microsoft/ContosoTraders/blob/main/demo-scripts/intelligent-apps-with-azure-ai-services/technical-walkthrough.md

Basic Expectations:

  • High Level Walkthrough of App Architecture Diagram  
  • Azure Services leveraged for each component.  
  • Launch App (at the end)  

Required Structure:

  • Key takeaways (i.e bullet points explaining key value adds)
  • Before you begin (i.e. prerequisites)
  • Walkthrough (step by step guidance)
    • Note: We can have multiple (mini) walkthroughs per document.
    • Note: Each walkthrough can have a lead-in statements explaining what we are doing / why we are doing before we get into steps
    • Note: Ideally there should be a screenshot with each step.
  • Summary (i.e. conclusion)
  • Cleanup (i.e. if anything needs to be deleted which was created as part of earlier steps)

Notes: L100 is just "how to use the app". L300 is "what happens behind the scenes in Azure/github/visual studio".

Use these for reference:

Github workflow: Sporadic/intermittent failures (new resources not detected)

Internally (in azure), the subscription caches the list of resources in it.
On resource deployments/creation/deletion, this cache should get updated, but we've seen delays from a few resource providers. E.g.

This causes intermittent failures, that pass on re-run.

We should probably add steps for sleep/wait until the resources are detected.

Unable to deploy using GitHub Actions

Describe the bug
I have agreed to the AI Responsibility terms as this was the first error I was getting. But, now it is failing with an error:

"The template deployment 'createResources' is not valid according to the validation procedure."

image

I need to be able to walk a customer through setting this up and using it to better understanding MALT and Chaos Studio.

Remove bicep validation warnings

The following warnings are generating when validating (or running) the createResources.bicep template. These need to be resolved.

Once resolved, the failOnStdErr: false setting needs to be removed from the Azure/arm-deploy@v1 actions in our github workflows.

Validating template...
Warning: WARNING: /home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(191,50) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "database.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(201,50) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "database.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(926,56) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(931,54) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(932,62) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(1009,48) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(1014,46) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(1015,54) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(1120,49) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(1125,47) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]
/home/runner/work/ContosoTraders/ContosoTraders/iac/createResources.bicep(1126,55) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.