How to resolve Azure Static Web (extension) error "[Provider "/subscriptions/<mySubscriptionID>/providers/Microsoft.Resources" does not have resource type "resourceGroups"]" in VS Code?

Ubaidullah Shuaib 50 Reputation points
2023-11-19T21:34:11.9533333+00:00

I followed the steps in Create a static web app and encountered the error shown below after entering a name in VS Code (step 4 of the linked documentation).

User's image

Github Copilot suggested:

The error message you're seeing typically indicates that the Azure Resource Provider for managing resource groups is not registered with your subscription.

Azure Resource Providers are services that provide Azure resources. For example, a database is a resource provided by the SQL Database resource provider. Before you can create or work with a resource in Azure, the resource provider must be registered with your subscription.

To resolve this issue, you need to register the Microsoft.Resources provider with your subscription. You can do this using Azure CLI, Azure PowerShell, or the Azure portal.

Here's how you can do it using Azure CLI:

az provider register --namespace Microsoft.Resources

After running this command, it may take up to ten minutes for the registration to finish.

After the registration is complete, you should be able to create your Static Web App without encountering the error.

However, registering Microsoft.Resources provider did not solve the issue.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
633 questions
{count} vote

Accepted answer
  1. VenkateshDodda-MSFT 14,216 Reputation points Microsoft Employee
    2023-11-23T11:45:12.52+00:00

    @Ubaidullah Shuaib Thanks for your patience on this.

    I am summarizing our discussion and posting it as an answer for the benefit of other community members.

    Issues: Customer is not able to deploy the static webapp through visual studio code and it is failing with above error message.

    Resolution:

    • Upon troubleshooting offline, we see that customer doesn't have any resource group in his subscription and when they are trying to create static webapp directly is failing with the error message there were no resource groups under the subscription.
    • Post creating the resource group and by using the Create Static Web App ...(Advanced) option they are able to create the static webapp in his subscription successfully.
    • Using Create Static Web App ... action they are not able to create the static webapp and this seems to be a visual studio code extension issue I have suggested the customer to raise an issue in GitHub repo related to Azure tools extension here.

    I hope this helps. Please let me know if you have any further queries.

    Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful