-
Notifications
You must be signed in to change notification settings - Fork 4k
[SQL MI]Add support for Service principal and guest users in Set-AzSqlInstanceActiveDirectoryAdministrator cmdlet #12197
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
Conversation
…re Active Directory admin.
…DirectoryAdministrator command. We will be adding a new API to enable this option.
…to amagarwa/dev/ApplicationAsAADAdmin
…to amagarwa/dev/ApplicationAsAADAdmin
…to amagarwa/dev/sqlmiaddSPGuestuserSupport
…nceActiveDirectoryAdministrator cmdlet
Can one of the admins verify this patch? |
|
...ActiveDirectoryAdministrator/Services/AzureSqlInstanceActiveDirectoryAdministratorAdapter.cs
Outdated
Show resolved
Hide resolved
Hey @VeryEarly , |
…to amagarwa/dev/sqlmiaddSPGuestuserSupport
…hub.com/Azure/azure-powershell into amagarwa/dev/sqlmiaddSPGuestuserSupport
@msJinLei @dingmeng-xue any idea about this. looks like tests scenarios not working with service principals. |
In your updated code, there are API calls to get serviceprincipal, so please re-record testcase: https://github.com/Azure/azure-powershell/blob/amagarwa/dev/sqlmiaddSPGuestuserSupport/src/Sql/Sql.Test/ScenarioTests/ManagedInstanceActiveDirectoryAdministratorTests.ps1 |
I see. that is the difficult part, last time I tried for 3 days and could not get it to work. Last dev has lef the team. :(, let me check if we want to re-record or just disable the test until we has a resource to fix test. |
…to amagarwa/dev/sqlmiaddSPGuestuserSupport
After trying multiple times to re-record it, I had no luck.
…to amagarwa/dev/sqlmiaddSPGuestuserSupport
@VeryEarly I have marked the test as skip. I debugged more and looks like its the token that 's going with graph call, its wrong and using https://management.core.windows.net/ and not https://graph.windows.net/, looks like in debugging all places I added my token are called fine. so puzzling. When calling ActiveDirectoryClient.FilterGroups(filter).Where(gr => string.Equals(gr.DisplayName, displayName, StringComparison.OrdinalIgnoreCase)); in MockScenario, it picks up wrong token. Wondering if problem is in ActiveDirectoryClient itself not supporting mock tests. If know how mock tests with AAD will work, I can schedule a meeting and show you what I am doing to get it working and understand what else can I do to make it work. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Added support for Service principal and guest users in Set-AzSqlInstanceActiveDirectoryAdministrator cmdlet
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be added