vscode-azurefunctions icon indicating copy to clipboard operation
vscode-azurefunctions copied to clipboard

Subscription not found when creating function app

Open scook1802 opened this issue 2 years ago • 3 comments

Does this occur consistently? Repro steps:

Action: azureFunctions.createFunctionApp Error type: SubscriptionNotFound Error Message: Subscription redacted:id was not found.

Version: 1.7.4 OS: win32 OS Release: 10.0.22000 Product: Visual Studio Code Product Version: 1.69.2 Language: en

Call Stack
handleErrorResponse extension.bundle.js:2:1823131
deserializeResponseBody extension.bundle.js:2:1823862

scook1802 avatar Jul 30 '22 02:07 scook1802

Does this occur consistently? Repro steps:

Action: azureFunctions.createFunctionApp Error type: SubscriptionNotFound Error Message: Subscription redacted:id was not found.

Version: 1.7.4 OS: win32 OS Release: 10.0.22000 Product: Visual Studio Code Product Version: 1.69.2 Language: en

Call Stack

Same here (new user)!

WallyWally12 avatar Jul 31 '22 20:07 WallyWally12

Are you guys using student accounts by chance?

nturinski avatar Aug 01 '22 19:08 nturinski

Hi,

No, just normal accounts in trial mode with the 200 dollar allowance. I even used two different accounts, but both fail. I was only able to upload to an App Service, however I’m now deviating from the Microsoft training, so that not ideal.

Best regards, Met vriendelijke groet,

Ingmar Waller Solution Architect & Product owner ORTEC Routing & Dispatch

+31 (0)6 1313 7176 | @.@.> | LinkedInhttp://www.linkedin.com/in/ingmarwaller | ortec.comhttps://ortec.com/

From: Nathan @.> Sent: maandag 1 augustus 2022 21:00 To: microsoft/vscode-azurefunctions @.> Cc: Ingmar Waller @.>; Comment @.> Subject: Re: [microsoft/vscode-azurefunctions] Stuck on an assignment (Issue #3269)

U ontvangt niet vaak e-mail van @.@.>. Meer informatie over waarom dit belangrijk ishttps://aka.ms/LearnAboutSenderIdentification

Are you guys using student accounts by chance?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-azurefunctions/issues/3269#issuecomment-1201590623, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2CJTQHFWOVMMPGPSSYTBNTVXANE3ANCNFSM55CPEFTA. You are receiving this because you commented.Message ID: @.@.>>

WallyWally12 avatar Aug 02 '22 07:08 WallyWally12

Having the exact same problem here. Just created a 200 dollar free acount with my email.

The output tab in VS doesn't output much, just 12:53:54 AM: Error: Subscription a-guid-here was not found. For the record, my subscription does appear when I use Azure:Select Subscriptions. Also tried using az login in the console and nothing changed after I authenticated there.

raff-run avatar Aug 21 '22 03:08 raff-run

Same as described by @raff-run

BartoszCki avatar Aug 30 '22 17:08 BartoszCki

I've tested this and found it reproducible. With a previously existing account, I could create a function app through VS Code with no problems. I created a new Azure account, signed out in VS Code from the old one, signed in with the new. Then, no matter what region I chose, I got the Subscription ... not found error when trying to create a new function app.

The only way I could get past this was to create a new function app through the Azure portal. Even then, there are problems. New function apps created using new Azure accounts do not have the option to add storage accounts to the function app. I don't know why this is, but perhaps has something to do with the new version of storage accounts that was released recently.

What happens when you try to use the Azure extension to deploy a function to a function app created without any storage is this:

1:43:57 PM AzureFnAppTest2022: Creating placeholder blob for linux consumption function app...
1:43:57 PM AzureFnAppTest2022: Malformed SCM_RUN_FROM_PACKAGE when uploading built content.
1:43:57 PM AzureFnAppTest2022: Generating summary of Oryx build
1:43:57 PM AzureFnAppTest2022: Deployment Log file does not exist in /tmp/oryx-build.log
1:43:57 PM AzureFnAppTest2022: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
1:43:57 PM AzureFnAppTest2022: Deployment Failed. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
1:44:01 PM AzureFnAppTest2022: Deployment failed.

What I did to get past this: Add the storage account manually. You can do this in the Azure portal by going to Storage accounts, and creating one with default options. Then find the Access key for that storage account and copy the connection string. There are two access keys, I used the first one. Then go to the function app's Configuration panel, and add a new Application Setting with the name of AzureWebJobsStorage and the value of the connection string, then click Save. Make sure to click Save!

After this, deploying a function to that function app from the VS Code Azure extension worked for me.

minaelee avatar Sep 12 '22 20:09 minaelee

+1 to this. this not working effects AZ-204 course as the described way to deploy a function doesnt work currently

BrettGoreham avatar Sep 17 '22 14:09 BrettGoreham

ALL of the ways that the Azure docs and tutorials describe to add a function app do not work currently for any new subscribers due to this bug. Including the instructions provided in the Azure portal when you go to create a function. That's a pretty big deal and I wish more attention would be paid to this.

minaelee avatar Sep 17 '22 18:09 minaelee

Hi @minaelee

Thanks for detailed explanation. This was helpful for diagnosing the issue. I have a PR opened that should resolve this issue.

I have a custom VSIX here: https://dev.azure.com/ms-azuretools/AzCode/_build/results?buildId=52115&view=artifacts&pathAsName=false&type=publishedArtifacts

But hopefully we will release this soon so that the tutorials will work again.

The current workaround is to create a storage account in the portal or through the VS Code extension. After that, you should be able to create function apps in the extension.

nturinski avatar Sep 19 '22 22:09 nturinski

@nturinski Fantastic, thank you!!

minaelee avatar Sep 20 '22 20:09 minaelee

Is it intended that function apps should be able to be created in the extension (without the "Subscription ... was not found" error) at this time? Or is the workaround of creating a storage account manually first before being able to create a new function app still necessary for the time being?

(I'm finding that the latter is true - and also that as long as a storage account has been previously created on the subscription, doesn't matter the resource group, a new function app will create through the extension properly.)

minaelee avatar Sep 20 '22 21:09 minaelee

Hi @minaelee

You would have to install the custom build that I linked for the fix to be patched in. However, we should be releasing the update shortly (v1.8.0) that will include the fix as well. I anticipate that we will get that released before EOD!

Until then, the workaround will be necessary.

nturinski avatar Sep 20 '22 21:09 nturinski

Just wanted to let you know that the fix should now be live!

nturinski avatar Sep 21 '22 00:09 nturinski

Just wanted to let you know that I tested again. Azure wasn't happy with me creating so many new accounts, so I had to use the same one I used previously (created after the bug started happening) but deleted all resource groups on it except DefaultResourceGroup-CUS, and the storage account I'd manually created on it, to hopefully mimic a new account. Uninstalled Azure Functions extension and reinstalled. Went through all the steps to create a function app and deploy a function - works perfectly, just as before! Thanks again!

minaelee avatar Oct 04 '22 19:10 minaelee