When I execute the below PowerShell script to create a custom Azure Role based on the specific JSON content below.
Script:
$paramNewAzRoleDefinition = @{
InputFile = C:\Custom.JSON
Verbose = $true
Debug = $true
}
New-AzRoleDefinition @paramNewAzRoleDefinition
JSON File:
{
"Name": "Custom Role - Device Management Team",
"IsCustom": true,
"Description": "3rd party external contractor",
"NotActions": [
],
"Actions": [
"Device.ReadWrite.All",
"DeviceManagementApps.ReadWrite.All",
"DeviceManagementConfiguration.ReadWrite.All",
"DeviceManagementManagedDevices.ReadWrite.All",
"DeviceManagementServiceConfig.ReadWrite.All",
"Directory.ReadWrite.All"
],
"AssignableScopes": [
"d8423ac7-ea13-4ae7-8661-b53cdd2683c3"
]
}
Error:
Body:
{
"error": {
"code": "InvalidActionOrNotAction",
"message": "'Device.ReadWrite.All' does not match any of the actions supported by the providers."
}
}
New-AzRoleDefinition : Operation returned an invalid status code 'BadRequest'
+
New-AzRoleDefinition @paramNewAzRoleDefinition
```haskell
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : CloseError: (:) [New-AzRoleDefinition], ErrorResponseException
- FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureRoleDefinitionCommand
Any help would be greatly appreciated.