-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No parameter defined in the script or function for the input binding 'Timer'.Stack: #7
Comments
* Created a directory for Time Trigger and moved the related files. * Created a requirements.psd1 file to download the required modules. * Added information on the following issue. No parameter defined in the script or function for the input binding 'Timer'.Stack: · Issue Azure#7 · Azure/ha-nva-fo Azure#7 * The Resoruce Group of Meraki vMX is created on a per-instance basis. Therefore, the variable FWRGNAME is divided into FW1RGNAME and FW2RGNAME. * Added Meraki-specific supplementary information to README.
@myhomenwlab and @rlittler - not sure if you still use this function app, but I did find how to make it work with (now v4) function apps. I will write a PR once I'm all done, but for now here is the fix - just add 'param($Timer)' to the run.ps1 script. I placed it at line 44. Appreciate your PR @myhomenwlab, it definitely helped me along. Still having some issues but at least I was able to get the function app to run successfully. Edit - I spoke too soon. I now have additional issues, I believe related to the AzureRM cmdlets being deprecated. Going to switch to the Az cmdlets and see if that resolves the issues. Edit 2 - was able to get everything working except the mail alert. I can't get the Resolve-DnsName cmdlet to work, which is part of the DnsClient module that should be included with Windows machines. Minor issue, having the function app make the route table change is the main thing. |
Hi Scott, would you be able to share the script you got working? I have an updated version with the Az cmdlets but even though I've modified the requirements.psd1 file it still complains it doesn't understand the 'Connect-AzAccount' and 'Get-AzVM' cmdlets. I also thought of a couple of additional modifications I can make:
|
Hi Archie, Yes, I apologize on the delay - I will get a PR in soon. Using SendGrid is a good idea, and that's interesting about the Meraki failover - I kind of had that suspicion but do not have access to the Meraki dashboard (we have a MSP handle that unfortunately). I'd also like to add a more robust failover, using the VM status is not ideal - do you have any ideas on that? The folks who manage the Meraki said there's no TCP port status to monitor and the VM status is the 'only' way. Edit - please see PR 13 |
Thank you very much for sharing your amends on this script. With your script I still get the Timer parameter error unless I set the Azure function version to version 1. I also get errors with the new Az powershell modules Set-AzContext : The term 'Set-AzContext' is not recognized as the name of a cmdlet, function, script file, or operable program. |
To answer your question, we have found monitoring a Meraki vMX on it's public IP address on TCP/80 to be the best way to monitor the appliance is up and running. If you're interested take a look at the latest version of my script here (I've also updated the README with modern screenshots and instructions: |
Huh, that is odd... perhaps the deployment of the function app is different - I used VSCode to deploy the function app, which added some additional files that are not in my PR. The Timer parameter error should definitely go away if you add that $Timer param to the top of the script: The requirements.psd1 should take care of the Az cmdlets as well. You've set the function app to runtime v4? I honestly had a lot of problems with the deployment of the function app, that was new to me - using VSCode really helped with getting that deployed. I'll make another branch on my repo and commit all of those changes, maybe that will help you.
I will take a peek, thanks for the suggestion! Edit - seems port 80 is not exposed on the public IP... it is listening on the private IP. There's no NSG associated with the vMX appliance, so not sure why that isn't exposed on the public IP. |
Hi @expoearchie, Tried the function app with your code (thanks for sharing!) and "MyTimerTrigger" is getting errors with following messages: 2023-08-15 18:39:29.999 2023-08-15 18:39:30.079 Was hoping you could possibly know how to work around this, please? When testing the code it also returns the following error (together with other similar/related errors): 2023-08-15T20:07:36.095 [Error] Connect-AzAccount : The term 'Connect-AzAccount' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.at run.ps1: line 247+ Connect-AzAccount+ _________________+ CategoryInfo : ObjectNotFound: (Connect-AzAccount:String) [], CommandNotFoundException+ FullyQualifiedErrorId : CommandNotFoundException Thanks a lot in advance! |
@sneakyrussian - I was a bit lost on your other post, but there is more detail here - it appears you are missing the Az cmdlets. Do you have the requirements.psd1 file? |
Hi @ScottMonolith, Yes, I do and below are its contents. I've now implemented @expoearchie's code but errors were pretty much the same when using your latest "patch-meraki-vmx" code. requirements.psd1: This file enables modules to be automatically managed by the Functions service.See https://aka.ms/functionsmanageddependency for additional information.@{ |
Looks like it was failing due to timers function name being "myTimer" and line 44 in run.psd1 was referencing $Timer. Once that's sorted, the function runs fine in one Azure tenant but not in another, where it simply times out and/or throws the same error related to Az commands not being recognized. Any advise would be much appreciated. |
@sneakyrussian - not sure why that would need to be changed, my function app is running fine with $Timer as opposed to $myTimer. However the MS documentation does state $myTimer - and if it works, don't fight it. As for the Az cmdlets not being recognized, I would compare what you have done with the one Azure tenant vs the other. I'm guessing it's how the function app was deployed, but I am far from an expert on function apps - before this project I had never deployed a function app, and since this project I have not deployed any new ones! Edit - well this proves how bad I am with function apps. There is a 'function.json' file that specifies the name of the timer. Not sure how I messed this up and it still works, but in my deployed function app the timer is just called 'Timer': However, the function.json file it is set to 'myTimer'. Apologies for the mixup there, I'll get it corrected on my branch! Fixed. |
Azure function V3 does not support this function, downgrade to V1:
The instructions for downgrading your Azure function is as follows:
The text was updated successfully, but these errors were encountered: