0

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; }

}
Bas H
  • 2,114
  • 10
  • 14
  • 23
scott
  • 1
  • 3
  • I don’t know anything about Azure, but are you able to take the original example, and get it to work, without any changes? Or get any example to work? There must be some way to get some working table… then you’d have a working case to compare to. – ToolmakerSteve Dec 19 '21 at 16:21
  • yes I might have to do that Steve. I originally did that but was thinking I could just manually create them now having "learnt" from the sample, however seems I still dont have it worked out so hopefully someone can list out the things you have to ensure you do or best way to create them. In the meantime I will follow your advice and start from the sample. thanks – scott Dec 21 '21 at 08:45
  • 1
    I've deployed ToDoItem quickstart and works fine communicating with back end dbase. So copy its code, change its name and via database first update the Db and create the exact same table but with different name and use Postman get error 404 not found. There's other things going on that I can't work out. Reading @AdrianHall docs and still googling – scott Dec 22 '21 at 09:27
  • I think I will investigate Db schema and maybe try migration to create a table. https://stackoverflow.com/users/1313441/adrian-hall – scott Dec 23 '21 at 21:59
  • I will ask this question another way to see if I can get suggestions – scott Dec 24 '21 at 11:01

0 Answers0