Support for multi-tenant shared gallery images
Is your feature request related to a problem? Please describe.
- When someone shares an image with me from a shared image gallery, it's frustrating that the only way to provision a VM with those is through the Azure CLI or Powershell, when I would like to be using Python.
- It's frustrating to have to manage credentials and authenticate across multiple tenants to list all of the shared gallery images available to me from other subscriptions and tenants. I don't even know if listing is possible from all sources today.
Describe the solution you'd like
- I would like to be able to list all shared gallery images that I have access to, whether they are from another tenant, another subscription, etc. within the same API call.
- I would like to be able to provision VMs using those shared gallery images from across tenants using the Python SDK.
Describe alternatives you've considered There doesn't seem to be a workaround.
Additional context I have a limited understanding of how Azure tenants / subscriptions and sharing works across those, so please excuse my lack of knowledge and feel free to clarify anything for me.
It turns out we don't need to support multi-tenant after all (phew), just multiple subscription sharing on one tenant.
@gsimore Thanks for opening this issue. We'll follow up with you after we take a look at the feature request.
We don't support multi-subscription operation for now.
Hi @Abyssknight , help to give an example for how to go through multiple subscription
We were able to solve our issue by first calling the subscription client to list all subscriptions available to the tenant, then instantiating a new client for each one, and calling into the galleries api to list all shared gallery images available to each subscription.
We were able to solve our issue by first calling the subscription client to list all subscriptions available to the tenant, then instantiating a new client for each one, and calling into the galleries api to list all shared gallery images available to each subscription.
@gsimore can you please share some sample code which you tried..we have same use case, it will be helpful
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @avirishuv.
Hi compute team, would have a look at this? multi-tenant shared gallery images query interfaces is expected.
Hi compute team, would have a look at this? multi-tenant shared gallery images query interfaces is expected.
@changlong-liu would llike to see if you any existing python sdk example to achieve this. It will be helpful
any update on this please
Hi @onenessboy , no existing SDK doing this. Need to list all subscriptions and then query gallery images one by one.
list subscription like this:
from azure.mgmt.resource import SubscriptionClient
client = SubscriptionClient(credentials=credential)
for sub in client.subscriptions.list():
print(sub.subscription_id)
@changlong-liu There are two issues here:
- List all galleries (within and from other tenants) that a user has access to using Python SDK. I'm checking whether its possible with API today.
- Deploy VMs from shared image gallery images from other tenants using Python SDK. This is possible today with API, CLI, PowerShell etc., but seems like Python SDK doesn't support it. We might want to check if Python SDK supports auxiliary tokens - if they do, cross tenant scenarios will be achievable.
Hi @axayjo ,
Would you suggest which RESTFUL API can achieve across tenant gallery operations? Is it defined in the azure-rest-api-specs repo?
The gallery related Python SDK operations are generated from this swagger file: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/Microsoft.Compute/stable/2019-12-01/gallery.json I don't see interfaces for listing all galeries/deploy images across tenants exposed in that file.
Hi @changlong-liu
I'm looking at the listing capability on the API side.
The #2 in my earlier comment was around Python SDK support for cross tenant scenarios in general that requires an auxiliary token - is that supported?
Hi @axayjo , would you help indicate how CLI support cross tenant? I can then check the corresponding Python SDK behavior?.
Adding @amjads1 and removing @axayjo
Apologies for the delay, looking into the issue.
Hi @gsimore. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.
Hi @gsimore, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.