How to extract resource group name and subscription ID from containers in Azure Container Apps and Azure Container Instances

PS 170 Reputation points
2024-05-29T06:01:47.6366667+00:00

Is it possible to extract the resource group name and subscription ID from within containers running in Azure Container Apps and Azure Container Instances? If so, can anyone provide information on how to accomplish this?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
716 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
474 questions
0 comments No comments
{count} votes

Accepted answer
  1. AlaaBarqawi_MSFT 942 Reputation points Microsoft Employee
    2024-05-29T07:06:08.2633333+00:00

    Hi @PS,

    Welcome to Microsoft Q&A platform , to clarify the requirement , you need from inside shell of running container to get the subscription/rg?

    if that is the case , can you pass subscription/rg as environment variable inside the ACI container ,

    and then you can consume it inside ACI

    because inside the shell of running container it will not be aware of the context as subscription or resource group .


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.