vscode-azurefunctions
vscode-azurefunctions copied to clipboard
Cannot create Azure Function
Does this occur consistently? Yes Repro steps:
- try to create new function
- 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
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: https://github.com/microsoft/vscode-azurefunctions/issues/3620
That was one of the first things I tried. I may just have something weird going on with my account since I had to open a ticket with Azure due to my account getting locked any time I sign in using the Azure CLI in VSCode.
From: Nathan @.> Sent: Monday, November 13, 2023 8:04:57 PM To: microsoft/vscode-azurefunctions @.> Cc: Anderson, Brian A @.>; Author @.> Subject: Re: [microsoft/vscode-azurefunctions] Cannot create Azure Function (Issue #3893)
CAUTION: This e-mail originated from outside the Minnesota State System. Only click links or open attachments from trusted sources. Please report suspicious messages using the "Report Message Button".
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: #3620https://github.com/microsoft/vscode-azurefunctions/issues/3620
— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-azurefunctions/issues/3893#issuecomment-1809425337, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANAFT6ZAYD7NPILSOJILBTLYELGUTAVCNFSM6AAAAAA7HRWEEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZGQZDKMZTG4. You are receiving this because you authored the thread.Message ID: @.***>
Ah, alright. Let us know if the support team is able to help you out!
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
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
.
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.
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.