The requirement is to implement Cross-region replication using Azure MySQL Flexi server DB. From the Azure portal, have the option to choose a location while creating the replica.
The same replica creation we are trying to achieve via commands, getting the below issue. The source server is in the west region, would like to create a replica in the east region.
Note: Both primary and secondary servers are in the same RG.
az mysql flexible-server replica create --replica-name az-flexi-master-west-dr -g primary-DB --source-server az-flexi-master --location eastus
unrecognized arguments: --location eastus
followed this:https://learn.microsoft.com/en-us/cli/azure/mysql/flexible-server/replica?view=azure-cli-latest
Do we have the possibility to provide a location argument while creating the Azure mysql Flexi server replica?
Yes, it's possible to provide
--location
argument while creating Azure MySQL Flexible Server Replica. You can also create replica in the same location as the source server.
I created one Azure MySQL Flexible Server with same properties as you in West US
location like this:
To create Azure MySQL Flexible Server Replica in above server via CLI, I ran same command with --location
argument and got response like this:
az mysql flexible-server replica create --replica-name az-flexi-master-west-dr -g primary-DB --source-server az-flexi-master --location eastus
Response:
To confirm that, I checked the same in Portal where replica created successfully in East US location:
When I checked the resource group, it has both servers with East US
and West US
locations:
To check the installed version of Azure CLI, you can use az version
command:
In your case, check what CLI version you are currently using and upgrade it to latest version by running az upgrade
command.
When I tried to create replica in same location as the source server, it created successfully like below:
az mysql flexible-server replica create --replica-name az-flexi-master-west-dr -g primary-DB --source-server az-flexi-master1 --location westus
Response:
Reference: az mysql flexible-server replica | Microsoft