MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Additional Breaking Changes between 3.x and 4.x #114392

Open jasonbellz opened 1 year ago

jasonbellz commented 1 year ago

Environment: PowerShell (Windows or Linux) HTTP Trigger

When using function bindings similar to examples documented:

Example Binding Config: "name": "myDocument", "id": "{Query.id}", "partitionKey": "{Query.tenantid}",

When the document is not found in CosmosDB:

In 3.x within the PowerShell function we get a 404 on the Document Lookup, but control is handed to the PowerShell function which gives us the ability to if($myDocument){#Do Something#}

With 4.x we still see the 404 error on the Document Lookup but the Microsoft.Azure.Cosmos.Client now throws and error. The function is not allowed to run and we receive a 500 Internal Server Error. Since the PowerShell function never runs, we don't have the ability to do an existence test.

To solve for this, I have had to use the "sqlQuery" binding option.

If this is the expected behavior, it would be worth mentioning on this page and update the examples on the input binding page.

With the same code, I tested various 4.x versions of the extensions bundle including the latest (4.7). All exhibit the same behavior. As soon as I revert back to 3.x (and changed the associated binding names). It works as expected.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ManoharLakkoju-MSFT commented 1 year ago

@jasonbellz Thanks for your feedback! We will investigate and update as appropriate.