Creating a Base VM Image with SQL on Azure - azure

We would like to utilize Azure VM's to do some testing on one of our applications. The application runs on Windows Server and uses a SQL DB. We would like to get everything setup on a base VM image and then have the ability to use this base image to create multiple VM's that could be used for various testing.
The part that I'm struggling with is in regards to SQL. If I start up a Windows 2008R2 VM with SQL 2012 SP1 Web and get everything setup on that VM and then run sysprep, when I fire up a VM based on that base image I have issues with SQL (logging in with Window auth for example). Do I need to be using a SQL Server login instead of using Windows Auth?
Is there a step I'm missing when sysprepping the base image for getting SQL setup/configured to be a base image?
Thanks for the help.

The issue is that When SQL is installed, Azure gives the user who is provisoning the VM admin access to SQL
When a VM is created from an Image, SQL is already installed with Image admin and still has the same.
As a workaround start the sql server in single user mode, login and then add the required logins to the sql server.

Related

Azure database file location

There is Azure SQL server with name xxxdb10.database.windows.net that is up and running. I am trying to create DB there and I have to use specifics application in order to have proper DB structure. Everything works with SQL Server Express as you can see below, program add file location automatically. But when I try to point to Azure SQL server and do the same application does not recognizance path and I got this error below. What to use for database file location in case of Azure SQL server please, can you help?
With SQL Server Express:
With Azure SQL server:
• I would suggest you use Microsoft SSMS (SQL Server Management Studio) tool to connect to the Azure SQL Server created in Azure instead of SQL Express. Since SSMS is only a tool for managing various types of SQL Databases locally or in Azure, thus it should be promptly used for creating such Azure databases. Please refer the link below on detailed documentation and information regarding this as well as refer to the snapshots depicting the usage of SSMS as a prompt tool for connecting to Azure SQL databases and server.
https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-query-ssms
In the above snapshots, you can see that we can connect to an Azure SQL Server and creating a database in it through SSMS.

Problems deploying a SSAS cube in Azure

I am having problems deploying a ssas cube in Azure. I have designed a cube in SSDT.
The structure of the cube is correct and I can access to the database placed in azure machine
from my local laptop.My SSDT project is created in my local laptop. I have tried ti deploy to azure machine and
get the following error;
"The project could not be deployed to the 'mbitsql.westeurope.cloudapp.azure.com' server because of the following connectivity problems :
A connection cannot be made. Ensure that the server is running.To
verify or update the name of the target server, right-click on the
project in Solution Explorer, select Project Properties, click on the
Deployment tab, and then enter the name of the server."
These are my tests or checks:
The cube is correct generated, the error is in deployment
I can access to Azure sql server database succesfuly, the problem is with the analysis services.
I have checked the server name in the implementation propierties, I have tested with DNS name
and with IP.
I have checked to access Analysis services from the ssms of Azure and I can access. I have
checked that analysis services and sql browser services are running (both local account)
I have created security input rules ion azure to allow access to 2382 port
I don't know where is the problem.... I use SQL Server 2016 y SSDT 2015
There is something, that I don't understand, I have given an user/pass in the datasource to access
to sql server azure database, but in the project there isn't a place to put the user/pass for SSAS.
I don't understand this, because if you log from SSMS you always put a user/pass for both (sql server database and ssas)
Did you open 2382 or 2383? 2383 is correct unless you customized the SSAS port.
Is the Azure VM domain joined? If you are logged into your laptop as MYDOMAIN\juan do you use that same user to Remote Desktop to the VM? If not close and open SSDT with:
runas /netonly /user:mbitsql\vmUserName "c:\pathTo\devenv.exe" so that SSDT can authenticate with the VM when you deploy.

How to import existing database on Azure?

I have completed with the process of creating webapp + mysql with different deployment slots. I have also configure bitbucket on Azure new portal (https://portal.azure.com). I have Linux system.
I want to import existing Database, from local to Azure. I have tried with Mysql workbench but its giving me Failed connection.
So my question is, How to import existing Database on Azure portal?
In regards to your comment from yesterday, you either try to connect to an Azure SQL Database with the MySQL Workbench, which will not work.
Use another tool like SQL Server Management Studio or JetBrains DataGrip for that.
Or you're using the ClearDB MySQL offer.
Then your connection string should look like this "Server=eu-cdbr-azure-north-b.cloudapp.net;Port=3306;Database=myDataBase;Uid=myUsername;Pwd=myPassword;", which I was assuming when you wrote that you used the webapp+mysql template.
Or you're hosting your own MySQL Server as a Virtual Maschine, which would also be a different server name, e.g. yourpublicipdnsname.northeurope.cloudapp.azure.com

How can I deploy my database from SQL Server 2008 Express to Azure SQL Database

I am using Visual Studio Community 2013, SQL Server 2008 R2 Express Edition for an MVC web application using entity framework code first migrations for my database.
I am trying to get my local application hosted on the Microsoft Azure platform.
I have registered for a trial account which expires in 30 days, and deployed my MVC5 app out which has been successful.
However, this app requires a database which I am struggling to deploy.
What is the easiest way to get my database deployed out to Azure as I do not seem to have the :
"Tasks" -> "Deploy Database to Microsoft Azure SQL Database" option available to me in SSMS.
I have extracted a Data-tier Application of my local database and have it stored on my C drive, however if I connect to my Azure Account in a second window, and right click the server then select Deploy Data-tier Application, it fails on "Creating schema object in database" with the following error:
TITLE: Microsoft SQL Server Management Studio
An exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------ ADDITIONAL INFORMATION:
Users cannot be mapped to certificates, asymmetric keys, or Windows
logins in this version of SQL Server. (Microsoft SQL Server, Error:
40528)
I'm assuming its tried to create my local account plus the IIS APPPOOL account I had to set up to host the website on my local network, however I do not see a way of removing them from the .dacpac export.
When I refresh the Databases node, there is still no database, I'm fairly lost now as to how I might get my db deployed to this server?
If you can extract a compatible Data-tier application and then Deploy it to your target server using your current version of Management studio, then this approach should work, see this link for more reading on ensuring your database is compatible.
Failing this, as was in my case. I downloaded Management Studio 2015, which gave me the option to deploy database to Azure by simply right clicking the required database.
Again, this threw up the error regarding my database level IISAPPOOL user, but not my server account user. As a way around this, I took a backup/restore of the database and removed this user then deployed the copy database obviously minus the problem account.
Now all that was left to do was add a transform to my Release web.config with the Azure connection string as provided on the Azure dashboard, and re-deploy the website.
Problem solved.

Is it possible to attach a MDF file to an Azure SQL database?

I have just created an Azure Website and Linked SQL Database.
I have a SQL Server 2008 SP2 database on my local machine. Is it possible to detach the local .mdf file, FTP it to Azure and then attach it as a SQL database in Azure? The only other way is to export the scheme and load this, followed by the data.
In the absence of detaching and attaching DBs, I have come across "SQLAzureMW" which looks very useful in guiding me through this process.
Thank you in advance.
You can deploy an database from Management studio to Azure.

Resources