Comments (4)
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.
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:
- 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. - if the value of
connectionRuntimeUrl
is more complex, for example something likehttps://@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.
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.
Hi @raunaknarooka , I've had a think about this and I propose the following change when handling connection runtime URLs for managed connectors:
- 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
. - If the value of the connection runtime URL does include
@appsettings
then replace the app settings values with those fromlocal.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)
- Mock large message (>1kb) handling in create blob v2 action HOT 11
- testConfiguration.json should not be empty? HOT 3
- Getting an error when authentication type is ManagedServiceIdentity HOT 2
- Performance of Unittests if you have plenty HOT 2
- Conditional mock of "external service" HOT 2
- CallAzureFunctionEndpoint returns 'No such host is known.'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testingframework.