We are attempting to upgrade a version of Workflow Manager and receiving the following error when running the Invoke-SBFarmUpgrade command. We have not been able to find any information associated with the GetQuotaFunc function at all.
<Message>Admin role operation warning message: There was an exception executing the sql command text. Exception: System.Data.SqlClient.SqlException (0x80131904): Cannot find either column "dbo" or the user-defined function or aggregate "dbo.GetQuotaFunc",
or the name is ambiguous.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Cloud.ServiceBus.Admin.Sql.SqlSchemaInstaller.RunSqlScriptWithoutTransaction(String[] scriptFileLocations, Int32 commandTimeout)
ClientConnectionId:c54349c7-e82d-4e86-9526-d1e1269d279e
Error Number:4121,State:1,Class:16. SQL command text:
with NamespaceNHSize
as
(
select [ServiceNamespace],
Sum(RegistrationCount) as ActiveRegistrationsCount,
[dbo].GetQuotaFunc(N'maximumnumberofdevicespernamespacefordeveloper', [ServiceNamespace]) as NewQuotaValue,
[dbo].GetQuotaFunc(N'maximumnumberofregistrationspernamespace', [ServiceNamespace]) as OldQuotaValue
from NotificationHubsTable
group by ServiceNamespace
)
merge [dbo].[Tenants] as T
using NamespaceNHSize as S
on (T.[ServiceNamespace] = S.[ServiceNamespace])
when MATCHED
then update set T.[NotificationsSKU] = (CASE
when (S.[ActiveRegistrationsCount] >= 10000 or S.[NewQuotaValue] > 10000 or S.[OldQuotaValue] > 10000)
then 3
when (S.[ActiveRegistrationsCount] >= 100)
then 2
else 1
End );
..</Message>