0
votes

I have a powershell script in order to make a backup of a SQL Database. I run the script locally, i run the script on TFS release phase with Powershell Script (not the azure powershell task), and everything went well.

Now, i want it to run it with the Azure PowerShell script: InlineScript because i want to remove the login part from my powershell. I saved the username \ password in the variables in order to login and i want to get rid of that

This is the script :

enter image description here

Please notice that i put the Login-AzureRmAccount because of the error. After this, i'm still getting it.

Error message:

[error]Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

[error]Run Login-AzureRmAccount to login.

1
Your connection type should be Azure RM, not Azure Classic. - Daniel Mann
What should I change in order to use the classic one? - TrulyXax
If I remove the login rm account part , I'm getting the same 2 errors - TrulyXax
You can't change it. You're using Azure RM commands. You should use an Azure RM connection. Azure Classic won't work. - Daniel Mann
Where it has "Azure Connection Type," change the dropdown to "Azure Resource Manager" and you may need to create/update the service connection. - m00nbeam360.0

1 Answers

1
votes

As mentioned above please change the dropdown to "Azure Resource Manager" because in Azure classic this command will translate to Start-AzureSqlDatabaseCopy which does not have all the options available

https://docs.microsoft.com/en-us/powershell/module/servicemanagement/azure/start-azuresqldatabasecopy?view=azuresmps-4.0.0