A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
Hello DannyW,
Azure Static Web Apps - Subscription Could Not Be Found error typically occurs when the Microsoft.Web resource provider isn't registered for your subscription. Even though you have Owner permissions and the subscription ID is correct, this is a common issue after upgrading from Free to Pay-as-you-go subscriptions.
Root Cause
The error "Subscription <subscription_id> could not be found or is invalid for CreateOrUpdateStaticSite" usually indicates that the Microsoft.Web resource provider is not registered for your subscription. When you upgrade from a Free to Pay-as-you-go subscription, not all resource providers are automatically registered, especially newer services like Azure Static Web Apps.
Solution
1. Register the Microsoft.Web Resource Provider
Using Azure Portal:
- Navigate to the Azure Portal
- Go to Subscriptions and select your subscription
- In the left menu, select Resource providers under Settings
- Search for "Microsoft.Web"
- If it shows as "NotRegistered", select it and click Register
- Wait for the registration to complete (this may take a few minutes)
Using Azure CLI:
az provider register --namespace Microsoft.Web
Using PowerShell:
Register-AzResourceProvider -ProviderNamespace "Microsoft.Web"
2. Verify Registration Status
You can check the registration status using:
Azure CLI:
az provider show --namespace Microsoft.Web --query "registrationState"
PowerShell:
Get-AzResourceProvider -ProviderNamespace "Microsoft.Web" | Select-Object RegistrationState
3. Alternative: Use Azure CLI to Create Static Web App
If the portal continues to have issues, you can create the Static Web App using Azure CLI:
# First, ensure you're logged in and using the correct subscription
az login
az account set --subscription "your-subscription-id"
# Register the provider
az provider register --namespace Microsoft.Web
# Create the static web app
az staticwebapp create \
--name "your-app-name" \
--resource-group "your-resource-group" \
--location "Central US"
Additional Troubleshooting Steps
1. Check Quota Limits
Verify you haven't exceeded the Static Web Apps quota limits:
- Free plan: 10 apps per subscription
- Standard plan: 100 apps per subscription
2. Try Different Region
Some regions may have capacity constraints. Try creating the Static Web App in a different region such as:
- East US
- West US 2
- Central US
- West Europe
3. Clear Browser Cache
If using the Azure Portal, clear your browser cache and try again, or use an incognito/private browsing window.
4. Wait After Provider Registration
After registering the Microsoft.Web provider, wait 5-10 minutes before attempting to create the Static Web App again, as the registration needs time to propagate across all regions.
Prevention for Future Deployments
To avoid similar issues with other Azure services:
- Proactively register common providers after subscription upgrades:
az provider register --namespace Microsoft.Web az provider register --namespace Microsoft.Storage az provider register --namespace Microsoft.Insights - Use Azure CLI or PowerShell for initial resource creation, as these tools often provide clearer error messages.
- Check provider registration status before deploying new resource types you haven't used before.
Expected Timeline
- Provider registration: 2-10 minutes
- Static Web App creation: 2-5 minutes after successful registration
The issue should resolve once the Microsoft.Web resource provider is properly registered. This is a one-time registration per subscription, so you won't encounter this specific error again for Static Web Apps in this subscription.
If you continue to experience issues after following these steps, please share the specific error message you're receiving, as there may be additional underlying causes to investigate.
Please let me know if this was helpful by marking this as an "Accepted" answer. This helps the community find relevant information.
Best regards,
Andrew Taylor