Reputation: 1
This error "
WindowsAzure.MobileServices The resource you are looking for has been removed, had its name changed, or is temporarily unavailable"
Occurs when trying to retrieve records from an Azure SQL Db connected to a App Service. It occurs for below line of code
await SurveyResponseTable.PullAsync("SurveyResponse", SurveyResponseTable.CreateQuery()).ConfigureAwait(false);
where;
SurveyResponseTable = mClient.GetSyncTable<SurveyResponse>();
and
mClient = new MobileServiceClient(Constants.BackendUrl);
I have read every SO reference to this error but can find no solution. I am not sure whether the table on the Azure SQL Db has some difference to the class on the mobile client, whether a permissions problem or what.
So at this stage I am asking for suggestions as to how to debug, what to look for (can find nothing that helps me in the exception details). Or maybe how to create a table correctly on server side. I have seen when playing with the ToDoItem example that small things can stop successful connection such as misspellings, EF using plurals on server table name, lower case id etc. Tried all those things but still same error.
Azure SQL table structure;
CREATE TABLE [dbo].[SurveyResponses] (
[id] NVARCHAR (128) DEFAULT (newid()) NOT NULL,
[ThinkingStyle] NVARCHAR (128) NULL,
[ThinkingStyleA] NVARCHAR (128) NOT NULL,
[ThinkingStyleB] NVARCHAR (128) NULL,
[ResponseOrder] INT NOT NULL,
[ResponseGroup] NVARCHAR (128) NOT NULL,
[Question] NVARCHAR (128) NULL,
[ResponseA] NVARCHAR (512) NOT NULL,
[ResponseB] NVARCHAR (512) NULL,
[AzureVersion] ROWVERSION NOT NULL,
[CreatedAt] DATETIMEOFFSET (7) DEFAULT (sysutcdatetime()) NOT NULL,
[UpdatedAt] DATETIMEOFFSET (7) NULL,
[Deleted] BIT DEFAULT ((0)) NOT NULL,
CONSTRAINT [PK_dbo.SurveyResponses] PRIMARY KEY NONCLUSTERED ([id] ASC));
GO CREATE CLUSTERED INDEX [IX_CreatedAt]
ON [dbo].[SurveyResponses]([CreatedAt] ASC);
GO CREATE TRIGGER [TR_dbo_SurveyResponses_InsertUpdateDelete] ON [dbo].[SurveyResponses] AFTER INSERT, UPDATE, DELETE AS BEGIN UPDATE [dbo].[SurveyResponses] SET [dbo].[SurveyResponses].[UpdatedAt] = CONVERT(DATETIMEOFFSET, SYSUTCDATETIME()) FROM INSERTED WHERE inserted.[id] = [dbo].[SurveyResponses].[id] END
And here is the mobile client class;
public class SurveyResponse
{
public string id { get; set; }
public string ThinkingStyle { get; set; }
public string ThinkingStyleA { get; set; }
public string ThinkingStyleB { get; set; }
public int ResponseOrder { get; set; }
public string ResponseGroup { get; set; }
public string Question { get; set; }
public string ResponseA { get; set; }
public string ResponseB { get; set; }
[Version]
public string AzureVersion { get; set; }
[CreatedAt]
public DateTime CreatedAt { get; set; }
[UpdatedAt]
public DateTime UpdatedAt { get; set; }
}
Upvotes: 0
Views: 88