Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create Azure Function #3893

Closed
JaclynFox opened this issue Nov 11, 2023 · 7 comments
Closed

Cannot create Azure Function #3893

JaclynFox opened this issue Nov 11, 2023 · 7 comments

Comments

@JaclynFox
Copy link

Does this occur consistently? Yes
Repro steps:

  1. try to create new function
  2. error pops up after runtime is selected.

Action: azureFunctions.createFunctionApp
Error type: ProviderResourceTypeNotFoundError
Error Message: Provider "/subscriptions/redacted:id/providers/Microsoft.Resources" does not have resource type "resourceGroups".

Version: 1.13.1
OS: linux
OS Release: 6.2.0-36-generic
Product: Visual Studio Code
Product Version: 1.84.2
Language: en

Call Stack
extension.bundle.js:2:3716430
fulfilled extension.bundle.js:2:3714514
@nturinski
Copy link
Member

There may be something weird about your subscription. Could you try unregistering the namespace Microsoft.Resources and then re-registering it?

You can do so in the portal by following these steps: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types#register-resource-provider-1

Or you can use the az CLI and type these commands

az provider unregister --namespace Microsoft.Resources
az provider register --namespace Microsoft.Resources

Related: #3620

@JaclynFox
Copy link
Author

JaclynFox commented Nov 14, 2023 via email

@nturinski
Copy link
Member

Ah, alright. Let us know if the support team is able to help you out!

@JaclynFox
Copy link
Author

Well, so far they've been of no help. So when I said I already unregistered and reregistered my microsoft.resources subscription I must have just clicked Reregister because when I try to unregister I get the following error:

The resource namespace 'microsoft.resources' is invalid

@markuslewin
Copy link

I'm encountering the same problem and error messages on a fresh subscription from last week.

The JSON in the resource provider details is still empty after I re-register the provider:

{
  "resourceType": "",
  "locations": [],
  "defaultApiVersion": "",
  "apiProfiles": [],
  "capabilities": "",
  "apiVersions": [],
  "zoneMappings": []
}

I'm guessing it should be populated with some default values?

I don't know if it's relevant, but I can create resource groups with the Azure CLI. This works: az group create -n az-rg-test -l westus.

@nturinski
Copy link
Member

I don't know if it's relevant, but I can create resource groups with the Azure CLI. This works: az group create -n az-rg-test -l westus.

Thanks for this tidbit. That's interesting-- I wonder if the SDK that we are using is outdated.

@markuslewin
Copy link

This works for me now! I don't remember doing anything, but the Microsoft.Resources provider is no longer empty and I can create resources from vscode.

@microsoft microsoft locked and limited conversation to collaborators May 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants