(01 A3)Creating Services using Azure CLI - CloudDarsh/OracleCloud GitHub Wiki
Creating Services using Azure CLI
User
Creating a User using Azure CLI
For creating a user using Azure CLI , we can run the below command, make sure to update the “user principal name” in the below command
az ad user create --display-name "testCLIuser" --user-principal-name testCLIuser@**************.onmicrosoft.com --password "testCLI123!"
We can check from the Azure console , the new user is created
Checking status of a User using Azure CLI
For Checking status of a user using Azure CLI , we can run the below command, make sure to update the “user principal name” in the below command
az ad user show --id testCLIuser@***************.onmicrosoft.com
Deleting a User using Azure CLI
For deleting a user using Azure CLI, we have to run the below command, make sure to update the “user principal name” in the below command,
az ad user delete --id testCLIuser@*****************.onmicrosoft.com
We can check from the Azure console, the new user will be deleted.
Group
Creating a Group using Azure CLI
For creating a group using Azure CLI, we have to run the below command,
az ad group create --display-name "testCLIgroup" --mail-nickname "testCLIgroup"
We can check from the Azure console, the new group will be created
Checking status of a group using Azure CLI
For Checking status of a group using Azure CLI , we can run the below command,
az ad group show --group "testCLIgroup"
Deleting a group using Azure CLI
For deleting a group using Azure CLI, we have to run the below command,
az ad group delete --group "testCLIgroup"
We can check from the Azure console, the new group will be deleted.
Adding a User to a Group using Azure CLI
For creating a User to a Group using Azure CLI,
First we have to get the “Object ID” of that user, for that we have to run the below command, make sure to update the “user principal name” in the below command.
az ad user show --id testCLIuser@**************.onmicrosoft.com
From the above command , we will get the “Id” of the user , we have to copy it.
After that we have to run the below command to add the User in a Group, make sure to update the “Id” in the below command,
az ad group member add --group "testCLIgroup" --member-id *************
Now we can check from the Azure console, the User will be added in the Group.