Select Language:
If you are getting the “Subscription Could Not Be Found” error when trying to use Azure Static Web Apps, the most common cause is that the Microsoft.Web resource provider hasn’t been registered in your subscription. This often happens after upgrading from a free plan to a pay-as-you-go plan, even if your permissions are sufficient and the subscription ID is correct.
To fix this, you’ll need to manually register the Microsoft.Web resource provider. Here’s a simple step-by-step guide to do that:
First, you can register the provider through the Azure Portal:
1. Log in to the Azure Portal at https://portal.azure.com.
2. In the left menu, click on “Subscriptions” and select your current subscription.
3. From the menu on the left, choose “Resource providers.”
4. Search for “Microsoft.Web” in the list.
5. If it shows as “NotRegistered,” select it.
6. Click the “Register” button and wait a few minutes for the process to finish.
Alternatively, if you’re comfortable using the command line, you can register the provider using Azure CLI:
bash
az provider register –namespace Microsoft.Web
For PowerShell users, run:
powershell
Register-AzResourceProvider -ProviderNamespace “Microsoft.Web”
After registering, make sure the registration is complete before proceeding:
Azure CLI:
bash
az provider show –namespace Microsoft.Web –query “registrationState”
PowerShell:
powershell
Get-AzResourceProvider -ProviderNamespace “Microsoft.Web” | Select-Object RegistrationState
The registration should show as “Registered.”
If you’re having trouble through the Azure Portal or CLI, you can also create your Static Web App directly using Azure CLI commands. Just log in, select the right subscription, register the provider if necessary, and create the app:
bash
az login
az account set –subscription “your-subscription-id”
az provider register –namespace Microsoft.Web
az staticwebapp create \
–name “your-app-name” \
–resource-group “your-resource-group” \
–location “Central US”
Remember, after registering the provider, wait about 5-10 minutes for the registration to fully propagate before trying to create your Static Web App again.
It’s also a good idea to check your subscription’s quota limits for Static Web Apps:
– Free plans allow up to 10 apps per subscription.
– Standard plans allow up to 100.
If you’re in a busy region or hitting capacity, trying a different region (like East US, West US 2, or West Europe) can help.
When using the Azure Portal, clearing your browser cache or opening an incognito/private window can sometimes resolve UI issues.
To prevent this problem from happening in future upgrades or new deployments, consider proactively registering common resource providers like Microsoft.Web, Microsoft.Storage, and Microsoft.Insights right after upgrading your subscription:
bash
az provider register –namespace Microsoft.Web
az provider register –namespace Microsoft.Storage
az provider register –namespace Microsoft.Insights
Finally, be patient. Provider registration can take a few minutes, and creating your Static Web App will usually take just a couple of minutes once everything is registered correctly.
This process ensures you won’t see this specific error again for the same subscription. If the problem persists after following these steps, share the exact error message you’re seeing so we can help troubleshoot further.