How to a create command line (CLI) project. I like to add Azure CLI commands to end users in my Angular project. Presently I am tyring to do using C#. So please help me how to do CLI in Angular or C# to integrate my Azure CLI commands
2 Answers
Angular cannot directly run the CLI commands as this would be a security flaw in the browser.
If you were to acquire a user token from an app registration, you could call Microsoft Graph APIs on behalf of a user. Very detailed explanation on how to do this here: https://learn.microsoft.com/en-us/graph/tutorials/angular
The other option is to call a C# Web API and run Microsoft Graph or the Azure CLI from the web server. Microsoft Graph SDK is the preferred mechanism from C#, but you could also use System.Diagnostics.Process to launch and run Azure CLI commands.