question

sakuraime avatar image
0 Votes"
sakuraime asked tbgangav-MSFT answered

Azure automation account and SQL Server VM

Suppose I have a SQL Server VM and Azure which is domain join and I have an Azure automation account.
How can I connect to this SQL Server VM from Azure automation account using Windows AD authen ?

I know there is a concept of creating a credential .
https://docs.microsoft.com/en-us/azure/automation/shared-resources/credentials?tabs=azure-powershell


$user = "MyDomain\MyUser"
$pw = ConvertTo-SecureString "PassWord!" -AsPlainText -Force
$cred = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $user, $pw
New-AzureAutomationCredential -AutomationAccountName "MyAutomationAccount" -Name "MyCredential" -Value $cred

just that the above ? Any more setting for Azure automation account to authen with domain ?

sql-server-generalazure-automation
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

seems failed from using the above method to save the domain credential and use it in Azure automation account.

i

0 Votes 0 ·

anyone has the idea ?

0 Votes 0 ·

1 Answer

tbgangav-MSFT avatar image
0 Votes"
tbgangav-MSFT answered

Hi @sakuraime,

I hope the issue is resolved! If that's not the case then as you did here, go with the Invoke-SqlCmd cmdlet way. If the focus is on Windows Authentication then you could leverage Hybrid Runbook Worker and see if it helps. Let me know if you need any further clarification.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thanks for your information

0 Votes 0 ·