Code Monkey home page Code Monkey logo

nodejs-appsvc-cosmosdb-bottleneck's Introduction

WebApp with Cosmos DB

A sample webapp deployed on app service with cosmos db as database. It counts the number of visitors visiting the page and inserts the same into a sample collection in Cosmos DB.

Installation

  1. In your terminal window, log into Azure and set a subscription(subscription which would contain the webapp) :

     az login
     az account set -s mySubscriptionName
    
  2. Clone the sample application's source repository. The sample application is a Node.js app consisting of an Azure App Service web component and a Cosmos DB database. The repo also contains a PowerShell script that deploys the sample app to your Azure subscription.

     git clone https://github.com/Azure-Samples/nodejs-appsvc-cosmosdb-bottleneck.git
    
  3. Deploy the sample app using the PowerShell script. (Tip: macOS users can install PowerShell here)

     cd SampleApp
     .\deploymentscript.ps1
    
  4. You will be prompted to supply a unique application name and a location (default is eastus). A resource group for the resources would be created with the same name.

  5. Once deployment is complete, browse to the running sample application with your browser.

     https://<app_name>.azurewebsites.net
    

Clean up resources

You may want to delete the resources to avoid to continue incurring charges. Use the az group delete command to remove the resource group and all related resources.

    az group delete --name myResourceGroup

Similarly, you can utilize the Delete resource group toolbar button on the sample application's resource group to remove all the resources.

nodejs-appsvc-cosmosdb-bottleneck's People

Contributors

allantargino avatar issacnitinmsft avatar microsoftopensource avatar ninallam avatar ntrogh avatar sachid26 avatar

Stargazers

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

Watchers

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

nodejs-appsvc-cosmosdb-bottleneck's Issues

Code does not often deploy to the web app

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

the deployment PowerShell fails when deploying the code to the web app with authentication issues

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful

It seems that basic authentication needs to be enabled on the web app when deployed into different environments (appears to be more reliable on Visual Studio subscriprions) Added this section to the ARM template and it deploys more reliably

{
        "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies",
        "apiVersion": "2022-03-01",
        "name": "[concat(parameters('webAppName'), '/scm')]",
        "location": "[resourceGroup().location]",
        "dependsOn": [
            "[resourceId('Microsoft.Web/sites', parameters('webAppName'))]"
        ],
        "properties": {
            "allow": "true"
        }
    },
    {
        "type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies",
        "apiVersion": "2022-03-01",
        "name": "[concat(parameters('webAppName'), '/ftp')]",
        "location": "[resourceGroup().location]",
        "dependsOn": [
            "[resourceId('Microsoft.Web/sites', parameters('webAppName'))]"
        ],
        "properties": {
            "allow": "true"
        }
    },

Thanks! We'll be in touch soon.

'One of the deployment parameters has an empty key' error while running the Pipeline

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Following the Identify performance regressions by automating load tests with CI/CD tutorial the Pipeline fails at generating the Azure Load Test resource.

Any log messages given by the failure

Starting: AzureResourceManagerTemplateDeployment
==============================================================================
Task         : ARM template deployment
Description  : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
Version      : 3.210.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
==============================================================================
ARM Service Connection deployment scope - Resource Group
Checking if the following resource group exists: sampleloadappecnortheurope-rg.
Resource group exists: true.
Creating deployment parameters.
The detected encoding for file '/home/vsts/work/1/s/ARMTemplate/template.json' is 'utf-8'
The detected encoding for file '/home/vsts/work/1/s/ARMTemplate/parameters.json' is 'utf-8'
There was an error while overriding '' parameter because of 'TypeError: Cannot read property 'type' of undefined', make sure it follows JavaScript Object Notation (JSON)
There was an error while overriding '' parameter because of 'TypeError: Cannot read property 'type' of undefined', make sure it follows JavaScript Object Notation (JSON)
There was an error while overriding '' parameter because of 'TypeError: Cannot read property 'type' of undefined', make sure it follows JavaScript Object Notation (JSON)
(node:1662) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Starting template validation.
Deployment name is template-20230127-154830-30b0
There were errors in your deployment. Error code: InvalidDeploymentParameterKey.
##[error]One of the deployment parameters has an empty key. Please see https://aka.ms/arm-create-parameter-file for details.
##[warning]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Task failed while creating or updating the template deployment.. Please follow https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
Starting Deployment.
Deployment name is template-20230127-154830-30b0
There were errors in your deployment. Error code: InvalidDeploymentParameterKey.
##[error]One of the deployment parameters has an empty key. Please see https://aka.ms/arm-create-parameter-file for details.
##[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.
Finishing: AzureResourceManagerTemplateDeployment

Expected/desired behavior

The Pipeline should run successfully, creating the Azure Load Test resource.

OS and Version?

Azure Build Agent

Versions

ubuntu-latest

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Problem to open SampleApp.jmx in Apache JMeter (5.4.3)

This issue is for a: (mark with an x)

- [ X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

I cloned this repo and try to open the file SampleApp.jmx and SampleApp_Secrets.jmx using Apache JMeter 5.4.3

Any log messages given by the failure

Problem loading XML from:'C:\Repos\GitHub\nodejs-appsvc-cosmosdb-bottleneck\SampleApp_Secrets.jmx'.
Cause:
CannotResolveClassException: kg.apc.jmeter.threads.UltimateThreadGroup

Detail:com.thoughtworks.xstream.converters.ConversionException:
Debugging information
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message :
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:66)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.UltimateThreadGroup
line number : 32
version : 5.4.3

Expected/desired behavior

Open jmx file example using JMeter

OS and Version?

Windows 11

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.