liprec / vsts-release-aas

Repository for my Analysis Service Azure pipelines tasks related to Azure Analysis Service or Power BI Premium
Other
27 stars 28 forks source link

Error during deploying the model (Exception has been thrown by the target of an invocation.) #11

Closed isehuet closed 3 years ago

isehuet commented 6 years ago

Hi, When deploying the model to AAS, I get an exception thrown. Any idea? the AAS is built through the same release pipeline (so using the same SPN), but does the SPN need to be added as an Admin to the Analysis Service?

2018-07-09T14:26:24.1776209Z ##[section]Starting: Deploy model to Analysis Service 2018-07-09T14:26:24.1780760Z ============================================================================== 2018-07-09T14:26:24.1781090Z Task : Azure Analysis Service Deployment 2018-07-09T14:26:24.1781289Z Description : Deploy Azure Analysis Service databases 2018-07-09T14:26:24.1781463Z Version : 1.1.2 2018-07-09T14:26:24.1781647Z Author : Jan Pieter Posthuma 2018-07-09T14:26:24.1782039Z Help : More Information 2018-07-09T14:26:24.1782286Z ============================================================================== 2018-07-09T14:26:29.9159390Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM\2.1.0\AzureRM.psd1 -Global 2018-07-09T14:26:48.5300332Z ##[warning]The names of some imported commands from the module 'AzureRM.Websites' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb. 2018-07-09T14:26:48.5367245Z ##[warning]The names of some imported commands from the module 'AzureRM' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb. 2018-07-09T14:26:48.5941694Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\2.1.0\AzureRM.profile.psd1 -Global 2018-07-09T14:26:48.6744640Z ##[command]Add-AzureRMAccount -ServicePrincipal -Tenant -Credential System.Management.Automation.PSCredential -EnvironmentName AzureCloud 2018-07-09T14:26:49.7200515Z ##[command]Select-AzureRMSubscription -SubscriptionId -TenantId * 2018-07-09T14:26:52.0114503Z ##[error]Error during deploying the model (Exception has been thrown by the target of an invocation.)** 2018-07-09T14:26:52.0575058Z ##[section]Finishing: Deploy model to Analysis Service

We build the AAS using ARM templates and then use the Azure Analysis Service Deployment task to deploy the model to the AAS. Any input is highly appreciated.

pedbir commented 6 years ago

Having the same problem

liprec commented 6 years ago

At this moment depoying a model via a SPN is not yet supported. I am in the process of rewriting all my VSTS extensions to NodeJS to be platform independent (and the are running faster) and it will include the deployment with SPNs, but it will take a little bit longer.

So at this moment you need an user and that user needs to be service admin to be able to deploy a model to AAS. And with the new version this user can be changed to an SPN, because you need access to both the Azure resource and the service itself.

(Duplicate of #5)

denvro commented 5 years ago

We are not using a SPN to deploy a model through a VSTS release pipeline and we're experiencing the same error. I use my own credentials in the 'Analysis Services Admin' and 'Analysis Services Admin Password' , and I am one of the Analysis Services Admins. Could this have something to do with MFA?

liprec commented 5 years ago

Probably it will as the MFA authentication will return a 'challenge'. So if it is possible to use a fixed user/password without MFA or add an 'app password' to your user it should work.

denvro commented 5 years ago

We are trying to use this extension in an enterprise environment where both solutions (fixed user/password and 'app passwords') are not allowed/disabled. Would be great if Service Principals would be supported in the (near) future.

ptarepmone commented 5 years ago

Having same issue. Is there a resolution to this.

reubster commented 5 years ago

Also me.

fmms commented 5 years ago

Getting this as well. We are using an App Registration. Shouldn't this be the same as username and password?

ptarepmone commented 5 years ago

Having same issue. Is there a resolution to this.

Works perfectly. Had problem with my password and Username. It doesn't work with MFA..

liprec commented 5 years ago

I just released a minor version (v1.2) with Service Principal support.

reubster commented 5 years ago

Hi,

My release pipeline broke immediately. Do I need to recreate it? I'll give it a go.

liprec commented 5 years ago

@reubster, can you share the error message? And can you make sure that the pipeline is using v1.2.2?

reubster commented 5 years ago

The original error was

"##[error]Error during adding automatic firewall rule (Authentication failed: User ID and Password are required when user interface is not available.)
##[error]Authentication failed: User ID and Password are required when user interface is not available." 

However, I've made a few random tweaks in the settings, saved and run again and it's fine now.

Perhaps it just needed a re-validation to recognise some new defaults or something?

Thanks for making the update. Very helpful. Now I can throw away the regular user and stick to using my SPN.

liprec commented 5 years ago

Yesterday I fix a bug that was related to deployments without a firewall, so it could be that you were hitting the same error. But good to hear that it is now working for you again!

reubster commented 5 years ago

Hi liprec,

Yeah, I'm not currently using a firewall. Now when I try it, it works as long as I disable the remove after deploy switch.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.