I am trying to set LTR on databases in our Managed Instances via the above listed Az commandlets. The problem I am having is determining what the ServerName parameter should be. If I try to use the ManagedInstanceName or FullyQualifiedManagedInstanceName it gives me the following error:
"Can not perform requested operation on nested resource. Parent resource '[instnaceName]/[databaseName]'"
What should I use for this parameter?
The problem was that I was using the wrong commandlet. The correct commandlet for Managed Instances is Get-AzSqlInstanceDatabaseLongTermRetentionPolicy