Hi Varma, I try to replicate your error, however your command looks good, this is the code and files used: myRoleImageCreation.json
{
"Name": "Azure Image Builder Service Image Creation Role",
"IsCustom": true,
"Description": "Image builder access to create resources for the image build, you should delete or",
"Actions": [
"Microsoft.Compute/galleries/read",
"Microsoft.Compute/galleries/images/read",
"Microsoft.Compute/galleries/images/versions/read",
"Microsoft.Compute/galleries/images/versions/write",
"Microsoft.Compute/images/read",
"Microsoft.Compute/images/read",
"Microsoft.Compute/images/write"
],
"NotActions": [],
"AssignableScopes": [
"/subscriptions/<subscriptionId>/resourceGroups/<rgName>"
]
}
Powershell used to update content:
$myRoleImageCreationPath = "myRoleImageCreation.json"
$Content = Get-Content -Path $myRoleImageCreationPath
$subscriptionID = "MySusbcriptionID"
$imageResourceGroup = "MyResourceGroupName"
$imageRoleDefName = "MyRoleName"
$Content = $Content -replace '<subscriptionID>', $subscriptionID
$Content = $Content -replace '<rgName>', $imageResourceGroup
$Content = $Content -replace 'Azure Image Builder Service Image Creation Role', $imageRoleDefName
$Content | Out-File -FilePath $myRoleImageCreationPath -Force
This is the output with the content updated:
{
"Name": "MyRoleName",
"IsCustom": true,
"Description": "Image builder access to create resources for the image build, you should delete or",
"Actions": [
"Microsoft.Compute/galleries/read",
"Microsoft.Compute/galleries/images/read",
"Microsoft.Compute/galleries/images/versions/read",
"Microsoft.Compute/galleries/images/versions/write",
"Microsoft.Compute/images/read",
"Microsoft.Compute/images/read",
"Microsoft.Compute/images/write"
],
"NotActions": [],
"AssignableScopes": [
"/subscriptions/MySusbcriptionID/resourceGroups/MyResourceGroupName"
]
}
Let me know the error that you are getting from the file update in order to help you. Cheers Luis
If the information helped address your question, please Accept the answer.