Skip to content

Commit 0667c2c

Browse files
authored
Merge pull request #2791 from v-alje/scope-bulk-fix-2
Bulk fix adding --scopes parameter
2 parents 0e42856 + 3420344 commit 0667c2c

10 files changed

+11
-10
lines changed

articles/java/sdk/get-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Your Java application needs *read* and *create* permissions in your Azure subscr
2828
[Create a service principal by using the Azure CLI 2.0](/cli/azure/create-an-azure-service-principal-azure-cli), and capture the output:
2929

3030
```azurecli
31-
az ad sp create-for-rbac --name AzureJavaTest --role Contributor
31+
az ad sp create-for-rbac --name AzureJavaTest --role Contributor --scopes /subscriptions/mySubscriptionID
3232
```
3333

3434
This command gives you a reply in the following format:

articles/java/sdk/identity-service-principal-auth.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Use the [Azure CLI][azure_cli] examples below to create or get client secret cre
2424
Use the following command to create a service principal and configure its access to Azure resources:
2525

2626
```azurecli
27-
az ad sp create-for-rbac -n <your application name> --role Contributor
27+
az ad sp create-for-rbac -n <your application name> --role Contributor --scopes /subscriptions/mySubscriptionID
2828
```
2929

3030
This command returns a value similar to the following output:

articles/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-key-vault.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Azure AD *service principals* provide access to Azure resources within your subs
100100
To create a service principal, use the following command.
101101

102102
```azurecli
103-
az ad sp create-for-rbac --name contososp --role Contributor
103+
az ad sp create-for-rbac --name contososp --role Contributor --scopes /subscriptions/mySubscriptionID
104104
```
105105

106106
> [!NOTE]

articles/java/spring-framework/configure-spring-cloud-stream-binder-java-app-kafka-azure-event-hub.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Azure AD *service principals* provide access to Azure resources within your subs
177177
To create a service principal, use the following command.
178178

179179
```azurecli
180-
az ad sp create-for-rbac --name contososp --role Contributor
180+
az ad sp create-for-rbac --name contososp --role Contributor --scopes /subscriptions/mySubscriptionID
181181
```
182182

183183
> [!NOTE]

articles/javascript/core/nodejs-sdk-azure-authenticate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Create a service principal and configure its access to Azure resources. The serv
5959
1. Create the service principal with the Azure [az ad sp create-for-rbac](/cli/azure/ad/sp#az-ad-sp-create-for-rbac) command with the Azure CLI or [Cloud Shell](https://shell.azure.com).
6060

6161
```azurecli
62-
az ad sp create-for-rbac --name YOUR-SERVICE-PRINCIPAL-NAME --role Contributor
62+
az ad sp create-for-rbac --name YOUR-SERVICE-PRINCIPAL-NAME --role Contributor --scopes /subscriptions/mySubscriptionID
6363
```
6464
6565
2. The response from the command includes secrets you need to store securely such as in [Azure Key Vault](/azure/key-vault/):

articles/javascript/how-to/with-web-app/azure-function-resource-group-management/introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ An Azure service principal provides access to Azure without having to use your p
7171
1. In a bash terminal, create your service principal with [az ad sp create-for-rbac](/cli/azure/ad/sp#az-ad-sp-create-for-rbac):
7272
7373
```azurecli
74-
az ad sp create-for-rbac --name YOUR-SERVICE-PRINCIPAL-NAME --role Contributor
74+
az ad sp create-for-rbac --name YOUR-SERVICE-PRINCIPAL-NAME --role Contributor --scopes /subscriptions/mySubscriptionID
7575
```
7676
1. Copy the entire output results to a temporary file. You will need these settings later.
7777

articles/javascript/how-to/with-web-app/use-secret-environment-variables.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ This sample uses the [DefaultAzureCredential](/javascript/api/overview/azure/ide
7070
```azurecli
7171
az ad sp create-for-rbac \
7272
--name REPLACE-WITH-YOUR-NEW-SERVICE-PRINCIPAL-NAME \
73-
--role Contributor
73+
--role Contributor \
74+
--scopes /subscriptions/REPLACE_WITH_YOUR_SUBSCRIPTION_NAME_OR_ID
7475
```
7576
7677
An example service principal name is `demo-keyvault-service-principal-YOUR-NAME`, where `YOUR-NAME` is postpended to the string.

articles/python/configure-local-development-environment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Each developer in your organization should perform these steps individually.
8686
1. Create the service principal:
8787

8888
```azurecli
89-
az ad sp create-for-rbac --name localtest-sp-rbac
89+
az ad sp create-for-rbac --name localtest-sp-rbac --role Contributor --scopes /subscriptions/mySubscriptionID
9090
```
9191
9292
For more details on the command and its arguments, see [What the create-for-rbac command does](#what-the-create-for-rbac-command-does).

articles/terraform/create-vm-scaleset-network-disks-using-packer-hcl.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ In this article, you learn how to:
4444
1. Run [az ad sp create-for-rbac](/cli/azure/ad/sp?#az-ad-sp-create-for-rbac) to enable Packer to authenticate to Azure using a service principal.
4545
4646
```azurecli
47-
az ad sp create-for-rbac --role Contributor --query "{ client_id: appId, client_secret: password, tenant_id: tenant }"
47+
az ad sp create-for-rbac --role Contributor --scopes /subscriptions/<subscription_id> --query "{ client_id: appId, client_secret: password, tenant_id: tenant }"
4848
```
4949
5050
**Key points:**

articles/terraform/includes/authenticate-to-azure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The most common pattern is to interactively sign in to Azure, create a service p
8787
1. To create a service principal, run [az ad sp create-for-rbac](/cli/azure/ad/sp?#az-ad-sp-create-for-rbac).
8888
8989
```azurecli
90-
az ad sp create-for-rbac --name <service_principal_name> --role Contributor
90+
az ad sp create-for-rbac --name <service_principal_name> --role Contributor --scopes /subscriptions/<subscription_id>
9191
```
9292
9393
**Key points:**

0 commit comments

Comments
 (0)