Closed cveld closed 3 years ago
Thanks for the question @cveld and apologies for not responding sooner.
Have you figured out how to get the currently selected subscriptionId or do you still need help with that?
No update for 1 month. Close this item and @cveld, please let us know if you have more information for this ask.
How can we get the current az-cli context or az-PowerShell context from within a nodejs Azure workload?
https://azure.github.io/azure-sdk-for-node/Documentation/Authentication.md currently gives a 404.
https://github.com/Azure/azure-sdk-for-node/blob/master/Documentation/Authentication.md does not describe a way to reuse the existing contexts.
Related: Can we run nodejs workloads within Azure Pipelines using an Azure Service Connection?
I am able to fetch the access token. But how do I initialize the library with this?
update
I read the docs on https://github.com/Azure/ms-rest-nodeauth and there actually is a built-in feature to work with the az-cli!
Remaining question: How to get the currently selected subscriptionId?