AzureActiveDirectoryAuthCLITool 1.0.0

dotnet tool install --global AzureActiveDirectoryAuthCLITool --version 1.0.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local AzureActiveDirectoryAuthCLITool --version 1.0.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=AzureActiveDirectoryAuthCLITool&version=1.0.0
nuke :add-package AzureActiveDirectoryAuthCLITool --version 1.0.0

Azure Active Directory Auth CLI Tool

Powershell Tool

Designed to make it easy to get an auth token via Powershell for using an API that is secured by AAD (Azure Active Directory).

Assumptions: You have an API that is secured via Client Secret rather than a certificate.

Usage

Pass values for each of these values to gain an valid bearer token. Instance will default to https://login.microsoftonline.com/.

aadauth --TenantId xxx --ClientId xxx --Secret xxx --Scopes xxx

aadauth -t xxx --c xxx -s xxx -o xxx

-i, --Instance The AAD Instance url. Defaults to https://login.microsoftonline.com/

-t, --TenantId Required. The AAD TenantId.

-c, --ClientId Required. The AAD ClientId.

-s, --Secret Required. The AAD Client Secret.

-o, --Scopes Required. A comma-separated list of AAD Client Scopes. It is ok to only have one.

Installation

Prerequisites:

  • Azure CLI installed. Instructions
  • Logged into Azure with CaliberFS ADO credentials. From PowerShell: az login

From PowerShell:

dotnet tool install --global AzureActiveDirectoryAuthCLITool

Project Setup

These three lines were needed in the csproj:

<PackAsTool>true</PackAsTool>
<ToolCommandName>aadauth</ToolCommandName>

Building and deploying

Terminal command must be run in the terminal from the location of the csproj. I think install works differently if using a non-local nupkg. More on that when I figure it out.

  • build solution
  • create a nupkg in the PackageOutputPath location

    dotnet pack

  • install the tool globally

    dotnet tool install --global AzureActiveDirectoryAuthCLITool

Update the tool

dotnet tool install --global AzureActiveDirectoryAuthCLITool --version [x.x.x]

Uninstall the tool

dotnet tool uninstall AzureActiveDirectoryAuthCLITool -g

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.0 179 7/5/2023