Skip to content

[QUERY]|Using shared images across tenants. #3819

@darc1

Description

@darc1

Query/Question
I want to use images between tenants using shared image galleries, as described in here using the java sdk, both there is no documentation as to how authentication to 2 different tenants can be done.

Why is this not a Bug or a feature Request?
This can be done using the azure cli, and rest api. I already have a shared image created and the app registration setup, I'm missing on how to deploy the image to a different tenant. These are the steps using the cli:

az account clear
az login --service-principal -u '<app ID>' -p '<Secret>' --tenant '<tenant 1 ID>'
az account get-access-token

az login --service-principal -u '<app ID>' -p '<Secret>' --tenant '<tenant 2 ID>'
az account get-access-token

az vm create \
  --resource-group myResourceGroup \
  --name myVM \
  --image "/subscriptions/<Tenant 1 subscription>/resourceGroups/<Resource group>/providers/Microsoft.Compute/galleries/<Gallery>/images/<Image definition>/versions/<version>" \
  --admin-username azureuser \
  --generate-ssh-keys

Setup (please complete the following information if applicable):

  • OS: ubuntu
  • IDE : intelliJ
  • Version of the Library used : 1.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compute - VMMgmtThis issue is related to a management-plane library.Service AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions