你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Role Management Policy Assignments - Delete
删除角色管理策略分配
DELETE https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}?api-version=2020-10-01
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
roleManagementPolicyAssignmentName
|
path |
True
|
string
|
要删除的角色管理策略分配的格式 {guid_guid} 的名称。
|
scope
|
path |
True
|
string
|
要删除的角色管理策略分配的范围。
|
api-version
|
query |
True
|
string
|
要用于此操作的 API 版本。
|
响应
名称 |
类型 |
说明 |
200 OK
|
|
正常 - 已成功删除策略分配。
|
204 No Content
|
|
NoContent - 策略分配不存在。
|
Other Status Codes
|
CloudError
|
描述操作失败原因的错误响应。
|
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
DeleteRoleManagementPolicyAssignment
示例请求
DELETE https://management.azure.com/providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleManagementPolicyAssignments/b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24?api-version=2020-10-01
/**
* Samples for RoleManagementPolicyAssignments Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/
* DeleteRoleManagementPolicyAssignment.json
*/
/**
* Sample code: DeleteRoleManagementPolicyAssignment.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void deleteRoleManagementPolicyAssignment(com.azure.resourcemanager.AzureResourceManager azure) {
azure.accessManagement().roleAssignments().manager().roleServiceClient().getRoleManagementPolicyAssignments()
.deleteWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368",
"b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armauthorization_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/53b1affe357b3bfbb53721d0a2002382a046d3b0/specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json
func ExampleRoleManagementPolicyAssignmentsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armauthorization.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewRoleManagementPolicyAssignmentsClient().Delete(ctx, "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AuthorizationManagementClient } = require("@azure/arm-authorization");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete a role management policy assignment
*
* @summary Delete a role management policy assignment
* x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/DeleteRoleManagementPolicyAssignment.json
*/
async function deleteRoleManagementPolicyAssignment() {
const subscriptionId =
process.env["AUTHORIZATION_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368";
const roleManagementPolicyAssignmentName =
"b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24";
const credential = new DefaultAzureCredential();
const client = new AuthorizationManagementClient(credential, subscriptionId);
const result = await client.roleManagementPolicyAssignments.delete(
scope,
roleManagementPolicyAssignmentName
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
定义
CloudError
来自服务的错误响应。
CloudErrorBody
来自服务的错误响应。
名称 |
类型 |
说明 |
code
|
string
|
错误的标识符。 代码是固定的,旨在以编程方式使用。
|
message
|
string
|
描述错误的消息,该消息适用于在用户界面中显示。
|