0
votes

We are trying to sync an azure database and local SQL database using power shell. We are referencing the following URL for the sync process.

https://docs.microsoft.com/en-us/azure/azure-sql/database/scripts/sql-data-sync-sync-data-between-azure-onprem

Up to the database schema section, we can execute the script successfully. But when we execute the following code it is showing an error.

$newSchema  = [AzureSqlSyncGroupSchemaModel]::new()

Error is “InvalidOperation: Unable to find type [AzureSqlSyncGroupSchemaModel]”.

Even we used the following statement in the script it is still showing error.

using namespace Microsoft.Azure.Commands.Sql.DataSync.Model
using namespace System.Collections.Generic

We have researched a lot for a solution but couldn’t find a proper one yet. We had tried “[System.Reflection.Assembly]::LoadWithPartialName( “ option also, but this also not lead us to success. Please let us know if you have a solution. It would be very helpful for us.

2
How did you end up resolving this issue?cdimitroulas

2 Answers

0
votes

I know it's a bit old thread but wanted to provide an update if you are still looking for a response on it.

I believe it is related to this thread so I recommend you to check answer in it and see if it resolves your issue.

On the other hand, I recommend you to share the document enhancement feedback for this Azure document by clicking on "This page" option (shown in below screenshot) that's available at the bottom of the referred Azure document so that related document's author would review the feedback and consider enhancing the document as appropriate with a note or with a workaround for the issue.

enter image description here

0
votes

I was able to get around this by only including the one using statement:

using namespace Microsoft.Azure.Commands.Sql.DataSync.Model

In the rest of the code I used the fully qualified name for generic collections like System.Collections.Generic.List