Giter Club home page Giter Club logo

Comments (4)

mark-abrams avatar mark-abrams commented on July 30, 2024 1

Hi @raunaknarooka , I've completed this change, please download package version 1.4.0 from Nuget: https://www.nuget.org/packages/LogicAppUnit/1.4.0.

Please let me know if this fixes your issue.

from testingframework.

mark-abrams avatar mark-abrams commented on July 30, 2024

Hi @raunaknarooka, thanks for logging this issue.

The framework is replacing the connectionRuntimeUrl value with a URL that points to the mock HTTP server. It does this by replacing the host name in the URL with the mock server's host name. But this assumes that the value of connectionRuntimeUrl is a valid URL in the first place. In your case it is not because you are referencing an app setting so that you can deploy the same connection file across multiple environments.

I can think of a few ways to fix this:

  1. if the value of connectionRuntimeUrl is @appsetting('<setting name>') then get the value of the referenced app setting, then replace the host name with the mock server's host name.
  2. if the value of connectionRuntimeUrl is more complex, for example something like https://@appsetting('CONN_HOSTNAME').common.logic-uksouth.azure-apihub.net/apim/outlook/@appsetting('CONN_SOMETHING_ELSE')/ then things get a little more complex to handle because you potentially need to find each instance of the app settings and hope that replacing with the app setting value gives you a valid URL.

Do all of your values of connectionRuntimeUrl fall into the first category?

from testingframework.

raunaknarooka avatar raunaknarooka commented on July 30, 2024

Hi Mark, thanks for reaching out. The connectionRuntimeurl is different for every logic app. It looks somewhat like: https://<some_value>.10.common.logic-westeurope.azure-apihub.net/apim/azureeventgrid/<some_value>. I construct this in the bicep file, like this:

 {
          name: 'EVENTGRID_CONNECTION_RUNTIMEURL'
          value: reference(azureEventGridConnection.id, azureEventGridConnection.apiVersion, 'full').properties.connectionRuntimeUrl
        }

The azureEventGridConnection is created using the following bicep resource:

resource azureEventGridConnection 'Microsoft.Web/connections@2016-06-01' = {
  name: eventGridConnectionName
  location: location
  kind: 'V2'
  properties: {
    displayName: eventGridConnectionName
    statuses: [
      {
        status: 'Ready'
      }
    ]
    parameterValueSet: {
      name: 'managedIdentityAuth'
      values: {}
    }
    customParameterValues: {}
    api: {
      name: 'azureeventgrid' 
      
      id: '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Web/locations/westeurope/managedApis/azureeventgrid'
      type: 'Microsoft.Web/locations/managedApis'
    }
    
    
  }
}

from testingframework.

mark-abrams avatar mark-abrams commented on July 30, 2024

Hi @raunaknarooka , I've had a think about this and I propose the following change when handling connection runtime URLs for managed connectors:

  1. If the value of the connection runtime URL does not include @appsettings then validate that the value is a URL and replace the host name with the mock HTTP server name. This is essentially what the framework does at the moment, but I've added (i) explicit validation of the runtime URL and (ii) a check for any @appsettings.
  2. If the value of the connection runtime URL does include @appsettings then replace the app settings values with those from local.settings.json. Then validate that the value is a URL and replace the host name with the mock HTTP server name.

Point 2 covers your scenario and will fix your issue.

from testingframework.

Related Issues (7)

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.