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

user does not have permission to call the Discover method #305

Open
lorenzodanielli opened this issue Nov 26, 2024 · 5 comments
Open

user does not have permission to call the Discover method #305

lorenzodanielli opened this issue Nov 26, 2024 · 5 comments

Comments

@lorenzodanielli
Copy link

lorenzodanielli commented Nov 26, 2024

HI,
I tried to run the commands but I can't move forward since I get this error:

OperationException Traceback (most recent call last) Cell In[13], line 1----> 1 migration.create_pqt_file(dataset = dataset_name, workspace = workspace_name) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs) 307 raise 309 try:--> 310 result = func(*args, **kwargs) 312 # The invocation for get_message_dict moves after the function 313 # so it can access the state after the method call 314 message.update(extractor.get_completion_message_dict(result, arg_dict)) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy_labs/migration/_create_pqt_file.py:52, in create_pqt_file(dataset, workspace, file_name) 49 subFolderPath = os.path.join(folderPath, "pqtnewfolder") 50 os.makedirs(subFolderPath, exist_ok=True)---> 52 with connect_semantic_model( 53 dataset=dataset, workspace=workspace, readonly=True 54 ) as tom: 55 if not any( 56 p.SourceType == TOM.PartitionSourceType.M for p in tom.all_partitions() 57 ) and not any(t.RefreshPolicy for t in tom.model.Tables): 58 print( 59 f"{icons.info} The '{dataset}' semantic model within the '{workspace}' workspace has no Power Query logic." 60 ) File ~/cluster-env/trident_env/lib/python3.11/contextlib.py:137, in _GeneratorContextManager.enter(self) 135 del self.args, self.kwds, self.func 136 try:--> 137 return next(self.gen) 138 except StopIteration: 139 raise RuntimeError("generator didn't yield") from None File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy_labs/tom/_model.py:4579, in connect_semantic_model(dataset, readonly, workspace) 4576 workspace_id = fabric.get_workspace_id() 4577 workspace = fabric.resolve_workspace_name(workspace_id)-> 4579 tw = TOMWrapper(dataset=dataset, workspace=workspace, readonly=readonly) 4580 try: 4581 yield tw File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy_labs/tom/_model.py:47, in TOMWrapper.init(self, dataset, workspace, readonly) 44 self._readonly = readonly 45 self._tables_added = []---> 47 self._tom_server = fabric.create_tom_server( 48 readonly=readonly, workspace=workspace 49 ) 50 self.model = self._tom_server.Databases.GetByName(dataset).Model 52 self._table_map = {} File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs) 307 raise 309 try:--> 310 result = func(*args, **kwargs) 312 # The invocation for get_message_dict moves after the function 313 # so it can access the state after the method call 314 message.update(extractor.get_completion_message_dict(result, arg_dict)) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/fabric/_flat.py:1488, in create_tom_server(readonly, workspace) 1485 workspace_url = _get_workspace_url(workspace_client.get_workspace_name()) 1486 connection_str = _build_adomd_connection_string(workspace_url, readonly=readonly)-> 1488 return _create_tom_server(connection_str, workspace_client.token_provider) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs) 307 raise 309 try:--> 310 result = func(*args, **kwargs) 312 # The invocation for get_message_dict moves after the function 313 # so it can access the state after the method call 314 message.update(extractor.get_completion_message_dict(result, arg_dict)) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/fabric/_client/_utils.py:49, in _create_tom_server(connection_string, token_provider) 46 tom_server.AccessToken = get_access_token(None) 47 tom_server.OnAccessTokenExpired = FuncAccessToken, AccessToken---> 49 tom_server.Connect(connection_string) 51 return tom_server OperationException: The ' USER_NAME' user does not have permission to call the Discover method. Technical Details: RootActivityId: b0384b69-0319-4dd6-bb26-f73f21136342 Date (UTC): 11/4/2024 2:22:31 PM at Microsoft.AnalysisServices.XmlaClient.CheckForSoapFault(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError) at Microsoft.AnalysisServices.XmlaClient.CheckForError(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError) at Microsoft.AnalysisServices.XmlaClient.SendMessage(Boolean endReceivalIfException, Boolean readSession, Boolean readNamespaceCompatibility) at Microsoft.AnalysisServices.Core.AnalysisServicesClient.Discover(IMajorObject obj, ObjectExpansion expansion, JaXmlSerializer serializer) at Microsoft.AnalysisServices.Core.Server.Refresh(IMajorObject obj, ObjectExpansion expansion) at Microsoft.AnalysisServices.Core.Server.SendRefresh(IMajorObject obj, ObjectExpansion expansion) at Microsoft.AnalysisServices.MajorObject.Refresh(ObjectExpansion expansion) at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString, String sessionId, ObjectExpansion expansionType) at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString, String sessionId) at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString)

The logged user is a power platform admin and an analysis service admin.
Can anyone suggest me what else to check in order to understand the reason behind this?
Thanks a lot
Lorenzo

@m-kovalsky
Copy link
Collaborator

Seems like an access issue. The strange this is that the discover objects are not used to do this.

Can you do this?

from sempy_labs.tom import connect_semantic_model

with connect_semantic_model(dataset='', workspace='', readonly=True) as tom:
    print(tom.model.Model.Name)

@lorenzodanielli
Copy link
Author

lorenzodanielli commented Nov 26, 2024 via email

@m-kovalsky
Copy link
Collaborator

Is this tenant setting disabled?

Image

@lorenzodanielli
Copy link
Author

lorenzodanielli commented Dec 3, 2024 via email

@m-kovalsky
Copy link
Collaborator

Don't enable that. Is the model on a shared capacity?

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