Comments (10)
@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.
@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.
@Michandrz Thank you very much for your feedback, I will continue to survey. Thank you!
from azure.
@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.
All my subscriptions are under one tenant. I will try and report back though.
from azure.
@Michandrz Any feedback?
from azure.
Not yet. Sadly, it'll be early next week before I can get back into this.
from azure.
kindly ping!
from azure.
Yup that did it! I'm now getting all subscriptions. Thanks!
from azure.
@Michandrz Ok, I will closed it! Thank you very much!
from azure.
Related Issues (20)
- Hi, @Fred-sun and @markstoel.
- Login via Federated Credentials for Managed Identities HOT 1
- azure_rm_adapplication is not idempotent HOT 3
- azure_rm_adgroup_info returns error if device is not member of group HOT 2
- Feature Request: azure_rm_virtualmachine powerstate as a single parameter HOT 2
- Add option for web file source to azure_rm_storageblob module
- azure_rm_storageaccount: Add allowSharedKeyAccess as option HOT 2
- Creating snapshot of Premium SSD v2 managed disk fails due to module using 2019-03-01 api-version HOT 2
- [azure_rm_openshiftmanagedcluster] Add support for outbound-type HOT 2
- Creation of azure_rm_openshiftmanagedclusterversion_info module
- azure-identity pinned version has vulnerability HOT 2
- azure_rm_storageaccount_info needed azure.mgmt.datalake HOT 3
- Azure RM Inventory plugin does not return all hosts all the time HOT 22
- Add support to Azure StackHCI vms in the inventory plugin
- Unable to install collection via ansible-galaxy command HOT 5
- [azure_rm_openshiftmanagedcluster] properties.clusterProfile.resourceGroupId set to null, produces error HOT 1
- [azure_rm_openshiftmanagedclusterkubeconfig_info] fails -
- Querying for image-versions fails on empty set. HOT 1
- restorable_dropped_database_id isn't a valid parameter for the azure_rm_sqldatabase module, but it is in the Examples. HOT 3
- Bind the DataProtection API for Azure Backups
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure.