can anyone know how to attach ACR from different subscriptions to AKS in Azure?
I am looking for any info about that, alas I've found only a topic https://github.com/Azure/AKS/issues/243 where someone said that this is fixed but unfortunately there's no info how to achieve that?
Asked
Active
Viewed 6,143 times
5

4c74356b41
- 69,186
- 6
- 100
- 141

Michał Marcinkowski
- 612
- 4
- 20
-
it shouldn't matter if its from the same subscription or not (unless cross-tenants), you are probably doing something wrong, can you show what you are doing? – 4c74356b41 Feb 13 '20 at 14:48
-
The ACR is also in the different resource group. I'm writing `az aks update --name my-aks --resource-group my-aks-resource-group --attach-acr acr-id` – Michał Marcinkowski Feb 14 '20 at 06:34
-
1doesnt matter, whats the error you are getting? – 4c74356b41 Feb 14 '20 at 06:37
-
1The resource with name 'id' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription 'subs name (subs id)' – Michał Marcinkowski Feb 14 '20 at 06:38
-
1well, that means exactly that, its not there – 4c74356b41 Feb 14 '20 at 06:45
-
Yep... I've provided ACR with some additional char at the end. Simple and stupid. But many thanks to you @4c74356b41 for help and confirming that this is possible. Hopes that someone will take advantage from this question. Best regards! – Michał Marcinkowski Feb 14 '20 at 06:48
-
@4c74356b41 it shouldn't matter, but it does: `> az aks update --attach-acr ACR-name --name AKS-name --resource-group Resource-Group-name The resource with name 'ACR-name' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription 'Subscription-name (subsription-ID)'`. It clearly shows that by default Azure looks for the resource group and the ACR in the same subscription. – karatedog Mar 22 '21 at 01:44
1 Answers
11
in this case the answer was to provide the proper input (typo in the ACR ID).

4c74356b41
- 69,186
- 6
- 100
- 141
-
7For anyone else also having this issue here is an example of the command I used: `az aks update -g "Some-AKS-RG" -n "Some-Cluster" --attach-acr "/subscriptions/
/resourceGroups/ – Jeff Apr 16 '20 at 15:05/providers/Microsoft.ContainerRegistry/registries/ ` The initial slash is very important apparently -
1That is the real answer. The proper ACR path can be obtained by querying the ACR resource with `az resource list --name
`. The path will be the value of the "id" key. – karatedog Mar 22 '21 at 01:54 -
It says: `ERROR: Subscription '[MASKED]' not found. Check the spelling and casing and try again.` – HelmBurger Jul 26 '22 at 07:22
-
So I had to give the Service Princpal access to that susbcription. Works fine now. – HelmBurger Jul 26 '22 at 08:56