@Zach Howell Thanks for your patience on this.
I am summarizing our offline conversation and posting the same as an answer for the benefit of other community members.
Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.
Issue:
Op(original Poster) was trying to create and update the app settings of the function using the above shared cmdlets and while updating the app setting it fails with the below error message "The Resource 'Microsoft.Web/serverFarms/WestUSPlan' under resource group 'my-resource-group' was not found"
Work Around/Mitigations Suggested:
Reviewed Op PowerShell Script and requested them to add another condition to check whether the function app is present or not before calling the az functionapp config appsettings set
to update the function app appsettings.
Op has modified the script and confirmed that it is working fine.
I hope this helps!
If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.