简体   繁体   English

Azure:如何找到容器注册表的所有者或资源 ID?

[英]Azure: How can I find the owner or resource ID of a container registry?

Background背景

A year or two ago, when I was learning Azure, I created a container registry (ACR).一两年前,当我在学习 Azure 时,我创建了一个容器注册表(ACR)。

I would now like to use that exact same name again.我现在想再次使用完全相同的名称。 I can either use that same registry, or I would like to delete that registry and start again.我可以使用相同的注册表,或者我想删除该注册表并重新开始。 (It does not have anything useful on it that I do not have in other locations.) (它上面没有我在其他地方没有的任何有用的东西。)

But I cannot seem to figure out which subscription / resource group owns that registry.但我似乎无法弄清楚哪个订阅/资源组拥有该注册表。 I am nearly certain I know which one it was, but when I log on to that account, the registry is not there.几乎可以肯定我知道它是哪一个,但是当我登录该帐户时,注册表不存在。 To be clear, I tried to create it again but it said that the name was not available.需要明确的是,我尝试再次创建它,但它说该名称不可用。 It's a very weird name, so I am pretty sure it is still my old one sitting around somewhere.这是一个非常奇怪的名字,所以我很确定它仍然是我坐在某个地方的旧名字。

Question问题

  • How can I find out the owner of a container registry?如何找到容器注册表的所有者?

In my case, it is a dumb mistake.就我而言,这是一个愚蠢的错误。 But I have to imagine that companies will want a particular name, and even be willing to pay a little to have a particular registry name.但我不得不想象公司会想要一个特定的名称,甚至愿意支付一点费用来拥有一个特定的注册名称。 Is there no way to query Azure to ask for the owner of a container registry?有没有办法查询 Azure 来询问容器注册表的所有者? What happens if I lost the "paperwork" for which subscription owns it, like in my case?如果我丢失了订阅拥有它的“文书工作”会怎样,就像我的情况一样?

I was hoping for something like az acr public show or something like that.我希望有像az acr public show类的东西。

I was hoping for something like az acr public show or something like that我希望有像az acr public show类的东西

There is a CLI command like it:有一个类似的 CLI 命令:

az acr show --name acr_name

You can get all the information about your ACR, int includes the owner resource group and its resource Id.您可以获得有关 ACR 的所有信息,int 包括所有者资源组及其资源 ID。 The resource Id will show you the subscription ID.资源 ID 将显示订阅 ID。

But when you use the CLI, it means you already login and uses the default subscription or set the current subscription.但是当您使用 CLI 时,这意味着您已经登录并使用默认订阅或设置当前订阅。 If you don't know which subscription the ACR in, you need to try this command in all the subscriptions your account has.如果您不知道 ACR 在哪个订阅中,则需要在您帐户的所有订阅中尝试此命令。

And for the owner of the ACR, you need to list all the assignment and filter with your requirements:对于 ACR 的所有者,您需要列出所有分配并根据您的要求进行过滤:

az role assignment list --role Owner --scope acr_resourceId

This CLI command can list all the owners directly to your ACR, but the list does not include the owners that inherit from the subscription.此 CLI 命令可以将所有所有者直接列出到您的 ACR,但该列表不包括从订阅继承的所有者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用资源在 Azure 上创建容器注册表? - How do I create a Container Registry on Azure with a resource? 设置并获取 azure 容器注册表镜像的所有者 - Set and get owner of azure container registry image 如何从 Azure 容器注册表中的映像创建 Dockerfile? - How can I create a Dockerfile FROM an Image in Azure Container Registry? 如何将内容信任策略分配给容器注册表资源 azure powershell - How to assign content trust policy to container registry resource azure powershell 如果用户不是贡献者或所有者,Azure 用户如何创建资源组? - How can an Azure user create a Resource Group if user is not Contributor or Owner? Azure - 如何使用 Container Registry 将 Docker 执行到容器中? - Azure - how do I Docker exec into container with a Container Registry? 我无法在Azure容器注册表中选择图像 - I can't choose image in Azure Container Registry 如何为 Azure 容器注册表编写 docker 映像开发以暂存升级脚本? - How can I write a docker image dev to stage promotion script for Azure container registry? 更新基本映像时,如何更新 azure 容器注册表中的所有映像 - How can I update all images in azure container registry when base image is updated 如何通过Azure Resource Manager模板创建Azure Blob容器/表 - How can I create an Azure Blob Container/Table by Azure Resource Manager template
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM