Coder Social home page Coder Social logo

Comments (10)

Fred-sun avatar Fred-sun commented on August 28, 2024

@Michandrz No matter you use the environment variables or the ~/. azure/credentials pass returns only the currently specified subscrition user information. Because it points to the individual.

If you want to obtain full subscription information, it is recommended that you login through 'az login' and specify auth to obtain the subscription information. All subscription_id information will be saved in the az configuration. Thank you!

Example:
    - name: Get facts for all subscriptions
      azure_rm_subscription_info:
        all: true
        auth_source: cli

Return value:
ok: [localhost] => {
    "output": {
        "changed": false,
        "failed": false,
        "subscriptions": [
            {
                "display_name": "VS Code Exp Workspace",
                "fqid": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "state": "Enabled",
                "subscription_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "tags": {
                    "C-AI-MG-Placement-Subscription-Level": "2023-12-04"
                },
                "tenant_id": "dddddddd-dddd-dddd-dddd-dddddddddddd"
            },
            {
                "display_name": "AzureDevOpsCommunity",
                "fqid": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "state": "Enabled",
                "subscription_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "tags": null,
                "tenant_id": "dddddddd-dddd-dddd-dddd-dddddddddddd"
            },
            {
                "display_name": "DevDiv Key Vault",
                "fqid": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "state": "Enabled",
                "subscription_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "tags": {
                    "DDFunMDCTag": "Public"
                },
                "tenant_id": "dddddddd-dddd-dddd-dddd-dddddddddddd"
            },
......
......

from azure.

Michandrz avatar Michandrz commented on August 28, 2024

@Fred-sun My use case is to be able to pull an inventory list from multiple subscriptions dynamically. Your proposed solution would be a cached collection of subscriptions, not a current one, which would provide inaccurate information.

Additionally Using az login and providing credentials via a file is not viable/practical as this is an AWX K8 system.

from azure.

Fred-sun avatar Fred-sun commented on August 28, 2024

@Michandrz Thank you very much for your feedback, I will continue to survey. Thank you!

from azure.

Fred-sun avatar Fred-sun commented on August 28, 2024

@Michandrz Can you increase your single tenant rights and try again? Because in a single-tenant scenario, the subscription currently used does not have the required reading rights. To assign such rights, you must also obtain the management consent of the tenant. You can refrence this link(https://learn.microsoft.com/en-us/graph/permissions-reference#subscriptionreadall). Thank you very much!

from azure.

Michandrz avatar Michandrz commented on August 28, 2024

All my subscriptions are under one tenant. I will try and report back though.

from azure.

Fred-sun avatar Fred-sun commented on August 28, 2024

@Michandrz Any feedback?

from azure.

Michandrz avatar Michandrz commented on August 28, 2024

Not yet. Sadly, it'll be early next week before I can get back into this.

from azure.

Fred-sun avatar Fred-sun commented on August 28, 2024

kindly ping!

from azure.

Michandrz avatar Michandrz commented on August 28, 2024

Yup that did it! I'm now getting all subscriptions. Thanks!

from azure.

Fred-sun avatar Fred-sun commented on August 28, 2024

@Michandrz Ok, I will closed it! Thank you very much!

from azure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.