I am trying to create a GitHub workflow and encountering an error when attempting to store secrets using the following command. It indicates either an invalid subscription or an invalid tenant level. Can someone please help me with this?
az ad sp create-for-rbac --name "myApp" --role contributor \
--scopes /subscriptions/{subscription- id}/resourceGroups/cloudresume/providers/Microsoft.Web/sites/GetResumeCounter2410 \
--sdk-auth
I was expecting to get:
{
"clientId": "<GUID>",
"clientSecret": "<GUID>",
"subscriptionId": "<GUID>",
"tenantId": "<GUID>",
(...)
}
However, I get an error like this:
(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.
The error message "The request did not have a subscription or a valid tenant level resource provider" indicates that the subscription ID specified is invalid or the tenant ID is incorrect.
You can use the command
az account listto list the available subscriptions and ensure that you are using the correct subscription ID.If you are using variables, you can use the Bash
echocommand to see the value being passed to the reference command. You can also useaz account setto change your subscription.Correct command-
References: