Create an Azure Active Directory (AD) application and assign the required permissions to it to allow the applications to access or modify the resources. Follow this approach to run the application using your credentials for these reasons:
Ensure you have sufficient permission to register an application with your AzureActive Directory (AD) tenant and assign the application to a role in your Azure subscription.
These are the pre-requisites for creating an Azure Active Directory Application:
Follow these steps to check Azure Active Directory permissions:

Select User Setting in Azure Active Directory - PREVIEW window.

In App registrations setting, if Users can register applications is set to Yes, then any user in the Azure AD tenant can register an app. Proceed to Check Azure subscription permissions.
In App registrations setting, if Users can register applications is set to No, then only admin users can register apps.
Follow these steps to check if your account is an admin for the Azure AD tenant:
Select Preview window > Overview > Quick tasks > Find a user in the Azure Active Directory - Preview window.

From the list of account, select your account.
View your assigned directory role in Azure AD. Ask your administrator to either assign you to an administrator role or to enable users to register apps if your account is assigned to the User role ( but the app registration setting from the previous steps is limited to admin users).

In your Azure subscription, your account needs to have Microsoft.Authorization/*/Write access to assign an AD app to a role. This action is granted through the Owner role or User Access Administrator role.
NOTE: If your account is assigned to the Contributor role, you will not have adequate permission. You will receive an error when attempting to assign the service principal to a role.
Follow these steps to check your subscription permissions:




Follow these steps to create an Azure Active Directory application:
This successfully creates an Azure Active Directory application.
Follow these steps to acquire an ID and authentication key to login:




| Description | Specify a description for the key. |
| Expires | Select the duration of this key. |
| Value | This value is generated after saving the Key configuration. NOTE:
|

Provide your Tenant ID and your authentication request to login. Follow these steps to get a tenant Id:


It is important to assign role with right permission to access the resources in your subscription.
See RBAC: Built in Roles to learn about the available roles.
You can set the scope at the level of the subscription, resource group, or resource. Permissions are inherited to lower levels of scope. For example, adding an application to the Reader role for a resource group implies the application can read the resource group and any resources it contains.
Follow these steps to assign a role at subscription scope:


Select Access Control (IAM).
Click Add in the Visual Studio Enterprise - Access Control (IAM) pane.
Select a specific role to the application.

Select your application, and click OK.
To get Subscription ID, navigate inside subscription option and get the highlighted details.
