Sample Header Ad - 728x90

Invoke-AzVMRunCommand on Azure VM using domain user

0 votes
1 answer
861 views
I am working on ARM template to setup SQL server VM on Azure with Always on High availibility setup using Win server 2019 and SQL Server 2019 Enterprise image. I am trying to automate everything using ARM template. Now, I need to execute SETSPN commnad on one of the Azure SQL Server VM using AMR template for which I used Script Deployment template and there using **Invoke-AzVMRunCommand** command to run PowerShell script on Azure VM. As Invoke-AzVMRunCommand run PowerShell script with System Account context, I am getting access denied error when SETSPN command try to execute on the remote VM. So, looking for any other option to run PowerShell command to Azure VM in automated way with domain user context having permission to execute SETSPN command. Here is the command I am trying to execute on VM using ARM deployment script and Invoke-AzVMRunCommnad. **setspn -S MSSQLSvc/..com:1433 domain\sqlserviceaccount**
Asked by Nirav B
Sep 13, 2022, 04:57 PM
Last activity: Dec 29, 2024, 11:07 AM