ms-rest-azure package

Classes

ApplicationTokenCredentials

Creates a new ApplicationTokenCredentials object. See Active Directory Quickstart for .Net for detailed instructions on creating an Azure Active Directory application.

AzureEnvironment
AzureServiceClient
BaseResource

Defines the base class for a Resource in Azure. It is an empty class.

CloudError
CognitiveServicesCredentials

Creates a new CognitiveServicesCredentials object.

DeviceTokenCredentials

Creates a new DeviceTokenCredentials object.

KeyVaultCredentials

An object that performs authentication for Key Vault.

MSIAppServiceTokenCredentials
MSITokenCredentials
MSIVmTokenCredentials
TopicCredentials

Creates a new CognitiveServicesCredentials object.

UserTokenCredentials

Creates a new UserTokenCredentials object. See Active Directory Quickstart for .Net for an example.

Interfaces

AuthFileOptions
AuthResponse
AzureServiceClientOptions
AzureTokenCredentialsOptions
DeviceTokenCredentialsOptions
InteractiveLoginOptions
LinkedSubscription
LinkedUser

The user associated to a subscription in Azure.

LoginWithUsernamePasswordOptions
LongRunningPathTemplateBasedRequestPrepareOptions
LongRunningUrlBasedRequestPrepareOptions
MSIAppServiceOptions
MSIOptions
MSIVmOptions
TokenResponse

Type Aliases

AzureEnvironmentParameters
CloudErrorParameters

Enums

UserType

The user type associated to a subscription in Azure.

Functions

