The request did not have a subscription or a valid tenant level resource provider.

Arun Kumar 0 Reputation points
2023-09-06T07:58:53.3566667+00:00

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 Free Trial subscription is available with subscription ID

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
16,682 questions
Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
521 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,558 questions
{count} votes

2 answers

Sort by: Most helpful
  1. kunal 0 Reputation points
    2023-09-06T08:04:50.8033333+00:00

    The error message "The request did not have a subscription or a valid tenant level resource provider" typically occurs in the context of cloud computing and resource provisioning, often associated with Microsoft Azure or similar cloud platforms. This error message indicates that there is an issue with the subscription or resource provider associated with a specific request. Here's what it means and how to address it:

    1. Subscription Issue:
    • Subscription: In cloud platforms like Microsoft Azure, users work within subscriptions, which are essentially billing accounts that provide access to Azure resources.
    • Cause: This error may occur if the request is made without specifying a valid subscription. It could also occur if the subscription has been deleted or is not properly configured.
    1. Resource Provider Issue:
    • Resource Providers: Cloud platforms organize resources and services using resource providers, which are responsible for managing specific types of resources (e.g., virtual machines, databases).
    • Cause: The error message may also indicate that the requested resource provider is not enabled or registered in the subscription, preventing the creation or management of specific resources.

    To address the error message "The request did not have a subscription or a valid tenant level resource provider," consider the following steps:

    Check Subscription: Ensure that you are working within a valid and active subscription. Verify that you have the necessary permissions and access rights to the subscription you intend to use.

    Specify Subscription: When making API requests or using cloud management tools, make sure to specify the target subscription explicitly. For example, in Azure, you can use the -Subscription parameter or set the AZURE_SUBSCRIPTION_ID environment variable to select the desired subscription.

    Validate Tenant-Level Resource Providers: Ensure that the required resource providers for the specific resources or services you want to provision are registered and active at the tenant level. Some services may require tenant-level configuration.

    Permissions and Role-Based Access Control (RBAC): Verify that your user or service principal has the appropriate permissions and role assignments to perform the requested operations within the subscription. In Azure, this is managed through Role-Based Access Control (RBAC).

    1. Service Status: Check the status of the cloud platform's services. Occasionally, service disruptions or maintenance can affect resource provisioning.

    Review Documentation: Refer to the official documentation and error details provided by the cloud platform for specific troubleshooting steps related to your use case.


  2. Sandeep G-MSFT 9,546 Reputation points Microsoft Employee
    2023-09-26T08:12:35.02+00:00

    @Arun Kumar

    Command line az ad sp create-for-rbac --role="Contributor" --scopes="/subscription/<<Subscription ID>>" is incorrect.

    You will have to mention as "Subscriptions" in the command line instead you have mentioned as Subscription.

    You can use below command line to fix the issue,

    az ad sp create-for-rbac --role 'Contributor' --scopes '/subscriptions/<<Subscription ID>>'

    Let me know if you have any further questions on this.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments