I am following this turorial and trying to link Function App to Static Web App. But I keep getting "Cannot link backend with a preexisting Azure Static Web Apps configuration."
.
However, I could link this Function App to another test Static Web App. And those two Static Web Apps are identical, well atleast I am pretty sure they are identical.
- When creating a Static Web app deploy routine I left api location empty –
api_location: ""
. - Static Web App is using Standart plan (not free).
EDIT
Adding Static Web App JSON view.
2
Answers
Issue may cause because of Read-only Lock under configuration setting
Created a new Static WebApp on West Europe Region
If any lock exists on Static Web Apps should not allow to add any backend APIs
Link new Backend APIs as Function App with Lock
After Removal of lock, Static Web Apps will allow to link new Backend
API Version check :
Regarding documentation:
"If a backend was previously linked to another static Web App, the auth configuration must first be removed from the backend before linking to a different Static Web App"
Check az staticwebapp backends validate:
https://learn.microsoft.com/en-us/cli/azure/staticwebapp/backends?view=azure-cli-latest
If you link your Static Web App (swa) with a backend and then remove the swa do not forget to go to "Settings" and remove "Authorization" from your backend (this setting was created automatically when you linked the swa but not removed when you delete it)