locked
Cannot access azure sql table from android by following quickstart guide RRS feed

All replies

  • Hi Abhigpcdnmi07,

    Thank you for bringing this to our attention. Are you using a Private DNS zone as part of this solution? Is this a production solution or are you working with a tutorial? If this is a tutorial, can yo provide a link to the documentation, as that will be helpful. There is currently an issue with the Private DNS service but wanted to get additional information from you in the case that this is not a Private DNS service issue.

    Thank you,

    Mike

    Friday, November 22, 2019 9:40 PM
  • Hi, 

    I guess, you are facing similar problem which is discussed in the below thread. Please let us know if that does not your issue.

    https://stackoverflow.com/questions/32954176/azure-mobileserviceinvalidoperation-exception-has-been-thrown


    -Malleswar

    Saturday, November 23, 2019 5:04 AM
  • I am not using Private DNS zones. Im working out a tutorial. the link for the tutorial is https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-android-get-started. Any help will be appreciated. Thanks in advance

    abhigpcdnmi07

    Wednesday, November 27, 2019 7:15 PM
  • I can reproduce this and the issue is that there is no means to create the ToDoItems table, or a means to create the appropriate database for the Quickstart to complete successfully. This affects all Quickstart and Tutorial documentation that rely upon this table schema to function properly.

    Azure SQL Database has an AdventureWorksLT sample database you can choose to deploy but it does not have an option to deploy a dataset called ToDoItems.

    I was specifically following the Create a Xamarin.Android App tutorial with .NET backend which does not implement Easy Tables.

    The Cosmos DB service has the ToDoItems database and I will convert that to a T-SQL script that you can use to complete the tutorial. I am also going to bring this to the attention of the product group.

    Regards,

    Mike

    Wednesday, November 27, 2019 11:00 PM
  • I believe you have created a ToDoItems Easy Table entry but the table does not exists in the Azure SQL Database instance the Easy Tables is connected to. There is a larger issue with all the Azure Mobile App tutorial variants where this table schema is needed. 

    Wednesday, November 27, 2019 11:14 PM
  • I skimmed the "Create a Xamarin.Android App" and thought I might try it until I hit

    Download the client SDK quickstarts for the following platforms:

    iOS (Objective-C)
    iOS (Swift)
    Android (Java)
    Xamarin.iOS
    Xamarin.Android
    Xamarin.Forms
    Cordova
    Windows (C#)

    Really? What is all this stuff and why do I need it just to make a connection?



    Mary

    Sunday, December 1, 2019 11:07 AM
  • Hi Mary,

    There should be a single T-SQL script available to each of the O/S specific tutorials to create the SQL schema for the tutorial to complete successfully. 

    In the case where there is an Easy Table implementation, there still needs to be a table schema to exist for Easy Table to sync with. I think that is the issue your case. Not all tutorials use Easy Tables. This is my observation. 

    If you were to create the table schema manually, I believe the tutorial would complete successfully. 

    Regards,

    Mike

    Monday, December 2, 2019 7:14 PM
  • The following T-SQL will create a database with the name: 

    DotNetAppSqlDb20191209114156_db

    /****** Object:  Database [DotNetAppSqlDb20191209114156_db]    Script Date: 12/9/2019 12:02:29 PM ******/
    CREATE DATABASE [DotNetAppSqlDb20191209114156_db]  (EDITION = 'Standard', SERVICE_OBJECTIVE = 'S0', MAXSIZE = 1 GB) WITH CATALOG_COLLATION = SQL_Latin1_General_CP1_CI_AS;
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET ANSI_NULL_DEFAULT OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET ANSI_NULLS OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET ANSI_PADDING OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET ANSI_WARNINGS OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET ARITHABORT OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET AUTO_SHRINK OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET AUTO_UPDATE_STATISTICS ON 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET CURSOR_CLOSE_ON_COMMIT OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET CONCAT_NULL_YIELDS_NULL OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET NUMERIC_ROUNDABORT OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET QUOTED_IDENTIFIER OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET RECURSIVE_TRIGGERS OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET ALLOW_SNAPSHOT_ISOLATION ON 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET PARAMETERIZATION SIMPLE 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET READ_COMMITTED_SNAPSHOT ON 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET  MULTI_USER 
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET ENCRYPTION ON
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET QUERY_STORE = ON
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET QUERY_STORE (OPERATION_MODE = READ_WRITE, CLEANUP_POLICY = (STALE_QUERY_THRESHOLD_DAYS = 30), DATA_FLUSH_INTERVAL_SECONDS = 900, INTERVAL_LENGTH_MINUTES = 60, MAX_STORAGE_SIZE_MB = 100, QUERY_CAPTURE_MODE = AUTO, SIZE_BASED_CLEANUP_MODE = AUTO, MAX_PLANS_PER_QUERY = 200, WAIT_STATS_CAPTURE_MODE = ON)
    GO
    
    ALTER DATABASE [DotNetAppSqlDb20191209114156_db] SET  READ_WRITE 
    GO

    The following creates the table:

    Todoes


    /****** Object:  Table [dbo].[Todoes]    Script Date: 12/9/2019 12:05:20 PM ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE TABLE [dbo].[Todoes](
    	[ID] [int] IDENTITY(1,1) NOT NULL,
    	[Description] [nvarchar](max) NULL,
    	[CreatedDate] [datetime] NOT NULL,
     CONSTRAINT [PK_dbo.Todoes] PRIMARY KEY CLUSTERED 
    (
    	[ID] ASC
    )WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO

    If you follow this tutorial: Tutorial: Build an ASP.NET app in Azure with SQL Database

    You can create the database and then redirect the Android tutorial to connect to this Azure SQL instance.

    ~Mike

    Monday, December 9, 2019 8:09 PM