How To Backup Microsoft Azure SQL Database Using ASP.NET - c#

Good day, I am trying to backup a Microsoft Azure SQL database using an ASP.Net application programmatically into either a .BACPAC file I can download to a local machine or into an Azure blob storage platform. I know similar questions have been asked before but I have searched the web and cannot find a recent solution that seems to work. A simple "Backup database" SQL query also doesn't seem to be possible as I am constantly thrown with the error message: 'BACKUP DATABASE' is not supported in this version of SQL Server. Any help would be greatly appreciated. Attempt at consuming API

The simplest way i think is to use Databases - Export Rest Api(Exports a database to a bacpac)
The rest api provides you with a blobUri which you can use to download or transfer to Azure blob storage

Related

How to connect to Azure SQL DB using entity framework database first approach using already registered app in Azure

I am trying to connect an Azure SQL DB resource using the app id of an already registered application in Azure.
I am using entity framework database first approach.
Since you have an c# Azure web APP, please reference this document: Quickstart: Use .NET Core (C#) to query an Azure SQL database.
In this quickstart, you'll use .NET Core and C# code to connect to an Azure SQL database. You'll then run a Transact-SQL statement to query data.
Hope this helps.
There are a few steps to connecting to the Azure SQL database. I suggest reading this article
You will need to:
Add your IP to the Azure SQL firewall
Create a login via SQL management studio
Once you've completed the above you'll be able to update the connection string in your application's web.config to establish a connection.

Xamarin - Set Up Azure Offline Sync in C#

I have watched this tutorial on setting up offline sync for a Xamarin application using an Azure backend. I have a MySQL table on my Azure portal and I now wish to add the back-end calls to sync my local SQLite database with the MySQL cloud database.
I am not using the Easy Tables software used in the tutorial above, and I would like to use C# for the backend calls for my MobileServiceClient to talk to, where it calls methods such as:
await client.SyncContext.PushAsync();
await table.PullAsync("alltable", table.CreateQuery());
await table.InsertAsync(entry);
What are the steps to setting up the cloud syncing functionality from my SQLite store to my MySQL database?
Unfortunately MySQL is not compatible with Azure's IMobileServiceClient, you must change to using Azure SQL to use the inbuilt functions in IMobileServiceClient

Is it bad practice to create the AdalTokenCache as an SQL Database in Azure?

My MVC web application uses Azure AD Authentication. Initially when you run the wizard on your project to set this up for you it creates an mdf database file in your project for the AdalTokenCache. This isn't compatible with Azure as you can't use local MDF files.
What I have done is created the AdalTokenCache as a database in my Azure portal and I'm using that instead (which works fine). My question is, is this bad practice and if so what's the best way of handling it?

How to put database on azure website

I recently finished my asp website, bought the domain and azure hosting. Unfortunately, when I try to do anything that accesses the database I just get stuck on a loading screen. I just used the default asp razor mvc 5 project I think for the database along with a couple of custom tables.
So here is how I would do it since you have an existing database. I would follow azures website, and set up a SQL database. I would then script out the database on you local machine, and log into your azure database using SQL Server Express. Execute the script you generated from localDB. Then all of your data will be good to go. You will then need to take the connection string from azure, and put it in your applications config file. After modifying the connection string in your application you should redeploy, and verify everything is working the way you want. You will be able to verify your data is there in SQL Server Express.
Here is a link that may be of quite a bit of assistance to you. It includes step by step instructions as well as screen shots.
Another option is using this tool. I have never used it, but I know a few people who have had great success with it.

Connecting asp.net Identity to SQL Azure

It seems MVC 5 no longer uses simple membership and I am having trouble figuring out how to use a SQL Azure database instead of the default .mdf file that is generated and saved on the web server. In simple membership it was as easy as changing two connection strings but that does not seem to be the case here. From what I have found online, it seems like I have to create my own custom storage provider to accomplish such a simple task. The only examples and docs I find online that deal with Azure are scenarios in which the developer wants to store in a non-relational setup or Azure Table storage.
Am I right in the above conclusion or is there something I am missing about integrating SQL Azure DB into my MVC 5 Asp.Net Identity app?
I have Identity running on top of a SQL Azure DB in one of my projects. You don't need to implement your own storage provider. The only thing you have to do is to change the connection string (normally named DefaultConnection) in your web.config file and point it to your SQL Azure DB.

Categories

Resources