How to load Azure authentication information from a file using PowerShell cmdlets.
Written by Titus Manohar, IT security team, ManageEngine Updated on November 2025
Description:
Executing this command loads Azure authentication information from a file to set the Azure environment and context. The Azure authentication information that is loaded is used by cmdlets that are run in the current session to authenticate requests to Azure Resource Manager.
Syntax:
Import-AzContext [-AzureContext] <AzureRmProfile> [-Scope <ContextModificationScope>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
Example:
| Account | SubscriptionName | TenantId | Environment |
|---|---|---|---|
| azureuser@managengine.com | Subscription1 | xxxx-xxxx-xxxx-xxxx | AzureCloud |
This example shows a context being selected from a json file and passed through to the cmdlet.
About ADAudit Plus
ADAudit Plus is a UBA-driven change auditor that helps keep your Active Directory, Azure AD, Windows file servers, NetApp filers, EMC file systems, Synology file systems, Windows member servers, and workstations secure and compliant. For more information on ADAudit Plus, visit https://www.manageengine.com/active-directory-audit/.
Explore Active Directory auditing and reporting with ADAudit Plus.
- Related Products
- ADManager Plus Active Directory Management & Reporting
- ADAudit Plus Real-time Active Directory Auditing and UBA
- EventLog Analyzer Real-time Log Analysis & Reporting
- ADSelfService Plus Self-Service Password Management
- AD360 Integrated Identity & Access Management
- Log360 (On-Premise | Cloud) Comprehensive SIEM and UEBA
- AD Free Tools Active Directory FREE Tools