interactiveLogin(InteractiveLoginOptions, (err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

interactiveLogin((err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

interactiveLogin(InteractiveLoginOptions)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

interactiveLoginWithAuthResponse(InteractiveLoginOptions)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

loginWithAppServiceMSI((err: Error, credentials: MSIAppServiceTokenCredentials) => void)

Authenticate using the App Service MSI.

loginWithAppServiceMSI(MSIAppServiceOptions, (err: Error, credentials: MSIAppServiceTokenCredentials) => void)

Authenticate using the App Service MSI.

loginWithAppServiceMSI(MSIAppServiceOptions)

Authenticate using the App Service MSI.

loginWithAuthFile(AuthFileOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

loginWithAuthFile((err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

loginWithAuthFile(AuthFileOptions, (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

loginWithAuthFileWithAuthResponse(AuthFileOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

loginWithMSI((err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

loginWithMSI(MSIVmOptions, (err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

loginWithMSI(MSIVmOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

loginWithServicePrincipalSecret(string, string, string, AzureTokenCredentialsOptions, (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides an ApplicationTokenCredentials object.

loginWithServicePrincipalSecret(string, string, string, (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides an ApplicationTokenCredentials object.

loginWithServicePrincipalSecret(string, string, string, AzureTokenCredentialsOptions)

Provides an ApplicationTokenCredentials object.

loginWithServicePrincipalSecretWithAuthResponse(string, string, string, AzureTokenCredentialsOptions)

Provides an ApplicationTokenCredentials object.

loginWithUsernamePassword(string, string, LoginWithUsernamePasswordOptions, (err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

loginWithUsernamePassword(string, string, (err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

loginWithUsernamePassword(string, string, LoginWithUsernamePasswordOptions)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

loginWithUsernamePasswordWithAuthResponse(string, string, LoginWithUsernamePasswordOptions)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

loginWithVmMSI((err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

loginWithVmMSI(MSIVmOptions, (err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

loginWithVmMSI(MSIVmOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

Function Details

interactiveLogin(InteractiveLoginOptions, (err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

function interactiveLogin(options: InteractiveLoginOptions, optionalCallback: (err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

optionalCallback
(err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

interactiveLogin((err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

function interactiveLogin(optionalCallback: (err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

optionalCallback
(err: Error, credentials: DeviceTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

interactiveLogin(InteractiveLoginOptions)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

function interactiveLogin(options?: InteractiveLoginOptions)

Parameters

Returns

interactiveLoginWithAuthResponse(InteractiveLoginOptions)

Provides a url and code that needs to be copy and pasted in a browser and authenticated over there. If successful, the user will get a DeviceTokenCredentials object

function interactiveLoginWithAuthResponse(options?: InteractiveLoginOptions)

Parameters

Returns

Promise<AuthResponse>

loginWithAppServiceMSI((err: Error, credentials: MSIAppServiceTokenCredentials) => void)

Authenticate using the App Service MSI.

function loginWithAppServiceMSI(callback: (err: Error, credentials: MSIAppServiceTokenCredentials) => void)

Parameters

callback
(err: Error, credentials: MSIAppServiceTokenCredentials) => void

loginWithAppServiceMSI(MSIAppServiceOptions, (err: Error, credentials: MSIAppServiceTokenCredentials) => void)

Authenticate using the App Service MSI.

function loginWithAppServiceMSI(options: MSIAppServiceOptions, callback: (err: Error, credentials: MSIAppServiceTokenCredentials) => void)

Parameters

callback
(err: Error, credentials: MSIAppServiceTokenCredentials) => void

loginWithAppServiceMSI(MSIAppServiceOptions)

Authenticate using the App Service MSI.

function loginWithAppServiceMSI(options?: MSIAppServiceOptions)

Parameters

Returns

loginWithAuthFile(AuthFileOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

function loginWithAuthFile(options?: AuthFileOptions)

Parameters

options
AuthFileOptions

Returns

loginWithAuthFile((err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

function loginWithAuthFile(callback: (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

callback
(err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

Returns

loginWithAuthFile(AuthFileOptions, (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

function loginWithAuthFile(options: AuthFileOptions, callback: (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

options
AuthFileOptions
callback
(err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

Returns

loginWithAuthFileWithAuthResponse(AuthFileOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. Then execute az ad sp create-for-rbac --sdk-auth > ${yourFilename.json}. If you want to create the sp for a different cloud/environment then please execute:

  1. az cloud list
  2. az cloud set –n
  3. az ad sp create-for-rbac --sdk-auth > auth.json If the service principal is already created then login with service principal info:
  4. az login --service-principal -u -p -t
  5. az account show --sdk-auth > auth.json

Authenticates using the service principal information provided in the auth file. This method will set the subscriptionId from the auth file to the user provided environment variable in the options parameter or the default 'AZURE_SUBSCRIPTION_ID'.

function loginWithAuthFileWithAuthResponse(options?: AuthFileOptions)

Parameters

options
AuthFileOptions

Returns

Promise<AuthResponse>

loginWithMSI((err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

function loginWithMSI(callback: (err: Error, credentials: MSIVmTokenCredentials) => void)

Parameters

callback
(err: Error, credentials: MSIVmTokenCredentials) => void

loginWithMSI(MSIVmOptions, (err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

function loginWithMSI(options: MSIVmOptions, callback: (err: Error, credentials: MSIVmTokenCredentials) => void)

Parameters

options
MSIVmOptions
callback
(err: Error, credentials: MSIVmTokenCredentials) => void

loginWithMSI(MSIVmOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

function loginWithMSI(options?: MSIVmOptions)

Parameters

options
MSIVmOptions

Returns

loginWithServicePrincipalSecret(string, string, string, AzureTokenCredentialsOptions, (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides an ApplicationTokenCredentials object.

function loginWithServicePrincipalSecret(clientId: string, secret: string, domain: string, options: AzureTokenCredentialsOptions, callback: (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

clientId
string

The active directory application client id also known as the SPN (ServicePrincipal Name). See Active Directory Quickstart for .Net for an example.

secret
string

The application secret for the service principal.

domain
string

The domain or tenant id containing this application.

callback
(err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

loginWithServicePrincipalSecret(string, string, string, (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides an ApplicationTokenCredentials object.

function loginWithServicePrincipalSecret(clientId: string, secret: string, domain: string, callback: (err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

clientId
string
secret
string
domain
string
callback
(err: Error, credentials: ApplicationTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

loginWithServicePrincipalSecret(string, string, string, AzureTokenCredentialsOptions)

Provides an ApplicationTokenCredentials object.

function loginWithServicePrincipalSecret(clientId: string, secret: string, domain: string, options?: AzureTokenCredentialsOptions)

Parameters

clientId
string
secret
string
domain
string

Returns

loginWithServicePrincipalSecretWithAuthResponse(string, string, string, AzureTokenCredentialsOptions)

Provides an ApplicationTokenCredentials object.

function loginWithServicePrincipalSecretWithAuthResponse(clientId: string, secret: string, domain: string, options?: AzureTokenCredentialsOptions)

Parameters

clientId
string

The active directory application client id also known as the SPN (ServicePrincipal Name). See Active Directory Quickstart for .Net for an example.

secret
string

The application secret for the service principal.

domain
string

The domain or tenant id containing this application.

Returns

Promise<AuthResponse>

loginWithUsernamePassword(string, string, LoginWithUsernamePasswordOptions, (err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

function loginWithUsernamePassword(username: string, password: string, options: LoginWithUsernamePasswordOptions, callback: (err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

username
string

The user name for the Organization Id account.

password
string

The password for the Organization Id account.

callback
(err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

loginWithUsernamePassword(string, string, (err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

function loginWithUsernamePassword(username: string, password: string, callback: (err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void)

Parameters

username
string
password
string
callback
(err: Error, credentials: UserTokenCredentials, subscriptions: Array<LinkedSubscription>) => void

loginWithUsernamePassword(string, string, LoginWithUsernamePasswordOptions)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

function loginWithUsernamePassword(username: string, password: string, options?: LoginWithUsernamePasswordOptions)

Parameters

username
string
password
string

Returns

loginWithUsernamePasswordWithAuthResponse(string, string, LoginWithUsernamePasswordOptions)

Provides a UserTokenCredentials object. This method is applicable only for organizational ids that are not 2FA enabled. Otherwise please use interactive login.

function loginWithUsernamePasswordWithAuthResponse(username: string, password: string, options?: LoginWithUsernamePasswordOptions)

Parameters

username
string

The user name for the Organization Id account.

password
string

The password for the Organization Id account.

Returns

Promise<AuthResponse>

loginWithVmMSI((err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

function loginWithVmMSI(callback: (err: Error, credentials: MSIVmTokenCredentials) => void)

Parameters

callback
(err: Error, credentials: MSIVmTokenCredentials) => void

loginWithVmMSI(MSIVmOptions, (err: Error, credentials: MSIVmTokenCredentials) => void)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

function loginWithVmMSI(options: MSIVmOptions, callback: (err: Error, credentials: MSIVmTokenCredentials) => void)

Parameters

options
MSIVmOptions
callback
(err: Error, credentials: MSIVmTokenCredentials) => void

loginWithVmMSI(MSIVmOptions)

Before using this method please install az cli from https://github.com/Azure/azure-cli/releases. If you have an Azure virtual machine provisioned with az cli and has MSI enabled, you can then use this method to get auth tokens from the VM. To create a new VM, enable MSI, please execute this command: az vm create -g <resource_group_name> -n <vm_name> --assign-identity --image <os_image_name> Note: the above command enables a service endpoint on the host, with a default port 50342

To enable MSI on a already provisioned VM, execute the following command: az vm --assign-identity -g <resource_group_name> -n <vm_name> --port <custom_port_number>

To know more about this command, please execute: az vm --assign-identity -h

Authenticates using the identity service running on an Azure virtual machine. This method makes a request to the authentication service hosted on the VM and gets back an access token.

function loginWithVmMSI(options?: MSIVmOptions)

Parameters

options
MSIVmOptions

Returns