Hi Jacky Lam • ,
Welcome to Microsoft Q&A forum and thanks for using Azure services.
As I understand, you want to enable "Allow public access from Azure services and resources within Azure to this cluster" for Azure Cosmos DB for PostgreSQL Cluster using CLI.
We are sorry for the inconvenience that we don’t have native Azure CLI support enabled for Azure Cosmos DB for PostgreSQL yet.
That said, there’s a workaround. You can use REST API call wrapped into Azure CLI wrapper (az rest) to manage firewall rules.
For instance, to do this you would need to run the following command (these are placeholders that need to be replaced with actual values):
az rest --method put --url https://management.azure.com/subscriptions/{subscription_ID}/resourceGroups/{resource_group}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/{cluster_name}/firewallRules/AllowAllAzureIPAddressesRule?api-version=2022-11-08 --body @body.json
with the following content in body.json file
{
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
}
References:
REST APIs: Create or update firewall rules
We encourage you to share your feedback over the Azure Cosmos DB Feedback Channel which will help in getting the idea implemented by the concerned team depending upon the importance and up votes.
Hope this helps. Please let us know if you have further queries. Thank you.