Setting up Azure SQL DB - Auditing w/ Mobile Services

I'm trying to set up Azure SQL DB - Auditing which requires a secure connection string to used by the client to actually do the logging. In my case that client is mobile services. I can see the current connection string that is used but I cannot modify it when
trying to configure mobile services in the azure portal. I'm using a nodejs back end.
I'm trying to follow the instructions here: azure.microsoft.com/en-us/documentation/articles/sql-database-auditing-get-started/
Is there some other way you change the connection string?
Thanks! 

Hi,
As far as I am aware, when you set the webapp/cloudapp to connect to a database you will have to specify the connection string in the app. The app will hit the database which is mentioned in the  connection string you have specified. So it is not automatic
or Traffic manager. You have full control over it as you can tell your app to connect whichever database you want.The database could be located in any region, however the you have to keep latency in mind as the app in US Datacenter could be calling the Database
in EU, if that is  they way it is setup.
You can have separate databases in each region and use Azure Data Sync
to have the database synchronized, however please keep in mind that Azure Data Sync is in Preview.
Regards,
Mekh.

Similar Messages

  • How do I set up Azure Sql Server to have multiple instances?

    Hi all;
    We are setting up a new SAAS application on Azure and while we have used Azure before, not at this level of multiple apps, etc.
    We plan to have both a web app and a cloud app in both a US and EU data center. They need to hit a common database because requests will go to the closest data center via traffic manager and a lot of the data works off of the customer table. And a customer
    (company) can have users in both the U.S. and E.U.
    Is there a way to set up Azure Sql Server so it has instances in both data centers, and Azure keeps them synchronized? If I understand sharding right, that is not what we need as someone hitting either data center could be requesting any of the data in the
    DB.
    thanks - dave
    What we did for the last 6 months -
    Made the world's coolest reporting & docgen system even more amazing

    Hi,
    As far as I am aware, when you set the webapp/cloudapp to connect to a database you will have to specify the connection string in the app. The app will hit the database which is mentioned in the  connection string you have specified. So it is not automatic
    or Traffic manager. You have full control over it as you can tell your app to connect whichever database you want.The database could be located in any region, however the you have to keep latency in mind as the app in US Datacenter could be calling the Database
    in EU, if that is  they way it is setup.
    You can have separate databases in each region and use Azure Data Sync
    to have the database synchronized, however please keep in mind that Azure Data Sync is in Preview.
    Regards,
    Mekh.

  • Connect to Azure Sql DB through WCF Data Service

    I am following the tutorial:
    http://msdn.microsoft.com/en-us/library/windowsazure/ee621789.aspx;
    Connect to Windows Azure SQL Database Through WCF Data service on a
    Windows 8 machine running VS2013.  Until starting this tutorial, I have only been using VS for WPF applications. So it might not be properly configured for a web app.
    Everything works just fine until I get to the section on Creating the Client Application.  Clicking the Discover button populates the services pane with my service.  When I click on the service in the pane I get the following Add Service Reference
    Error:
    There was an error downloading 'http://localhost:62778/testDataService.svc/_vti_bin/ListData.svc/$metadata'.
    The request failed with the error message: --- , . . .
    If I ignore it and click OK it essentially tells me the same thing:
    "There was an error downloading metadata from the address.  Please verify that you have entered a valid address."
    I am thinking that there is a configuration issue on my machine.  Perhaps something needs to be installed or running, . . .
    I have tried doing the same steps with a local SqlExpress database, and get the same problem.  If I try to go directly to the website via the browser:
    http://localhost:62778/testDataService.svc
    I get a Request Error.
    Any suggestions, thoughts on this will be greatly appreciated!
    Robotuner

    Hi,
    From the error message "There was an error downloading 'http://localhost:62778/testDataService.svc/_vti_bin/ListData.svc/$metadata'.", I suspect that you created a folder named _vti_bin, and created wcf data service named ListData, in my test
    application, from my experience, you issue may be caused by "$metadata", can you give further information to me, there was a
    wcf data service quick start, hope this will help you.
    Best Regards 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SQL Server Audit Feature for SQL Azure

    What is the status of support for SQL Server Audit features in SQL Azure?  If auditing is supported in SQL Azure, can you point me to some resources that describe best practices for using auditing in SQL Azure?

    New feature in Azure SQL Database!
    Azure SQL Database Auditing tracks database events and writes audited events to an audit log in your Azure Storage account. Auditing is available in preview for Basic, Standard, and Premium service tiers. Auditing can help you maintain regulatory compliance,
    understand database activity, and gain insight into discrepancies and anomalies that could indicate business concerns or suspected security violations.
    See Get started with SQL database auditing
    http://azure.microsoft.com/en-us/documentation/articles/sql-database-auditing-get-started/
    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

  • Row-Level Security announced for Azure SQL Database

    The announcement:
    Next generation of Azure SQL Database service in staged general availability; Row-Level Security in public preview
    We’ve announced the general availability of the latest update to Azure SQL Database (V12). This service update is now generally available in the North Europe and West Europe datacenters, will be generally available across regions in the United States on February
    9, 2015, and will be rolled out worldwide by March 1, 2015. General availability pricing will take effect for servers on V12 worldwide on April 1, 2015. This service update introduces near-complete SQL Server engine compatibility, greater support for larger
    databases, and expanded Premium performance.
    The description topic is at
    http://msdn.microsoft.com/library/dn765131 Row-level filtering of data selected from a table is enacted through a security predicate filter defined as an inline table valued function. The function is then invoked and enforced by a security policy. Also
    see the Transact-SQL topic CREATE SECURITY POLICY at
    http://msdn.microsoft.com/library/dn765135
    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

    Hi Rick,
    Thanks for your information.
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • How to Use Mobile Service in HTML/JavaScript Application

    The Windows Azure Mobile Service is a back end tool for mobile applications. It supports various platforms, such as Windows Store, Windows Phone 8, iOS and Android. The Windows Azure
    Mobile service can also support HTML/JavaScript. This article helps you to get a basic idea of how to use the Windows Azure Mobile Service in HTML/JavaScript applications.
    Let us start with a Quick startup project provided by Microsoft. A Quick startup is a simple demo project that can help us to understand how to use the Windows Azure Mobile Service with HTML/JavaScript. So let's start from the Quick startup project.
    Login into in the Windows Azure portal and use the following procedure.
    This article assumes you already have a Windows Azure account and the mobile service is enabled in your account.
    1. Create a new Windows Azure Mobile Service
    Click on the +New button from the left corner and select Compute -> Mobile Service and then click on the "Create" button.
    The Windows Azure portal popup creates a mobile service wizard when you click the Create button. Windows Azure asks you to enter the mobile service name as shown in the following image:
    Select the database options and region for your mobile service and click on the "Next" button.
    Once your mobile service is successfully created, the portal will show all your mobile services as shown in the following images.
    Ok! We have created a new mobile service successfully. Let's move to our subsequent steps.
    1. Quick startup Project 
    As we all know, the Windows Azure Mobile Service can support many platforms such as Windows Store, Windows Phone 8, iOS, Android and HTML/JavaScript. This article only tells us about the new HTML/JavaScript platform that is recently added to the Windows Azure
    Mobile Service.
    In the image above, we are in the quick startup page where the Windows Azure Mobile Service allows the user to choose their platform. I have selected the HTML/JavaScript Platform.
    In the image above, we found 3 quick steps that can allow us to run <g class="gr_ gr_74 gr-alert gr_gramm Grammar" data-gr-id="74" id="74">a HTML/JavaScript</g> sample project. 
    1. Create Table: In this step the user needs to create a table that can used by the sample project, once you hit the create TodoItem Table button. The Portal will create a TodoItem table in your mobile service. You
    can check this table by clicking on the data tab(menu).
    2. Download and run your app: In this step the user needs to download the Quick startup project that is provided by the Windows Azure portal. Click on the "Download" button and download the project. You will
    see the following files in the quick startup project.
    The Server folder contains some files to setup this project locally. The user should run the file from the server folder corresponding to their OS. I am using Windows OS so I ran the <g class="gr_ gr_80 gr-alert gr_spell ContextualSpelling ins-del multiReplace"
    data-gr-id="80" id="80">lanch</g>-<g class="gr_ gr_79 gr-alert gr_spell ContextualSpelling ins-del multiReplace" data-gr-id="79" id="79">windwos</g> file to setup this project locally in
    IISExpress.
    Press r and enter the key, you will see IISExpress started. Do not close this Windows and open your browser and request the http://localhost:8000/ page.
    Enter the Item name and click on the add button. Your Item will be added to the TodoItem table.
    3. Configure your host name: This step is a very important step for any HTML/JavaScript application that uses the Windows Azure Mobile Service. In this <g class="gr_ gr_83 gr-alert gr_gramm Punctuation only-ins
    replaceWithoutSep" data-gr-id="83" id="83">step</g> the user must register their website name in the Cross-origin resource sharing (CORS). By default, "localhost" is added by the Windows Azure Mobile Service
    so your quick startup project can run without making any CORS setting changes. The user can add their website domain name by clicking on the configure tab (menu).
    The user can add as many website domain names as needed.

    are you asking a question or did you just post a tutorial here? you might want to post it as a blog post or wiki entry instead.

  • Database Initialiser does not create azure sql database

    I have a WPF application In the OnStartup in the app.cs I set the Database initializer and forced the context the initialise my database:
    Debug.WriteLine("Setting Initializer");
    Database.SetInitializer<MyContext>(new MyDatabaseInitializer());
    Debug.WriteLine("Declaring new context");
    using (MyContext c = new MyContext("MyContext"))
    Debug.WriteLine("Force the initialization");
    c.Database.Initialize(true);
    Debug.WriteLine("Done!");
    I created a sql database in the management portal of the azure.
    Copied the connectionstring it provided for ADO.net.
    But my database is not created.
    I also added a firewall rule but nothing happens. I Have no clue what to do.
    Can anybody please help me with this?
    If you need more information please ask i really have to get this sorted out.
    Thanks in advance!

    Hi Turkstra,
    I have tried to use EF to create Azure SQL database, it works as expect, the database 'jambordbcreate' appear in my SQL Azure, below is the detailed codes.
    using System;
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace CodeFirst
    class Program
    static void Main(string[] args)
    Database.SetInitializer(
    new CreateDatabaseIfNotExists<SchContext>());
    using (var db = new SchContext("Server=tcp:****.database.windows.net,1433;Database=jambordbcreate;User ID=vote@***;Password=***;Trusted_Connection=False;Encrypt=True;Connection Timeout=30"))
    string name = "jambor";
    var student=new Student(){Name=name, ID="1a"};
    db.Students.Add(student);
    db.SaveChanges();
    db.Database.Initialize(true);
    public class Student
    public string ID { get; set; }
    public string Name { get; set; }
    public string age { get; set; }
    public string sex { get; set; }
    public class School
    public string ID { get; set; }
    public string Name { get; set; }
    public virtual List<Student> Students { get; set; }
    public class SchContext : DbContext
    public SchContext(string connection):base(connection)
    public DbSet<Student> Students { get; set; }
    public DbSet<School> Schools { get; set; }
    I suggest  you check your SQL connection, after run your code, please refresh azure portal to see whether your database is exist. Hope this give you some help.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cannot connect to Azure Mobile Services as DataSource

    I've created an Azure Mobile Service which is using .NET backend.
    Project Siena isn't able to connect or work against this kind of data source.
    Error message is
    An error occurred connecting to Azure Mobile Service
    I have also tried to create zz_config support table, and implement a custom TableController for serving the URI
    tables/zz_config but I could only got few steps further, still without the possibility to read and use the model exposed by Mobile Services
    This behavior has been reproduced with both Beta 2 and Beta 3
    P.S. Adding the AMS as REST data source makes possible to import and use the model exposed. The operation of association in this case must be done per-table in Siena
    Wheb can we expect Siena to work well together with the new version of Azure Mobile Services?
    Massimo Prota
    .NET MCAD - SP2007 MCTS - SP2010 MCPD and MCITP
    My blog: http://blogs.ugidotnet.org/mprota - Twitter:
    @massimoprota

    Yes, that article is indeed precise and updated. I followed all steps described properly, especially for the part about setting up the database structure, and create
    zz_config table (second post of the series)
    I can connect to AMS (JS Backend) with Siena, but tables' names aren't showing up correctly, but display as
    undefined, and from there on doesn't work properly.
    JSON object returned from GET /tables/zz_config?$filter=(Key%20eq%20'table') 
    "id": "ccb9c9a8-9bae-41c8-87aa-277e2e0d1379",
    "key": "table",
    "value": "users"
    I do confirm I have the same (incorrect) behavior using a .NET Backend where I set up
    zz_config table and create a TableController mapped with it; with route
    tables/zz_config
    I confirm also I had the same behavior this morning with Beta 2, before I installed Beta 3.
    P.S. The error message reported in my first post is returned only when the table
    zz_config isn't setup correctly on AMS
    Massimo Prota
    .NET MCAD - SP2007 MCTS - SP2010 MCPD and MCITP
    My blog: http://blogs.ugidotnet.org/mprota - Twitter:
    @massimoprota

  • SQL connection errors when stress testing mobile service: SQL failure after 3 attempts

    I have created a Mobile Service (node.js), which has been running for a few months with 50-100k api calls per day with no issues.
    The usage of the service will be scaled up soon, and it will receive much higher traffic, so I am running stress tests (on a staging deployment of the same service).
    The api in question queries data from the sql database that is attached to the mobile service, but caches the resulting data in a redis database for 5 minutes, so each call with identical parameters will not access the SQL database, just the redis cache.
    My first test never has any problems:
    Run a single api calls as fast as possible using the program wrk (https://github.com/wg/wrk). This test never has a problem, and I have run it an hour continuously with a sustained rate of 200 req/s and very few timeout errors.
    The second test always causes problems:
    I created a list of 5 different api calls to the same service (same endpoint, but different parameters), and I run those randomly interweaved as fast as possible. I use the program locust (http://locust.io) for this, spawing 10.000 clients at a rate of 500
    per second. For the first few seconds everything goes ok, but then connections start failing massively.
    I get mostly:
    Error: SQL failure after 3 attempts. Error: [Microsoft][SQL Server Native Client 10.0]TCP Provider: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected
    host has failed to respond.
     (SqlState: 08001, Code: 10060)
    And I see this in the http response:
    ConnectionError(ProtocolError('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known')),)
    The strange thing is that since I am running the same five calls repeatedly, only the very first of each call will actually access the sql database, every subsequent call will just return data directly from redis, and not try to access the sql database at
    all.
    In the azure console for the sql database in question, I see 1860 successful connections and 11 failed connections, which does not explain the massive failure rate I am seeing.

    Thanks for sharing your tips on this forum, as it will be useful for other users, that run into this issue.
    Feedback like this will also help us improve error reporting in the next release, as missing class files in the packaged application is a common issue when developers are moving from the embeded oc4j instance packaged with JDewveloper to standalone instances.
    -Eric

  • Puzzle: TRY_CAST in Azure SQL, TRY_CONVERT in SS 2012?

    For a while I thought Azure SQL T-SQL is a subset of SQL Server 2012 T-SQL. Not so.... It has its own individuality!
    Related blog:
    http://raresql.com/category/sql-server-2012/built-in-functions/conversion-function/
    Kalman Toth Database & OLAP Architect
    Paperback / Kindle: Windows Azure SQL Database Programming & Design

    Cancel question. TRY_CAST() works in SQL Server 2012 and SQL Server 2014.
    SET DATEFORMAT dmy;
    SELECT TRY_CAST('12/31/2010' AS datetime2) AS Result;
    GO
    -- NULL
    SET DATEFORMAT mdy;
    SELECT TRY_CAST('12/31/2010' AS datetime2) AS Result;
    GO
    -- 2010-12-31 00:00:00.0000000
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Azure SQL Data Sync, LINQ optimization bug

    How can I report the following Bug ?
    var empty = new Set<int>();
    var query = storage.table.Where(item => empty.Contains(item.id));
    // Entity Framework Extended
    query.DeleteAsync()
    The query is optimized to something like this, because the set is empty, and therefore the result set is always empty:
    SELECT
    CAST(NULL AS uniqueidentifier) AS [C1],
    CAST(NULL AS uniqueidentifier) AS [C2],
    CAST(NULL AS int) AS [C3],
    CAST(NULL AS int) AS [C4],
    CAST(NULL AS datetime2) AS [C5],
    CAST(NULL AS varchar(1)) AS [C6],
    CAST(NULL AS int) AS [C7]
    FROM ( SELECT 1 AS X ) AS [SingleRowTable1]
    WHERE 1 = 0
    Now the problem is that update and delete trigger, introduced by Azure SQL Data Sync, will fail because they require the primary key, which is not part of the optimized query. Meaning that when the set is empty the triggers will fail, but if the set contains
    an id, the query is not optimized and therefore will succeed.
    (SELECT [i].[PrimaryKeyId] FROM DELETED AS [i])
    Notice, the problem here is not Entity Framework Extended from my perspective, but the Azure SQL Data Sync Triggers! 

    not sure if i understood your post correctly, but the columns available in the logical inserted and deleted tables available in the trigger are the actual columns of the table itself, not the columns in the query that caused the trigger to fire.

  • Connecting to Azure SQL database in Access 2010

    I've recently purchased a new computer and I had an OBDC connection set up to link to a sql database in azure through access. I am trying to set it up on my new computer but I'm unable to define the specific database. I'm able to make the connection but
    it only allows me into the master database. I've added my IP address in the configure servers but still can't get things to work. Any help would be greatly appreciated.
    thanks
    Lynn

    Hi,
    The following guidelines apply to SQL Database connections using ODBC:
    • When using SQL Server Native Client from SQL Server 2008 R2 or SQL Server 2008, the connection string must include the server name as part of the user name (user@server).
    • You must use TCP/IP as the protocol when connecting to an Azure SQL Database.
    • You cannot create a table in the master database, so therefore you must create a user database to create a table.
    • You cannot execute a use database command to switch to your user database. You must disconnect and connect directly to the user database.
    • You must have a primary key or clustered index on your table to be able to insert data.
    Ref:
    https://msdn.microsoft.com/en-us/library/azure/hh974312.aspx?f=255&MSPPError=-2147217396
    http://blogs.office.com/2010/06/07/access-2010-and-sql-azure/
    https://support.microsoft.com/en-us/kb/2028911/
    Hope this helps you.
    Girish Prajwal

  • Azure AAD Mobile Service Authentication with corporate accounts fails.

    I have been having on-going issue with Authenticating against a Windows Azure mobile service with corporate accounts.
    Here is the complete environment.
    Initially we set up with Office 365 / CRM Online / and Azure for our corporate infrastructure. We have set up single sign on. Everything works well. There is ADFS set up and running to allow us to Authenticate with {username}@{companyDomainName} and everything
    works, including single signon. 
    Along comes Azure Active directory. We have an Automatically created Azure active directory in the corporate azure account. The domain is the default created {accountname}.onmicrosoft.com domain structure. This is set as the Default directory.
    We had a consultant come in, who was organized through Microsoft, to do some work. After everything was set and done we ended up with another active directory created in Azure that is named with the corporate domain name. This second domain has had all of
    the corporate accounts synched to it. 
    I have now created an Azure Mobile Service. The service is a basic service, I haven't updated any of the code yet, except to publish the service. I have followed all of the configuration instructions for setting up the authentication. 
    If configure the Authentication to point at the first active directory, I am able to Authenticate against the service using the credentials for a user that has been created in that domain. The Authentication works correctly, and goes through.
    However if I switch the configuration to use the second Active Directory, the one with the corporate accounts synched to it, the authentication fails. I am able to enter my corporate email address into the web page that is presented. Then the web control
    started to call into the ADFS in order to authenticate the corporate user name and password. At this point the authentication fails with a message about the service not being available.
    The login code is the standard:
    user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory);
    The project is a Universal Application as the service needs to be available from both a phone and a desktop. The project was started from the starter project downloaded form the Mobile Service site.
    # Update
    I've just switched the mobile service configuration back to use the AAD with the corporate accounts synchronized. The login through the application fails. However if I log in through IE by browsing to : https://{ServiceName}.azure-mobile.net/login/aad
    The authentication goes through correctly. 

    A few questions on the details:
    What client platform are you using for login. In particular, is this a Windows Store application?
    What do you mean exactly by "authentication fails?" Does an error get thrown, or does the UI just hang?
    Is this being done from a domain-joined machine and/or on a machine connected to a corporate network?
    We have seen an issue where some configurations of ADFS will not play nicely with Windows Store apps since the Web Authentication Broker (WAB) is based on the IE browser, and ADFS will attempt to do SSO in the special IE way instead of presenting a form,
    etc. Unless the WAB is configured to handle this scenario, you will get a non-responsive UI.
    Any details you can provide would be helpful.

  • Can't select the new Azure sql service tiers when creating a new database or upgrading an existing one

    Hi all,
    I have set up the preview for the new Azure SQL tiers on both of the subscriptions we have for Azure. The one under my MSDN subscription to and a pay as you go subscription
    The pay as you go subscription works fine but when I try to upgrade an existing Azure sql database or create a new one on my MSDN subscription it doesn't give me the option of the new tiers.
    Using the new portal it says I need to sign up to the preview, but I already have and when I go to try to add a new subscription to the preview for Azure SQL it says all my active subscriptions are on the preview.
    Any idea what the issue could be?
    Cheers
    Ash

    Hi,
    Apologies for the inconvenience.
    I suggest you open a Billing Support Ticket. They will be able to check this for you.
    http://azure.microsoft.com/en-us/support/options/
    Regards,
    Mekh.

  • Azure Mobile Services

    First of all thank you responding.
    I am about to create a windows app within which the user enters the email id  for confirmation. I would like to store the email id in the cloud. How to create a sql database in Azure. i have a trial subscription and my region is India. Also I need to
    create a mobile service. It says that the service is disabled in the free trial subscription. But in some sites they say in the free trial I can get 10 Mobile services for free. Plz help me through this....

    The free trial subscriptions are mainly geared towards development. So since your free service shows up as disabled, it means you have exceeded one of the quota limits on a free subscription. You would need to upgrade to a paid subscription to continue
    utilizing your service.
    With regards to creating the SQL Database in Azure, Azure mobile services makes this very simple. Here's a good start regarding
    Azure Mobile services.
    Abdulwahab Suleiman

Maybe you are looking for