Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.21k stars 3.82k forks source link

[Feature Request] Support image operations on Container Registries #7599

Open oskarm93 opened 5 years ago

oskarm93 commented 5 years ago

Hello.

I would like to perform a number of basic operations on images stored in ACR using Azure PowerShell. At least some operations listed here: https://docs.microsoft.com/en-us/azure/role-based-access-control/resource-provider-operations#microsoftcontainerregistry

Like listing images, removing them etc. I can currently do it with Azure CLI like so: az acr repository list -n

I don't want yet another tool to manage Azure. CLI is a bigger pain to operate when you are already in PowerShell world.

MiYanni commented 5 years ago

@djyou Can you respond to @xenalite's request?

sajayantony commented 5 years ago

Looping in @SteveLasker to comment more.

bergmeister commented 5 years ago

Any updates on the roadmap of this? I see there are already cmdlets for interacting with the container registry here in Az.ContainerRegistry but not for doing builds, i.e. the equivalent of az acr build is still missing

MiYanni commented 5 years ago

@bergmeister In terms of roadmap, we are looking to make changes in the next couple months that will begin to align Azure PowerShell better will all functionality offered by the REST API of the Azure services. Keep on the lookout for a preview of this design during the summer.

JustinGrote commented 1 year ago

Ping this again, az acr build still has no equivalent to my knowledge.

MiYanni commented 1 year ago

I don't work on this team anymore (haven't been there for some number of years now). However, I helped build the generation mechanism they use. I looked here and saw a containerregistry_build.json being linked. This means it can generate cmdlets from this spec if they have it configured to do so. Looking at the description for az acr build, you'll notice it specifically says, "Queues a quick build". I looked though the aforementioned spec, and it I saw this:

"runType": {
  "description": "The type of run.",
  "enum": [
    "QuickBuild",
    "QuickRun",
    "AutoBuild",
    "AutoRun"
  ],
...

That RunFilter definition is used for this. which is this operation. The issue is, these run filters are considered OData, and (at the time I worked on this) we didn't have the generator work with OData information. Ah ha! I had made this issue for handling OData information.

As it stands, I don't see cmdlets based on this spec, but the SDK for them exists. At this point, someone could create a custom cmdlet using the SDK that does the same thing as az acr build, but that would have to be done by the ContainerRegistry team.

TDLR: The internal wiring to make the REST calls is generated and in the SDK in the repo. However, the ContainerRegistry team would need to write the code to create a custom cmdlet to call these operations from the SDK.