'Some azure cli commands return SubscriptionNotExists errors?

I have a free trial subscription on Azure:

$ az account subscription list                  
                                                                                         
Command group 'account subscription' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus
[
  {
    "authorizationSource": "RoleBased",
    "displayName": "Azure subscription 1",
    "id": "/subscriptions/fffffff-ffff-ffff-ffff-ffffffffffff",
    "state": "Enabled",
    "subscriptionId": "fffffff-ffff-ffff-ffff-ffffffffffff",
    "subscriptionPolicies": {
      "locationPlacementId": "Public_2014-09-01",
      "quotaId": "FreeTrial_2014-09-01",
      "spendingLimit": "On"
    }
  }
]

but when I execute the command (list MariaDB SKUs) I get the following error:

$ az mariadb server list-skus --location eastus       
                                                                                  
(SubscriptionNotExists) Subscription 'fffffff-ffff-ffff-ffff-ffffffffffff' does not exist.
Code: SubscriptionNotExists
Message: Subscription 'fffffff-ffff-ffff-ffff-ffffffffffff' does not exist.

Works fine under my other account where I have a pay-as-you-go subscription. Same thing with the go SDK.

If the free trial is the issue it would be great to document it somewhere.



Solution 1:[1]

Turns out you have to register provider resources for your subscription before you can use them. For some reason MariaDB was already registered for one of my accounts but not for the other. The error SubscriptionNotExists is extremely confusing in that regard.

Solution 2:[2]

To list the skus list Mariadb Please make sure that you have logged in successfully using az login cmdlet .

Then try to execute the following command which you are using

az mariadb server list-skus --location eastus 

OUTPUT FOR REFERENCE:- enter image description here enter image description here

NOTE:- Try to close and reopen your terminal and use az login and choose your account in which you have free trail subscription then use the command.

As i don't have any free trial subscription to test it on my environment .

AFAIK, we can use it For free trail account as well based on the below screenshot and also can Check this Microsoft Document : enter image description here

For more details please refer the below links for Azure free trial supported resources:

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 chingis
Solution 2 AjayKumarGhose-MT