Skip to content
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

Azure Function V3 update caused PODE module to return 404 error #615

Closed
ramu20061992 opened this issue Oct 15, 2020 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@ramu20061992
Copy link

Describe the Bug

Azure Function V3 returning PODE 404 error with PS7 when we send http request using Azure function URL after Azure fucntions v3 platform update

Steps To Reproduce

Steps to reproduce the behavior:

  1. Host PODE API code in Azure function V3 app and then create functions Test (httptrigger)

  2. Store the PODE module in Modules folder in file content.Here is Test function used to test (run.ps1)
    param($Request, $TriggerMetadata)
    $endpoint = 'api/Test'
    Start-PodeServer -Request $TriggerMetadata -Type 'AzureFunctions' {
    Add-PodeRoute -Method Get -Path $endpoint -ScriptBlock {
    param($e)
    Write-PodeJsonResponse -Value @{ 'Value' = "I am Healthy! Go Ahead" }
    }

    Add-PodeRoute -Method Post -Path $endpoint -ScriptBlock {
    param($e)
    Write-PodeJsonResponse -Value @{ 'Data' = $e.Data['Name'] }
    }

    Add-PodeRoute -Method Put -Path $endpoint -ScriptBlock {
    param($e)
    Update-Thing -Name $e.Data['Name']
    }
    }

  3. Once we try to send http request, then we are getting 404 PODE error code

  4. In Azure function log, it looks function executed successfully , no error log is thrown.

Expected Behavior

The Azure function API using PODE should respond with correct response. The recent upgrade Azure functions (V3) changed this behavior and returning 404 error and function says it is executed successfully. They were working previously.

Screenshots

image
image

Platform

  • OS: Windows
  • Browser: Chrome, IE Edge
  • Versions:
    • Pode: Pode v1.8.3
    • PowerShell: PS7

Additional Context

We have hosted different functions in Azure Function V3 app using PODE frame work in a Sandbox. Everything works till May 2020 and we have not used that Sandbox environment till last week. After that Azure functions V3 platform upgraded in that gap and we tried to verify last week the function URLs and suddenly they are returning PODE 404 error. We also verified with latest PODE version 1.8.3 and still the same pode error.

@Badgerati
Copy link
Owner

Agreed, this does look like Functions V3 has changed something; the fact the 404 is on /api/ and not /api/Test is a little suspect 🤔 I'll do some digging and see what I can find.

@Badgerati Badgerati added this to the 1.8.4 milestone Oct 15, 2020
@Badgerati Badgerati self-assigned this Oct 15, 2020
@Badgerati
Copy link
Owner

Found it, in Functions 3.0 they have removed the sys property from the metadata (and they don't appear to have updated the docs to reflect this 🙄 ).

The function name is now aptly in a FunctionName property of the metadata, so if the sys check is empty, Pode will use the new one instead.

@ramu20061992
Copy link
Author

@Badgerati That is good catch. I have tested this with that logic and it works. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants