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?
I created one Azure MySQL Flexible Server with same properties as you in
West USlocation like this:To create Azure MySQL Flexible Server Replica in above server via CLI, I ran same command with
--locationargument and got response like this: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 USandWest USlocations:To check the installed version of Azure CLI, you can use
az versioncommand:In your case, check what CLI version you are currently using and upgrade it to latest version by running
az upgradecommand.When I tried to create replica in same location as the source server, it created successfully like below:
Response:
Reference: az mysql flexible-server replica | Microsoft