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

Facing issues while deploying tabular cube models to Azure Analysis Services #93

Closed GeekMahe closed 2 years ago

GeekMahe commented 2 years ago

Hi Jan Pieter,

We are trying to deploy our tabular models to Azure Analysis Services using the AAS plugin. Im using the options

  1. Service Principal
  2. Inherit from Connection i didnt use the Named User option since that will be deprecated in the future version.

Facing the following error while using the "Service Principal" option 2022-01-26T14:01:18.1564516Z ##[error]System.Management.Automation.RuntimeException: Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: , status message:

Facing this issue while using the "Inherit From Connection" 2022-01-26T14:24:21.1184718Z ##[error]Cannot bind argument to parameter 'String' because it is null.

I request you to assist me on this issue. this is becoming a head-ache

liprec commented 2 years ago

Question: is the service connection configured to use a service principal as authentication method? And is the SP added as Analysis Service Admin? And if that does not solve the issue: can you share the logging with parameter System.Debug set to true?

stale[bot] commented 2 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.

GeekMahe commented 2 years ago

Hi, Yes. the service connection is configured to use a SP as authentication method. but we are unable to add the SP as Analysis Services admin?

liprec commented 2 years ago

You can look at this document on how to add a SP as Azure Analysis Service admin: https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-addservprinc-admins

GeekMahe commented 2 years ago

I have tried using the SSMS and facing the following issue TITLE: Microsoft SQL Server Management Studio

The user or application: 'XXXX-4c3b2838-XXXXXXXXXXX' was not found in your organization's Azure Active Directory. Details: 'The object was not found in Azure Active Directory.'.

Technical Details: RootActivityId: 17efb6e3-00cb-413a-a52a-d4b7f19e8c39 Date (UTC): 3/13/2022 7:25:37 PM (Microsoft.AnalysisServices.Core

GeekMahe commented 2 years ago

Also while using "Inherit from Connection" option facing the following issue. generated the logs too by setting the system.debug=true

2022-03-13T18:47:14.5755228Z ##[error]Cannot bind argument to parameter 'String' because it is null.

GeekMahe commented 2 years ago

Have generated the logs by setting the system.debug = true

2022-03-13T18:47:14.5174442Z ##[debug]at , D:\a_tasks\deploy-aas-db_a55f5b79-9828-4b7f-9528-85e9e826c028\1.5.8\deploy-aas-db.ps1: line 137 2022-03-13T18:47:14.5198511Z ##[debug]at , : line 1 2022-03-13T18:47:14.5216236Z ##[debug]at , : line 22 2022-03-13T18:47:14.5243688Z ##[debug]at , : line 18 2022-03-13T18:47:14.5261185Z ##[debug]at , : line 1 2022-03-13T18:47:14.5287151Z ##[debug]Exception: 2022-03-13T18:47:14.5352199Z ##[debug]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'String' because it is null. 2022-03-13T18:47:14.5389708Z ##[debug] at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) 2022-03-13T18:47:14.5440054Z ##[debug] at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) 2022-03-13T18:47:14.5493079Z ##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) 2022-03-13T18:47:14.5538527Z ##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) 2022-03-13T18:47:14.5587065Z ##[debug] at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) 2022-03-13T18:47:14.5605335Z ##[debug] at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) 2022-03-13T18:47:14.5624588Z ##[debug] at System.Management.Automation.PSScriptCmdlet.RunClause(Action1 clause, Object dollarUnderbar, Object inputToProcess) 2022-03-13T18:47:14.5643109Z ##[debug] at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() 2022-03-13T18:47:14.5663568Z ##[debug] at System.Management.Automation.CommandProcessorBase.Complete() 2022-03-13T18:47:14.5755228Z ##[error]Cannot bind argument to parameter 'String' because it is null. 2022-03-13T18:47:14.5756506Z ##[debug]Processed: ##vso[task.logissue type=error]Cannot bind argument to parameter 'String' because it is null. 2022-03-13T18:47:14.5783792Z ##[debug]Processed: ##vso[task.complete result=Failed]

GeekMahe commented 2 years ago

Please can we get into a working session so that we understand each other and gets close to the solution. please let us know your thoughts on this

liprec commented 2 years ago

To me the errors point into the direction that the SP is either not correctly configured, you made a typo in the app id and/or secret or the secret contains characters that needs to be escaped for use with PowerShell (e.g. single and double quotes). If the SP is correctly configured you should be able to connect with it via SSMS.

GeekMahe commented 2 years ago

How to ensure the secret value is correct. because we can view only once after its creation right? client secret ID = Service Principal Key right?

liprec commented 2 years ago

You need to store the secret somewhere (at the service connection, or as secret variables, or Azure KeyVault) so it can be used in the pipeline. After you create the secret, you can validate it if it contains any quotes and after that store it in the place you want to store it.

Look at some of these resources:

GeekMahe commented 2 years ago

Hi, The below is the latest issue we are facing. we are not quite sure where exactly the piece is missing. please guide us

2022-03-15T10:39:39.6204742Z ##[debug]Exception: 2022-03-15T10:39:39.6297300Z ##[debug]Microsoft.PowerShell.Commands.WriteErrorException: Error connecting to tabular service. (Exception calling "Connect" with "1" argument(s): "Unable to obtain authentication token using the credentials provided.") 2022-03-15T10:39:39.6362551Z ##[error]Error connecting to tabular service. (Exception calling "Connect" with "1" argument(s): "Unable to obtain authentication token using the credentials provided.") 2022-03-15T10:39:39.6366151Z ##[debug]Processed: ##vso[task.logissue type=error]Error connecting to tabular service. (Exception calling "Connect" with "1" argument(s): "Unable to obtain authentication token using the credentials provided.") 2022-03-15T10:39:39.6384207Z ##[debug]Processed: ##vso[task.complete result=Failed]

stale[bot] commented 2 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.

GeekMahe commented 2 years ago

Hi @liprec ,

The issue is resolved. Thanks for your assistance. in my case adding the AAD user as SPN admin resolved the issue