FunctionMonkey from service (MultiTargetting example)
In one of your repositories, you have an example project in the repository FunctionMonkeyMultiTargettingDemo. In that, you show a way of using functionmonkey as a base architecture that you can use in both azure functions, and also, an app service. I was able to get this running, but there's a couple questions:
-
If you are using servicebus, can it manage the call from the service bus to the command handler? Or, is this only usable when using azure function triggers?
-
is there a better way of adding the environment variables? launchSettings.json seems to work. I've not tried using the configuration manager? Potentially, add the environment variables like AbstractAcceptanceTest -> AddEnvironmentVariables? Obviously, if you deploy this into an azure app service, I can also just add it to the environment there as well
-
host.json - If using openapi, it works, but I can't get the host.json to work. Overall, the api itself seems to work when calling it (just the route is off, and I tried to add the host.json to get the routePrefix, but no luck)
Anyways, thanks for any feedback. Overall, was pretty cool to see it working between the two.
In case this helps anyone else, to fix the prefix, I added this to the csproj
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="copy $(ProjectDir)host.json $(OutDir)\..\" />
</Target>
Which allowed build to locate in order to get the expected api end point.
Thanks for trying this out and providing feedback. In answer to your questions:
-
Only HTTP triggers are supported at the moment but over the coming few months I'll be adding output binding support and then support for the other trigger types.
-
Yes my plan was to do something like AddEnvironmentVariables. In fact I thought I'd already written this! But on looking at the code it seems not.
-
I had on my list having a bit of a think about handling the routePrefix. I'd originally thought it might be one of the CompilerOptions but up for feedback and alternatives. I could copy host.json but it assumes you started from a Function app rather than the other way round.
-
thought that was the case (was looking at the integration tests), but I figured i'd ask just in case.
-
yep, well, the environmentmanager code is already there in the test project, which works, though if you change it to public that likely would solve the problem. for ensuring it would work, i just copied/pasted that class.
-
on that one, whatever works. potentially, store it in the environment kvp and pull from it (and have it check if it's there in host.json, if not, then check if there is one in the kvp env).
Thanks again for all the work, this has been a fun code/project to tinker with. solid architect, and easily works for helping isolation/boundary.