none
Enabling Content Trust in ACR Policies using PowerShell RRS feed

  • Question

  • I am trying to enable the Content Trust using Powershell but there is no help or link provided for this.

    Although I can do it from the portal as well as using Azure CLI but in my scenario I have to enable Content Trust in Policies inside my ACR.

    Can you please help me how I can achieve it using Powershell?

    Thursday, August 1, 2019 5:08 AM

Answers

  • Hello Prakash Singh,

    Thanks for posting your question here.

    I have checked and validated on your ask for PowerShell commands similar to Portal and Azure CLI for enabling Content Trust for ACR policies, but currently it is not available. 

    As a work around, If you want to do with only PowerShell, you can create a function and trigger API's from that function.

    I have tried triggering the API and was successful in enabling and disabling the ACR Policies Content trust. Here is the API document for your reference. Below is the request body for API POST method:

    {
      "quarantinePolicy": {
        "status": "disabled"
      },
      "trustPolicy": {
        "status": "enabled",
        "type": "Notary"
      }
    }

    I would recommend you to post this ask as feedback in feedback.azure.com, so this can be brought to ACR Product group notice as a feature request. 

    Please let me know if you need any further assistance on the issue.

    If the above provided suggestion addresses your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post, this can be beneficial to other community members.

    Thanks.


    Thursday, August 1, 2019 8:48 AM
    Moderator

All replies

  • Hello Prakash Singh,

    Thanks for posting your question here.

    I have checked and validated on your ask for PowerShell commands similar to Portal and Azure CLI for enabling Content Trust for ACR policies, but currently it is not available. 

    As a work around, If you want to do with only PowerShell, you can create a function and trigger API's from that function.

    I have tried triggering the API and was successful in enabling and disabling the ACR Policies Content trust. Here is the API document for your reference. Below is the request body for API POST method:

    {
      "quarantinePolicy": {
        "status": "disabled"
      },
      "trustPolicy": {
        "status": "enabled",
        "type": "Notary"
      }
    }

    I would recommend you to post this ask as feedback in feedback.azure.com, so this can be brought to ACR Product group notice as a feature request. 

    Please let me know if you need any further assistance on the issue.

    If the above provided suggestion addresses your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post, this can be beneficial to other community members.

    Thanks.


    Thursday, August 1, 2019 8:48 AM
    Moderator
  • Hello Prakash,

    Just checking in if you have had a chance to see my previous response.

    If this solved your issue, do click “Mark as Answer” and "Up-Vote" so that other forum members can benefit from it.

    If you need any further help do let us know.

    Thanks.

    Monday, August 5, 2019 6:48 AM
    Moderator
  • Thanks Vikas. It helped.
    Tuesday, August 6, 2019 7:02 AM