tl;dr: I have created one function app with private endpoints and vnet, but creating and deploying another fails because Virtual network associated with the link cannot be changed
Longer question:
I have created a Python 3.10 Function App with this instruction from Azure (up until Service Bus, just the Function App). I used the Elastic Premium plan in order to use Vnet and Private Endpoints. It works great!
However, I need to create another Function app in the same fashion, and when I try, I get the error
{ "status": "Failed", "error": { "code": "BadRequest", "message": "Virtual network associated with the link cannot be changed." } }
The error is the same for each one. I have tried several times, but the end result is the same. The function app technically still works, even though the deployment failed, but the FA loses access to the storage account if I change the storage account's network settings to only accept certain networks, even if the private vnet is configured for the storage account. (In the working FA, I can do whatever I want to the storage account's settings, and FA will still have access to it because of the vnet and the private endpoints).
Can I only have one elastic premium function app at the same time?
I'm willing to create a web app instead of a function app for my other use, but it will also require endpoints and the vnet, so I think I will encounter the same issue there.
(I saw this person had the same problem, but they didn't get an answer, and stackoverflow says I need 50 reputation points to comment there)
{ "status": "Failed", "error": { "code": "BadRequest", "message": "Virtual network associated with the link cannot be changed." } }
I tried your requirement with multiple scenarios:
When tried with scenarios 1
and 2
, I was getting the same error:
However when I tried to create the another function app a new hosting plan (premium plan), same storage account and the same virtual network, I was able to create the function app without any conflicts.
Function App 1:
Function App 2:
So, to create another Function App with the same VNet configuration and private endpoints, you have to create a new hosting plan(Premium) with the same Virtual Network.