we are using APIM premium version and ours is a active-active multi region setup. The problem we are facing is when one region UI calls another region API the calls failing because the subscription keys for the APIM on the both the region is different. is there a way I can set the subscription key for default subscription for the scope "service". I have tried the below powershell command from here but the second command fails saying the resource group not found, though from the first command its able to pull the details.
$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "<RGName>" -ServiceName "<apimname>"
Set-AzureRmApiManagementSubscription -Context $apimContext -SubscriptionId "<azuresubscriptionid>" -PrimaryKey "<key1>" -SecondaryKey "<key2>" -State "Active" -Scope "Service"
also I have checked this question, but the link in the answer shows 404.
Instead of resetting the APIM subscription keys is there anyother best practices that we can follow for these kind of scenarios ?
This article might help you achieve what you want. The user needed to have the same value for the subscription keys between two different environments. In order to do that, he enables the Management API and uses Postman to update the keys via a REST call.