Hello @Khushboo Dubey (Health) and welcome to Microsoft Q&A.
As I understand the ask, you want to know what to do to replace the Add-AzAnalysisServicesAccount
.
TL;DR / short answer: Replace with Connect-AzAccount
----------
Long Answer:
The story is a little convoluted. First I checked the REST API for a similar command. There was none. So I decided to take a closer look.
The description of Add-AzAnalysisServicesAccount
sounds like it should be provisioning a service principal in order to use the database commandlets.
To gain certainty, I decided to run this command and see what side effects there are. To my surprise, this command didn't seem to really do anything when I ran in cloud shell! So I tried running from windows powershell. When run from windows powershell without arguments, it just asked me to log in. Nothing else happened beyond the deprecation warnings.
So I tried again with bad credentials. No error was thrown. Now thorougly confused, I asked my colleage in the SDK area for help. We took a look inside the code. As best as I can tell, Add-AzAnalysisServicesAccount
just does Connect-AzAccount
using the credentials and other parameters you supply.
This seemed strange, and not cogent to the verb "Add-". Looking closer, this command is aliased to Login-AzureAsAccount. Now it begins to make more sense.
Permissions
Most PowerShell tasks require you have Admin privileges on the Analysis Services server you are managing. Scheduled PowerShell tasks are unattended operations. The account or service principal running the scheduler must have Admin privileges on the Analysis Services server.For server operations using Azure PowerShell cmdlets, your account or the account running scheduler must also belong to the Owner role for the resource in Azure role-based access control (Azure RBAC).
So to use the other commands, the user/service principal must have the appropraite RBAC role. When you open a powershell prompt, by default it is running as YOU. If you want it to run under service principal, then powershell must log into Azure as said service principal. That is what Add-AzAnalysisAccount
does.
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on
or upvote
button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators