Skip to content

Update to Microsoft.Azure.Management.Authorization 2.13.0-preview #15731

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

Merged
merged 4 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.Management.DeploymentManager" Version="0.9.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.10.0-preview" />
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.5.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.12.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.13.0-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions src/HPCCache/HPCCache.Test/Fixtures/HpcCacheTestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,6 @@ public void AddRoleAssignment(HpcCacheTestContext context, string scope, string
{
RoleDefinitionId = roleDefinition.Id,
PrincipalId = Constants.StorageCacheResourceProviderPrincipalId,

// The principal ID assigned to the role.
// This maps to the ID inside the Active Directory.
// It can point to a user, service principal, or security group.
CanDelegate = false,
};

authorizationManagementClient.RoleAssignments.Create(scope, assignmentName, newRoleAssignment);
Expand Down
2 changes: 1 addition & 1 deletion src/HPCCache/HPCCache.Test/HPCCache.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.11.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.13.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.5.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.6.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
Expand Down
4 changes: 4 additions & 0 deletions src/HPCCache/HPCCache.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Global
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF81DC73-B8EC-4082-8841-4FBF2B16E7CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Resources.Test/Resources.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.8.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.12.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.13.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.ManagementGroups" Version="1.1.1-preview" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function Test-AzureProviderOperation
Assert-True { $action.Length -eq 0 }

# Get operations for non-existing provider
$exceptionMessage = "Provider 'NonExistentProvider' not found.";
$exceptionMessage = "Operation returned an invalid status code 'NotFound'";
Assert-Throws { Get-AzProviderOperation NonExistentProvider/* } $exceptionMessage

# Get operations for non-existing provider
Expand Down
17 changes: 12 additions & 5 deletions src/Resources/Resources.Test/ScenarioTests/RoleAssignmentTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ function Test-RaByScope
Assert-AreEqual $scope $newAssignment.Scope
Assert-AreEqual $users[0].DisplayName $newAssignment.DisplayName

# Start-Sleep -Seconds 300

VerifyRoleAssignmentDeleted $newAssignment
}

Expand Down Expand Up @@ -223,7 +225,7 @@ function Test-RaByResourceGroup
Assert-AreEqual $definitionName $newAssignment.RoleDefinitionName
Assert-AreEqual $users[0].DisplayName $newAssignment.DisplayName

#Start-Sleep -Seconds 300
# Start-Sleep -Seconds 300

VerifyRoleAssignmentDeleted $newAssignment
}
Expand Down Expand Up @@ -428,6 +430,8 @@ function Test-RaGetByUPNWithExpandPrincipalGroups
# cleanup
DeleteRoleAssignment $newAssignment

# Start-Sleep -Seconds 300

VerifyRoleAssignmentDeleted $newAssignment
}

Expand Down Expand Up @@ -475,6 +479,8 @@ function Test-RaDeletionByScope
Assert-AreEqual $scope $newAssignment.Scope
Assert-AreEqual $users[0].DisplayName $newAssignment.DisplayName

# Start-Sleep -Seconds 300

VerifyRoleAssignmentDeleted $newAssignment
}

Expand Down Expand Up @@ -586,7 +592,6 @@ function Test-RaDelegation
Assert-AreEqual $definitionName $newAssignment.RoleDefinitionName
Assert-AreEqual $scope $newAssignment.Scope
Assert-AreEqual $users[0].DisplayName $newAssignment.DisplayName
Assert-AreEqual $true $newAssignment.CanDelegate

# cleanup
DeleteRoleAssignment $newAssignment
Expand Down Expand Up @@ -697,6 +702,8 @@ function VerifyRoleAssignmentDeleted
{
param([Parameter(Mandatory=$true)] [object] $roleAssignment)

# Start-Sleep -Seconds 600

$deletedRoleAssignment = Get-AzRoleAssignment -ObjectId $roleAssignment.ObjectId `
-Scope $roleAssignment.Scope `
-RoleDefinitionName $roleAssignment.RoleDefinitionName | where {$_.roleAssignmentId -eq $roleAssignment.roleAssignmentId}
Expand Down Expand Up @@ -863,8 +870,8 @@ function Test-UpdateRa{

# Given
$RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"
$PrincipalId ="7aa123be-80d1-4aa8-8813-d6a34a6a52d0"
$Scope = '/subscriptions/7ada13d9-fa86-4ea3-bcdc-7545cc0f1bb6'
$PrincipalId ="a9bd2ca0-f2c6-41d5-81e7-4da601e7365a"
$Scope = '/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f'
$Description1 = "This test should not fail"
$Condition1 = "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] StringEqualsIgnoreCase 'foo_storage_container'"
$ConditionVersion = "2.0"
Expand Down Expand Up @@ -1035,7 +1042,7 @@ function Test-CreateRAWhenIdNotExist
$RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"
$PrincipalId ="6d764d35-6b3b-49ea-83f8-5c223b56eac5"
$Scope = '/subscriptions/70cff36b-c4f8-46ea-9655-9cfd44664763'
$ExpectedError = 'Exception calling "ExecuteCmdlet" with "0" argument(s): "Principal 6d764d356b3b49ea83f85c223b56eac5 does not exist in the directory 395544B0-BF41-429D-921F-E1CA2252FCF4."'
$ExpectedError = "Exception calling `"ExecuteCmdlet`" with `"0`" argument(s): `"Operation returned an invalid status code 'NotFound'`""

#When
$function = {New-AzRoleAssignmentWithId `
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"Entries": [
{
"RequestUri": "/395544B0-BF41-429D-921F-E1CA2252FCF4/getObjectsByObjectIds?api-version=1.6",
"RequestUri": "/1273adef-00a3-4086-a51a-dbcce1857d36/getObjectsByObjectIds?api-version=1.6",
"EncodedRequestUri": "LzEyNzNhZGVmLTAwYTMtNDA4Ni1hNTFhLWRiY2NlMTg1N2QzNi9nZXRPYmplY3RzQnlPYmplY3RJZHM/YXBpLXZlcnNpb249MS42",
"RequestMethod": "POST",
"RequestBody": "{\r\n \"objectIds\": [\r\n \"6d764d35-6b3b-49ea-83f8-5c223b56eac5\"\r\n ],\r\n \"includeDirectoryObjectReferences\": true\r\n}",
"RequestHeaders": {
"x-ms-client-request-id": [
"aba3b87d-5025-46e4-9eb2-1f3019d777cc"
"4a118391-5288-4d3a-926b-3461ecf1da02"
],
"Accept-Language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.29812.02",
"FxVersion/4.6.30411.01",
"OSName/Windows",
"OSVersion/Microsoft.Windows.10.0.19042.",
"Microsoft.Azure.Graph.RBAC.GraphRbacManagementClient/3.5.0.0"
"OSVersion/Microsoft.Windows.10.0.19043.",
"Microsoft.Azure.Graph.RBAC.GraphRbacManagementClient/3.5.1.0"
],
"Content-Type": [
"application/json; charset=utf-8"
Expand All @@ -33,22 +33,22 @@
"no-cache"
],
"ocp-aad-diagnostics-server-name": [
"aCS2by0g0TCoJc1T34ZKoFNzdHDvvyvxykXR832B8uY="
"8AxVNPrgvBWphAoH/ND9PWGcjIn4cwH9bsVNs+Y4nls="
],
"request-id": [
"2fccf8eb-ff86-44cf-a774-3c381e633732"
"27375d2f-c2eb-428e-98d5-79d9310da1a0"
],
"client-request-id": [
"aba3b87d-5025-46e4-9eb2-1f3019d777cc"
"4a118391-5288-4d3a-926b-3461ecf1da02"
],
"x-ms-dirapi-data-contract-version": [
"1.6"
],
"ocp-aad-session-key": [
"DxfXGD_58fNB0ZekRML94-bX0vcHD4s0hViaYFTCE-zE_L74AFqfftUBbZz0YBk2TahpnR4c5I5llfSbAb0jCiCZg4ZaiE7-hDvOPlQfTkqj_30fZO715qwprKk9HWIz.jfmF7CXA-cnTd5KQRLaNBYEBTAQffQ0JIK_UoifPV-M"
"6dixdHRGmwsiNakv5L4I_TP7JFXLuYZzgE9OTEKiFpCBeSn1QsmxaMiaUHbZggKAlneZfCQrPUU8C7T38dv-DN4EqiRtChRhf95APfX245hc2Z2QtAFcBQM0Gu_60lKW.EdCj8rECj7c4tlv5DagHJfUuoS25aGlc0pzXzGY7Jkc"
],
"Duration": [
"504755"
"733850"
],
"x-ms-resource-unit": [
"3"
Expand All @@ -69,47 +69,47 @@
"*"
],
"Date": [
"Fri, 26 Mar 2021 22:55:46 GMT"
],
"Content-Length": [
"121"
"Fri, 03 Sep 2021 20:44:35 GMT"
],
"Content-Type": [
"application/json; odata=minimalmetadata; streaming=true; charset=utf-8"
],
"Expires": [
"-1"
],
"Content-Length": [
"121"
],
"Retry-After": [
"0"
]
},
"ResponseBody": "{\r\n \"odata.metadata\": \"https://graph.windows.net/395544B0-BF41-429D-921F-E1CA2252FCF4/$metadata#directoryObjects\",\r\n \"value\": []\r\n}",
"ResponseBody": "{\r\n \"odata.metadata\": \"https://graph.windows.net/1273adef-00a3-4086-a51a-dbcce1857d36/$metadata#directoryObjects\",\r\n \"value\": []\r\n}",
"StatusCode": 200
},
{
"RequestUri": "//subscriptions/70cff36b-c4f8-46ea-9655-9cfd44664763/providers/Microsoft.Authorization/roleAssignments/734de5f5-c680-41c0-8beb-67b98c3539d5?api-version=2020-04-01-preview",
"EncodedRequestUri": "Ly9zdWJzY3JpcHRpb25zLzQwMDRhOWZkLWQ1OGUtNDhkYy1hZWIyLTRhNGFlYzU4NjA2Zi9wcm92aWRlcnMvTWljcm9zb2Z0LkF1dGhvcml6YXRpb24vcm9sZUFzc2lnbm1lbnRzLzczNGRlNWY1LWM2ODAtNDFjMC04YmViLTY3Yjk4YzM1MzlkNT9hcGktdmVyc2lvbj0yMDIwLTA0LTAxLXByZXZpZXc=",
"RequestUri": "//subscriptions/70cff36b-c4f8-46ea-9655-9cfd44664763/providers/Microsoft.Authorization/roleAssignments/734de5f5-c680-41c0-8beb-67b98c3539d5?api-version=2020-08-01-preview",
"EncodedRequestUri": "Ly9zdWJzY3JpcHRpb25zLzcwY2ZmMzZiLWM0ZjgtNDZlYS05NjU1LTljZmQ0NDY2NDc2My9wcm92aWRlcnMvTWljcm9zb2Z0LkF1dGhvcml6YXRpb24vcm9sZUFzc2lnbm1lbnRzLzczNGRlNWY1LWM2ODAtNDFjMC04YmViLTY3Yjk4YzM1MzlkNT9hcGktdmVyc2lvbj0yMDIwLTA4LTAxLXByZXZpZXc=",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"properties\": {\r\n \"roleDefinitionId\": \"/subscriptions/70cff36b-c4f8-46ea-9655-9cfd44664763/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7\",\r\n \"principalId\": \"6d764d35-6b3b-49ea-83f8-5c223b56eac5\",\r\n \"canDelegate\": false\r\n }\r\n}",
"RequestBody": "{\r\n \"properties\": {\r\n \"roleDefinitionId\": \"/subscriptions/70cff36b-c4f8-46ea-9655-9cfd44664763/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7\",\r\n \"principalId\": \"6d764d35-6b3b-49ea-83f8-5c223b56eac5\"\r\n }\r\n}",
"RequestHeaders": {
"x-ms-client-request-id": [
"48274ed4-e27c-4c47-8b83-e91086d065e9"
"3557a1e2-bda4-4dd2-941a-dfca482ffb40"
],
"Accept-Language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.29812.02",
"FxVersion/4.6.30411.01",
"OSName/Windows",
"OSVersion/Microsoft.Windows.10.0.19042.",
"Microsoft.Azure.Management.Authorization.AuthorizationManagementClient/2.12.0.0"
"OSVersion/Microsoft.Windows.10.0.19043.",
"Microsoft.Azure.Management.Authorization.AuthorizationManagementClient/2.13.0.0"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Content-Length": [
"281"
"254"
]
},
"ResponseHeaders": {
Expand All @@ -119,49 +119,47 @@
"Pragma": [
"no-cache"
],
"x-ms-failure-cause": [
"gateway"
],
"x-ms-request-id": [
"cbf557b4-3bdf-43a8-92f3-02e7e65840f6"
"1d5abd6f-06c4-46eb-88bc-4367805ddbd9"
],
"X-Content-Type-Options": [
"nosniff"
"x-ms-correlation-request-id": [
"1d5abd6f-06c4-46eb-88bc-4367805ddbd9"
],
"x-ms-routing-request-id": [
"WESTUS2:20210903T204436Z:1d5abd6f-06c4-46eb-88bc-4367805ddbd9"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Set-Cookie": [
"x-ms-gateway-slice=Production; path=/; secure; samesite=none; httponly"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1197"
],
"x-ms-correlation-request-id": [
"41411b36-c40d-48a0-bf9c-f46012e7decf"
],
"x-ms-routing-request-id": [
"WESTUS2:20210326T225546Z:41411b36-c40d-48a0-bf9c-f46012e7decf"
"X-Content-Type-Options": [
"nosniff"
],
"Date": [
"Fri, 26 Mar 2021 22:55:46 GMT"
],
"Content-Length": [
"163"
"Fri, 03 Sep 2021 20:44:36 GMT"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Content-Length": [
"129"
],
"Retry-After": [
"0"
]
},
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"PrincipalNotFound\",\r\n \"message\": \"Principal 6d764d356b3b49ea83f85c223b56eac5 does not exist in the directory 395544B0-BF41-429D-921F-E1CA2252FCF4.\"\r\n }\r\n}",
"StatusCode": 400
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"SubscriptionNotFound\",\r\n \"message\": \"The subscription '70cff36b-c4f8-46ea-9655-9cfd44664763' could not be found.\"\r\n }\r\n}",
"StatusCode": 404
}
],
"Names": {},
"Variables": {
"TenantId": "1273adef-00a3-4086-a51a-dbcce1857d36",
"SubscriptionId": "70cff36b-c4f8-46ea-9655-9cfd44664763"
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading