windows authentication between host and VM - sql-server

I have created a VM (using Hyper V) that has Sql Server installed (win server os).
I want my host (or possibly another VM) to be able to access the SQL Server using windows authentication (sql server authentication works).
Can someone give me a jump start/guide for what I need to do to achieve this?

To make this really work as you have planned you should have on active directory setup. So host machine and VM would be part of same AD domain.
I am very sorry but I don't have time create full instruction for this but in general steps would be:
Both VM's in same network with static IP settings
select local domain name, ex. test.local
setup AD & DNS on clean VM, this will be your domain controller (DC)
Create new VM for SQL server -server. Join in to test.local domain before installing SQL server
Install SQL server in SQL server VM using domain account

Related

Azure VM SQL Server using Windows authentication from another Azure VM ASP.NET application

Currently I have two Azure VM's, one for the ASP.NET application (VM1) and another with SQL Server 2017 (VM2).
At the moment, the application on VM1 connects to VM2's SQL Server using SQL Server authentication, but now I want to change it to Windows authentication. I found this on the Azure website about how to connect:
Virtual networks also enables you to join your Azure VMs to a domain. This is the only way to use Windows authentication to SQL Server. The other connection scenarios require SQL Server authentication with user names and passwords.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/sqlclassic/virtual-machines-windows-classic-sql-connect
But there is also a website forum ask to use Azure Active Directory domain in order to achieve this.
I am confused regarding this, can anyone help me with a description how to connect my VM1 application to VM2 SQL Server using Windows authentication?

BluePrism-Unable to create database while i am on Client machine

I am on client network and installed Sql Server Express 2014, Blueprism 6 in win 10.
I am not able to create database after configuring in sql server configuraiton manager.
in my personal laptop, i am able to create DB if we setup "SQL server(SQLEXPRESS)"and "SQL Server browser" in Configuration manager as local system and start running. But same setup is not working in Client networks.
Do we have any other setup for client networks.
The error you are getting is quite self-explanatory. When you install SQL server on your machine, you are automatically assigned as the server's sysadmin.
When you installed the server on the client network, you most likely installed it under a different account than the one you are using now. That account has the sysadmin role and can do anything, other accounts will have no access.
To fix this you need to log to that server (using Management Studio) and modify the authentication settings and/or add a new user with greater privileges.

Using Power Desktop with an Azure VM and Enterprise Gateway

I am developing a report in PowerBI Desktop based on data hosted in an Azure SQL Server VM.
When publishing a report, I get the below error:
Publishing succeeded, but the published report cannot connect to the
data source because we were unable to find a gateway. Please install
and configure an enterprise gateway
I believe this is because the enterprise gateway is installed locally on my azure VM, however I'm accessing it from my desktop by going over the web and through the firewall. Therefore I believe the issue is that my pc acceses the machine at
mymachine.cloudapp.net
Whilst the enterprise gateway knows the machine as
netbios-name
Is there any way that I can upload a desktop report to powerBI web using this configuration? The other solution would be to get the machine and sql server to identify itself as "mymachine.cloudapp.net" so that I can use this as the name to connect to through the enterprise gateway, but I'm not sure how to do that (adding the alias to SQL Server isn't enough).
It's a bit hacky, but I've got a work around.
Open the server and edit your hosts file and add the following line:
127.0.0.1 mymachine.cloudapp.net
Make sure that mymachine.cloudapp.net has been configured in SQL Server as an alias.
In PowerBI, add a new enterprise gateway data source, this time, use mymachine.cloudapp.net to connect rather than netbios-name. You will need to use SQL Authentication to connect.
Obviously connecting PowerBI to an Azure VM in this way is not ideal, as it could potentially be unencrypted, but this works around the issue of different host names between PowerBI Desktop and Web.

How to connect an Azure PostgreSQL Database created in a VM to my website?

I have a website deployed on Azure. I used PostgreSQL to create my database (with Sequelize as my ORM).
I know that Azure doesn't natively support PostgreSQL (I believe?) so I created a PostgreSQL database on a VM running on Ubuntu, while running on Azure.
However, I have to connect my website's server to the VM database, and I'm not quite sure how to do that, while also establishing the models I created in Sequelize.
You need to forward a port (usually 5432) on that VM firewall.
Then you simply connect to that machine by specifying your VM public IP address, or URL.
It makes sense to have your website and this VM inside same Virtual Network for performance reasons. You can actually do that with Azure Apps (former Websites).

Capture Azure VM Image with SQL Server

I have followed these steps https://www.windowsazure.com/en-us/manage/windows/how-to-guides/capture-an-image/ to capture an image of a VM. Used sysprep as mentioned and I was able to replicate the VM. The problem is that when I rdp into the machine, I can't connect to SLQ Server. Login fails for Windows Authentication. Usually this means that the SQL Server is on another domain, but in this case the error is on local machine.
So my question is, how to capture an image of a VM with SQL Server in Windows Azure and ensure that I can login with Windows Authentication at least when deployed?
I don't think you can, I think you will need SQL Server Authentication before sysprep (I haven't tested this), as far as I know this is the same on-premises and not an Azure feature per se...
If you run sysprep on Windows, you shouldn't have any expectations that the current principals provisioned in SQL Server will continue to work. SQL Servers references Windows accounts by their SIDs and running sysprep on Windows will create a new set of SIDs for the Windows account. Therefore, you will have to re-add them to SQL Server as you've discovered.
Adding a solution that worked for me, in case anyone facing same problem and haven't found any working solution.
After creating an Azure VM from the Image based on a generalized VM (sysprep run):
Launch SQL Server Configuration Manager.
Navigate to SQL Server Services.
Right click on SQL Server (SQLEXPRESS)->Properties from the right side panel.
Select 'This account:' and enter details of current VM Administrator credentials.
Apply changes and restart SQL Server.
Now, try connecting to the SQL Server. It should work.

Resources