none
Powershell code to assign ArcImageSigner azure container registry instance RRS feed

  • Question

  • Hi I have service account principal id, secret and tenant id.

    I created azure container registry under 1 resource group.

    I am need to assign ArcImageSigner role to this azure container registry.

    How can i do this in powershell

    I tried below but doesn't work::

        $registry = Get-AzContainerRegistry -ResourceGroupName $resourceGroupName -Name $acrName
        $sp = Get-AzADServicePrincipal -ServicePrincipalName "..................."
        $role = New-AzRoleAssignment -ObjectId $sp.Id -RoleDefinitionName "ArcImageSigner" -Scope $registry.Id      



    $registry = Get-AzContainerRegistry -ResourceGroupName "..........." -Name "............"
    New-AzRoleAssignment -ApplicationId "...................." -RoleDefinitionName "AcrImageSigner" -Scope $registry.Id

    Can you please help me in assigning ArcImageSigner role to ACR

    Tuesday, December 3, 2019 9:00 AM

All replies

  • HI Jayashree,

    Are you getting any error while running "New-AzRoleAssignment"

    Make sure you have value in the $sp.Id.  You need to provide service principal name in a format where it starts with "http"

    example is "http://azure-cli-2019-12-03-12-17-42"

    Then the role definition name is wrong.  It should be AcrImageSigner and not ArcImageSigner.   You got it right in the second example.

    Do the above two checks and then it should go through.  Let me know if you still get an error.

    For the benefit of the community, Click on "mark as answer" for the replies which helped you to solve your problem

    Tuesday, December 3, 2019 12:27 PM
    Moderator
  • HI Jayashree,

    Is there any update?

    Thursday, December 5, 2019 8:53 AM
    Moderator
  • Hello,

    Any update on the issue?

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.

    Thanks.
    Wednesday, December 11, 2019 4:46 AM
    Moderator
  • Hello,

    Any update on the issue?

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.

    Thanks.
    Wednesday, December 18, 2019 1:54 AM
    Moderator