Starting sometime around the end of June, 2024/ beginning of July, 2024 the Azure Postgres Flexible Server firewall can no longer be opened via the REST API by creating an open firewall rule starting and ending with 0.0.0.0. The Networking page of the Portal has also changed for newly created Servers. The older version shows a radio button for Connectivity Method, while the new one just shows a checkbox under Public Access which must be checked before the Allow public access from any Azure service checkbox becomes visible.
Reviewing the REST API documentation still states that a firewall rule with 0.0.0.0 must be created: REST API docs.
Is there a new procedure, via the REST API, for allowing a Postgres Flexible Server to be accessed from other Azure services without having to manually check the Allow public access to this resource checkbox?
2
Answers
It turned out that my issue was related to the REST API version I was using. I was using 2020-02-14-preview, which does not set the new Allow public access to this resource through the internet using a public IP address flag when creating a new server. Upgrading to the 2022-12-01 version of the API was a big headache, as many other things had changed:
* StorageProfile was renamed to Storage
* storageSizeGB is now a valid input (storageSizeMB was required, previously)
* HaEnabled = "Enabled" is now an object with Mode, State and StandbyAvailabilityZone attributes
And there seems to be no way to see which invalid attribute/ missing requirement is causing the deployment issues as the only error that is ever reported is An unexpected error occured while processing the request.
Once I got the new API version server create request working correctly the 0.0.0.0 firewall rule continued to work as expected.
Now also you can create new firewall rule starting and ending with 0.0.0.0 through Rest API with required details as shown below:
After successful running of the URL, it automatically enables Allow public access from any Azure service within Azure to this server option in server as shown below: