-
Notifications
You must be signed in to change notification settings - Fork 4k
Adding new Powershell cmdlets to support set/get/remove of Azure AD administrator on MI #10057
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
Adding new Powershell cmdlets to support set/get/remove of Azure AD administrator on MI #10057
Conversation
…dministrator on MI
Can one of the admins verify this patch? |
The other tests which use Graph API are disabled because of existing problem with Graph authentication. I succeed to execute this test locally, but in error logs I saw this error: Unable to find a matching HTTP request for URL 'POST /72f988bf-86f1-41af-91ab-2d7cd011db47/getObjectsByObjectIds?' Here is the request from recorded json file 'POST /0c1edf5d-e5c5-4aca-ab69-ef194134f44b/getObjectsByObjectIds?api-version=1.6'. As you could see, the tenantId is different.
Syncing from original
Add ps commands for aad admin
…lesevic/azure-powershell into addPSCommandsForAadAdmin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SanjaMalesevic Please see my inline comments, thanks.
...ctiveDirectoryAdministrator/Cmdlet/AzureSqlInstanceActiveDirectoryAdministratorCmdletBase.cs
Outdated
Show resolved
Hide resolved
...nceActiveDirectoryAdministrator/Cmdlet/RemoveAzureSqlInstanceActiveDirectoryAdministrator.cs
Outdated
Show resolved
Hide resolved
...ActiveDirectoryAdministrator/Services/AzureSqlInstanceActiveDirectoryAdministratorAdapter.cs
Outdated
Show resolved
Hide resolved
TODO for me: resolve markdown conflict once #10074 is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of test chnages, otherwise LGTM
{ | ||
# Setup | ||
$rg = Create-ResourceGroupForTest | ||
$vnetName = "cl_initial" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should generate random names for these - this allows each test execution to be indpenendent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I check all other tests in SQL module, and they don't use random name for vnet. I suppose that the vnet's should stay deterministic so in the record mode the next test can create MI quickly. Also, I noticed that the vnet is never dropped.
So, if you agreee I would leave this as it is now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an entire facility for creatingand recording random names used by essentially every other test project. As you have this now, anyone who runs two of your tests in the same subscription will fail. Please fix this.
function Test-ManagedInstanceActiveDirectoryAdministrator | ||
{ | ||
# Setup | ||
$rg = Create-ResourceGroupForTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should follow the pattern of cleaning up created resources as part of the test, using a try/finally after creating the resource group, where the ResourceGroup is removed in the finally is generally the pattern to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if (HttpMockServer.Mode == HttpRecorderMode.Record) | ||
{ | ||
tenantId = TestEnvironmentFactory.GetTestEnvironment().Tenant; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to store the tenant ID in HttpMockServer.Variables in this case, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Description
Design review: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/363
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