how to fix New-AzRoleDefinition: File /home/taslim/az104-02a-customROleDefinitio.json does not exist ?

Taslim khan 0 Reputation points
2023-03-08T20:16:03.18+00:00

how to fix this error in Azure PowerShell. New-AzRoleDefinition: File /home/taslim/az104-02a-customROleDefinitio.json does not exist,

Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
298 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 20,047 Reputation points Microsoft Employee
    2023-03-28T01:44:09.7266667+00:00

    This error may occur if the file path or name is incorrect or if the file does not exist in the specified location. You can try to check the spelling of the file name and path, or create a new file with the correct name and content.
    Alternatively, you can use the Get-AzRoleDefinition command to generate a baseline role definition object, modify its properties as required, and then use the New-AzRoleDefinition command to create a custom role using the role definition object.

    https://learn.microsoft.com/en-us/azure/role-based-access-control/custom-roles-powershell

    If you are still seeing issues after following the steps shared above, please let me know in the "comments". I will then investigate further and determine the next steps for you.

    If this helps, please 'Accept answer' so that it can help others in the community looking for help on the same topic.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.