When i trying to run command
az ad sp create-for-rbac --role="Contributor" --scopes="/subscription/<<Subscription ID>>"
I am getting error as
(MissingSubscription) The request did not have a subscription or a valid tenant level resource provider.
Code: MissingSubscription
Message: The request did not have a subscription or a valid tenant-level resource provider.
I just created a new azure account where a Free Trial subscription is available with a subscription ID
2
Answers
The command was not working either way, so had to register the app with contributor role manually in order to get app id and secret key.
I tried in my environment and got the below results:
Initially, I got the same error when I tried with scope
"/subscriptions/{SubscriptionID}"
.Error:
For assigning a
contributor
role to Kubernetes service you need to copy the resourceId from your Kubernetes service.Portal->Kubernetes service->properties->Copy respurceID
Portal:
Command:
Output:
Reference:
az ad sp | Microsoft Learn
Update:
Try passing the scopes without double quotes.
Command:
Output: