To access Azure API, ARM, setting up an application or while using Fluent SDK you will need Subscription Id, Tenant Id, Client Id, and client secret. This blog explains to how get these details using Azure Portal and Azure CLI.
For creating Azure VM you need to have a valid Azure account. If you do not have it, you can create using Azure Portal for free.
Azure subscription ID is a GUID that identifies your subscription and underlying services. Subscription has a trust relationship with Azure AD to authenticate users, services, devices, etc.
Login to Azure Portal
To get a list of all available Subscriptions you can search Subscription or click on Subscriptions from the Azure dashboard.
You can copy the Subscription ID of a specific subscription as shown in the below picture.
To Get subscription ID using Azure CLI use this command
az account show --query id --output tsv
Tenant Id is the unique identifier of the Azure Active Directory instance. One subscription can have multiple tenants. Using this Tenant Id you register and manage your apps.
If you have multiple tenants from the overview page click on Manage Tenants to get the Tenant Id of a specific tenant.
If you need the Tenant Id of the default Tenant you can get it from the Overview page itself.
You can also click on the specific Active directory to see more tenant details.
You will see Tenant details screen like this.
To get tenant id using Azure CLI use below command
az account tenant list
Click on Register.
Your application is created.
To create an Azure AD application using Azure CLI, you can use the below command.
az ad app create --display-name GeeksAPI --identifier-uris https://geeksapi.websites.net
Azure Client Id is Active Directory Application Id. Client Id is the unique identifier of an application created in Active Directory. You can have many applications in an Active Directory. Each application will have a different access level.
Copy Application Id