diff --git a/pkg/deploy/generator/resources_rp.go b/pkg/deploy/generator/resources_rp.go index 2ce8fac443b..9a4c13b2f39 100644 --- a/pkg/deploy/generator/resources_rp.go +++ b/pkg/deploy/generator/resources_rp.go @@ -1112,7 +1112,7 @@ func (g *generator) database(databaseName string, addDependsOn bool) []*arm.Reso } if !g.production { - database.Resource.(*sdkcosmos.SQLContainerCreateUpdateParameters).Properties.Options = &sdkcosmos.CreateUpdateOptions{ + database.Resource.(*sdkcosmos.SQLDatabaseCreateUpdateParameters).Properties.Options = &sdkcosmos.CreateUpdateOptions{ AutoscaleSettings: &sdkcosmos.AutoscaleSettings{ MaxThroughput: to.Int32Ptr(1000), }, diff --git a/pkg/util/arm/marshal.go b/pkg/util/arm/marshal.go index 6eecbce86fc..658492b8e31 100644 --- a/pkg/util/arm/marshal.go +++ b/pkg/util/arm/marshal.go @@ -21,7 +21,11 @@ func (r *Resource) MarshalJSON() ([]byte, error) { // hack to handle newer track2 sdk which doesn't have json tags if strings.HasPrefix(r.Type, "Microsoft.DocumentDB/databaseAccounts/sqlDatabases") { - b, err = r.Resource.(*sdkcosmos.SQLContainerCreateUpdateParameters).MarshalJSON() + if reflect.TypeOf(r.Resource) == reflect.TypeOf(&sdkcosmos.SQLDatabaseCreateUpdateParameters{}) { + b, err = r.Resource.(*sdkcosmos.SQLDatabaseCreateUpdateParameters).MarshalJSON() + } else if reflect.TypeOf(r.Resource) == reflect.TypeOf(&sdkcosmos.SQLContainerCreateUpdateParameters{}) { + b, err = r.Resource.(*sdkcosmos.SQLContainerCreateUpdateParameters).MarshalJSON() + } } else if strings.HasPrefix(r.Type, "Microsoft.DocumentDB/databaseAccounts") { b, err = r.Resource.(*sdkcosmos.DatabaseAccountCreateUpdateParameters).MarshalJSON() }