I have an Azure Function which writes to an Azure SQL DB. Sometimes it works, other times I get an error...
Cannot open server 'removed' requested by the login. Client with IP address 'removed' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.
The function is running on a consumption plan and connects to SQL with managed identity. From what I understand the IP address won't stay the same and seemingly this is likely what it happening as sometimes it can connect and other times it can't.
Any ideas on how to make it always connect?