- Learning DevOps
- Mikael Krief
- 231字
- 2021-06-24 12:32:05
Creating the Azure SP
This operation can be done either via the Azure portal (all steps are detailed on the official documentation here: https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal) or via a script by executing the following az cli command (which we can launch in Azure Cloud Shell).
The following is a template az cli script that you have to run for creating an service principal, where you have to enter your SP name, role, and scope:
az ad sp create-for-rbac --name="<ServicePrincipal name>" --role="Contributor" --scopes="/subscriptions/<subscription Id>"
See the following example:
az ad sp create-for-rbac --name="SPForTerraform" --role="Contributor" --scopes="/subscriptions/8921-1444-..."
This sample script creates a new service principal named SPForTerraform and gives it the contributor permission on the subscription ID, 8921....
The following screenshot shows the execution of the script that creates an Azure SP:

The creation of this service principal returns three pieces of identification information:
- The application ID, also called the client ID
- The client secret
- The tenant ID
And the SP is created in Azure AD. The following screenshot shows the Azure AD SP:

Here, we have just seen how to create a service principal in the Azure AD and we have given it the permission to manipulate the resources of our Azure subscriptions.
Now, let's see how to configure Terraform to use our Azure SP.
- 復(fù)發(fā)性口腔潰瘍中西醫(yī)結(jié)合診斷和治療
- 腎病綜合征
- 成人聽(tīng)力障礙康復(fù)讀本
- Hands-On RESTful Web Services with TypeScript 3
- 眼睛健康,自己查(第二版)
- 臨床X線頭影測(cè)量學(xué)(第2版)
- 顱內(nèi)血管疾病超聲圖解100例
- 前列腺癌標(biāo)準(zhǔn)數(shù)據(jù)集(2021版)
- 特殊醫(yī)學(xué)用途配方食品臨床應(yīng)用
- 孤獨(dú)癥譜系障礙兒童家庭訓(xùn)練100問(wèn)
- 麻醉安全與質(zhì)量管理
- 悅讀中醫(yī):首屆全國(guó)悅讀中醫(yī)校園之星作品集(第二輯)
- 冠心病介入處置爭(zhēng)鳴
- 腦卒中診療與康復(fù)問(wèn)答
- 神經(jīng)系統(tǒng)常見(jiàn)疾病的診斷與治療