azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Update-AzCosmosDBAccount does not enable IP firewall rules on an account to be removed

Open plzm opened this issue 6 years ago • 6 comments

Reference https://github.com/Azure/azure-powershell/blob/master/src/CosmosDB/CosmosDB/CosmosDBAccount/UpdateAzCosmosDBAccount.cs#L175

For a scenario such as document at https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-configure-vnet-service-endpoint#migrate-from-firewall-to-vnet, existing IP firewall rules need to be removed from a Cosmos DB account.

Currently Update-AzCosmosDBAccount only processes parameter -IpRangeFilter if its length is greater than zero.

Should Update-AzCosmosDBAccount permit an empty array -IpRangeFilter to be passed and remove existing IP filter rules? If not, how is removal of IP rules supported?

plzm avatar Mar 26 '20 12:03 plzm

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kushagraThapar, @srinathnarayanan, @southpolesteve, @shurd.

ghost avatar Mar 26 '20 13:03 ghost

Targeting either S168 or S169.

MehaKaushik avatar Mar 30 '20 18:03 MehaKaushik

The updated (0.1.3) version of Update-AzCosmosDBAccount still does not allow for an existing IpRangeFilter on an account to be removed entirely.

Azure portal scenario:

  • Account has firewall rules; "Firewall and Virtual Networks" blade shows "Selected Networks" and various network rules --- Get-AzCosmosDBAccount shows IpRangeFilter corresponding to portal
  • To remove rules, switch to "All networks" and save --- Get-AzCosmosDBAccount shows empty IpRangeFilter

When running Update-AzCosmosDBAccount to try to remove IpRangeFilter (i.e. switch to All Accounts), consistently get error message.

Can Update-AzCosmosDBAccount be used to remove IP filters from a Cosmos DB account and switch to "All Networks" similar to Azure portal?

plzm avatar Apr 13 '20 14:04 plzm

Update-AzCosmosDBAccount

plzm avatar Apr 13 '20 14:04 plzm

Hey these changes would be reflected in the upcoming version, the current version of Az.CosmosDB was build before these changes were checked in. Upcoming version should be out in a week, would update here once it is.

MehaKaushik avatar Apr 13 '20 14:04 MehaKaushik

0.1.4 released https://www.powershellgallery.com/packages/Az.CosmosDB/0.1.4

MehaKaushik avatar Apr 21 '20 20:04 MehaKaushik