Giter Site home page Giter Site logo

microsoft / contosotraders Goto Github PK

View Code? Open in Web Editor NEW
19.0 5.0 41.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 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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

contosotraders's Issues

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

Keep getting errors while deploying the App

Describe the bug
While deploying via Azure Pipelines and Azure Repos, I keep getting the following error:

##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.
##[error]Details:
##[error]PublicAccessNotPermitted: Public access is not permitted on this storage account.
RequestId:6cf5748f-801e-0042-20b4-72fb8d000000
Time:2024-03-10T06:27:51.6390264Z
##[error]PublicAccessNotPermitted: Public access is not permitted on this storage account.
RequestId:6cf57476-801e-0042-0db4-72fb8d000000
Time:2024-03-10T06:27:51.6130408Z
##[error]PublicAccessNotPermitted: Public access is not permitted on this storage account.
RequestId:6d40c59c-b01e-00d3-48b4-720e0f000000
Time:2024-03-10T06:27:48.7554464Z
##[error]ResourceNotFound: The Resource 'Microsoft.App/containerApps/contoso-traders-intcartsishan' under resource group 'contoso-traders-rgishan' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
##[error]ResourceNotFound: The Resource 'Microsoft.App/managedEnvironments/contosotradersintacaenvishan' under resource group 'contoso-traders-rgishan' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
##[error]Check out the troubleshooting guide to see if your issue is addressed: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
##[error]Task failed while creating or updating the template deployment.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy 266-hotfix using Azure Pipelines
  2. Click on Run Pipeline

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.

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:

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

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.

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.

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:

[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: 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:

[CUT] Move UI to ACA

Tasks

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

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:

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]

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.