Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expired Access token #292

Open
ingthu opened this issue Jun 12, 2023 · 4 comments
Open

Expired Access token #292

ingthu opened this issue Jun 12, 2023 · 4 comments

Comments

@ingthu
Copy link

ingthu commented Jun 12, 2023

Hi!

Just wonder if it is a way to extend the access token. Now it is 1 hour but that is not enough when deploying large datasets.

BR
/I

@mthierba
Copy link
Contributor

Could you provide some further context for your scenario? Which access is expiring? The deployment token or one used for your external datasources? Why is the deployment taking so long? Is it because you have a long-running refresh? Are there any logs/error messages you could share?

@ingthu
Copy link
Author

ingthu commented Jun 12, 2023

The dataset I need to deploy is large (6GB), refresh window is used, last 2 months based on a business date. When I have made changes in the dataset I would like to do a full refresh of the partitions/dataset. A full refresh takes approx 1.5 hrs. But the deployment token is only valid for approx. 1 hour. After that the deployment fails. Is there any workaround for this?

This is part of deployment manifest:
image

Error message:
Starting dataset refresh (Full) ...
Using default refresh type: Full
Refreshing model (Full)...
An unhandled exception occurred.
System.AggregateException: One or more errors occurred. ---> Microsoft.AnalysisServices.ConnectionException: MWC token validation failed: Microsoft.IdentityModel.Tokens.SecurityTokenExpiredException at Microsoft.IdentityModel.Tokens.Validators.ValidateLifetime(Nullable1 notBefore, Nullable1 expires, SecurityToken securityToken, TokenValidationParameters validationParameters)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebTokenHandler.ValidateTokenPayload(JsonWebToken jsonWebToken, TokenValidationParameters validationParameters, BaseConfiguration configuration)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebTokenHandler.ValidateJWS(String token, TokenValidationParameters validationParameters, BaseConfiguration configuration)

Technical Details:
RootActivityId: 76943baa-321d-4623-bf6d-91cefcb62ab0
Date (UTC): 6/12/2023 8:19:00 PM
at Microsoft.AnalysisServices.HttpStream.HttpChannelController.GetResponseMessageImpl(HttpStream owner, Object context, Task1 pendingResponse) at Microsoft.AnalysisServices.HttpStream.HttpChannelController.CompleteHttpClientBasedOperation(HttpStream owner, Object context, Task1 pendingResponse)
at Microsoft.AnalysisServices.HttpStream.HttpXmlaOperation.HttpClientOperationManager.GetResponse(HttpXmlaOperation operation)
at Microsoft.AnalysisServices.HttpStream.PaasInfraController.PaasInfraXmlaOperation.EnsureCanRead()
at Microsoft.AnalysisServices.HttpStream.HttpXmlaOperation.GetResponseDataType()
at Microsoft.AnalysisServices.HttpStream.GetResponseDataType()
at Microsoft.AnalysisServices.CompressedStream.GetResponseDataType()
at Microsoft.AnalysisServices.XmlaClient.EndRequest(Boolean useBinaryXml)
at Microsoft.AnalysisServices.XmlaClient.SendExecuteAndReadResponse(Boolean skipResults, Boolean throwIfError, Boolean useBinaryXml)
at Microsoft.AnalysisServices.Core.AnalysisServicesClient.RollbackTransaction()
at Microsoft.AnalysisServices.Core.Server.RollbackTransactionInternal()
at Microsoft.AnalysisServices.Tabular.Server.RollbackTransaction()
at Microsoft.AnalysisServices.Tabular.Model.SaveChangesImpl(SaveFlags flags, Int32 maxParallelism)
at PbiTools.Deployments.XmlaRefreshManager.RunRefresh() in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Deployments\XmlaRefreshManager.cs:line 94
at PbiTools.Deployments.DeploymentManager.d__32.MoveNext() in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Deployments\DeploymentManager.Dataset.cs:line 452
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PbiTools.Deployments.DeploymentManager.d__30.MoveNext() in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Deployments\DeploymentManager.cs:line 97
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at PbiTools.Cli.CmdLineActions.Deploy(String folder, String label, String environment, String basePath, Boolean whatIf) in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Cli\Deploy.cs:line 39
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at PowerArgs.ArgAction.Invoke()
at PbiTools.Program.Main(String[] args) in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Program.cs:line 110
---> (Inner Exception #0) Microsoft.AnalysisServices.ConnectionException: MWC token validation failed: Microsoft.IdentityModel.Tokens.SecurityTokenExpiredException at Microsoft.IdentityModel.Tokens.Validators.ValidateLifetime(Nullable1 notBefore, Nullable1 expires, SecurityToken securityToken, TokenValidationParameters validationParameters)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebTokenHandler.ValidateTokenPayload(JsonWebToken jsonWebToken, TokenValidationParameters validationParameters, BaseConfiguration configuration)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebTokenHandler.ValidateJWS(String token, TokenValidationParameters validationParameters, BaseConfiguration configuration)

Technical Details:
RootActivityId: 76943baa-321d-4623-bf6d-91cefcb62ab0
Date (UTC): 6/12/2023 8:19:00 PM
at Microsoft.AnalysisServices.HttpStream.HttpChannelController.GetResponseMessageImpl(HttpStream owner, Object context, Task1 pendingResponse) at Microsoft.AnalysisServices.HttpStream.HttpChannelController.CompleteHttpClientBasedOperation(HttpStream owner, Object context, Task1 pendingResponse)
at Microsoft.AnalysisServices.HttpStream.HttpXmlaOperation.HttpClientOperationManager.GetResponse(HttpXmlaOperation operation)
at Microsoft.AnalysisServices.HttpStream.PaasInfraController.PaasInfraXmlaOperation.EnsureCanRead()
at Microsoft.AnalysisServices.HttpStream.HttpXmlaOperation.GetResponseDataType()
at Microsoft.AnalysisServices.HttpStream.GetResponseDataType()
at Microsoft.AnalysisServices.CompressedStream.GetResponseDataType()
at Microsoft.AnalysisServices.XmlaClient.EndRequest(Boolean useBinaryXml)
at Microsoft.AnalysisServices.XmlaClient.SendExecuteAndReadResponse(Boolean skipResults, Boolean throwIfError, Boolean useBinaryXml)
at Microsoft.AnalysisServices.Core.AnalysisServicesClient.RollbackTransaction()
at Microsoft.AnalysisServices.Core.Server.RollbackTransactionInternal()
at Microsoft.AnalysisServices.Tabular.Server.RollbackTransaction()
at Microsoft.AnalysisServices.Tabular.Model.SaveChangesImpl(SaveFlags flags, Int32 maxParallelism)
at PbiTools.Deployments.XmlaRefreshManager.RunRefresh() in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Deployments\XmlaRefreshManager.cs:line 94
at PbiTools.Deployments.DeploymentManager.d__32.MoveNext() in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Deployments\DeploymentManager.Dataset.cs:line 452
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PbiTools.Deployments.DeploymentManager.d__30.MoveNext() in X:\pbi-tools\BRANCHES\fody\src\PBI-Tools\Deployments\DeploymentManager.cs:line 97<---

@mthierba
Copy link
Contributor

The 3600 second token lifetime is set and enforced by AAD, that's a hard limit. Key here is to re-structure your operation so that it doesn't result in a very long-running process.

This can be done by refreshing individual partitions in batches. Alternatively, the async refresh REST API could be used. The latter, however, is not currently supported by pbi-tools, I'm afraid. It is on the backlog: #172

@ingthu
Copy link
Author

ingthu commented Jun 14, 2023

Thanks for your reply, I will use TMSL refresh command for full refreshes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants