Hello Team ,
Actually we have IAC infracture to deploy MYSQL DBaaS services. However the existing terraform modules now has been depreciated and we are trying to upgrade the latest terraform module to deploy the same.
Now the issue is:-
In the existing code we are using "azurerm_mysql_firewall_rule" but in latest terraform module same module has been depreciated.
We are trying to deploy the MySQL flexible server using terraform and want to create Virtual Network Rule for MySQL using powershell module "New-AzMySqlVirtualNetworkRule" but doesn't work it seems.
Can someone please help just to create the Virtual Network Rule for existing MySQL flexible server without creating DNS zone , Records , Private Endpoints ets?
I could not see any azure powershell API for the same.
Used code:-
$virtualNetworkRule = New-AzMySqlVirtualNetworkRule -ResourceGroupName $resourceGroupName `
-ServerName $serverName `
-VirtualNetworkRuleName "myVnetRule" `
-SubnetId $subnet.Id
Error:-
New-AzMySqlVirtualNetworkRule : Failed to perform 'write' on resource(s) of type 'servers/virtualNetworkRules', because the parent resource
/subscriptions/xxxxxxx/resourceGroups/xxxxxxxxxx/providers/Microsoft.DBforMySQL/servers/weemeasbxtestmysql1' could not be found.
Thanks ,
Abdul Kadir