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

API ME with Azure Functions fails after cloning solution from Github #11995

Closed
BobGerman opened this issue Jul 10, 2024 · 5 comments
Closed

API ME with Azure Functions fails after cloning solution from Github #11995

BobGerman opened this issue Jul 10, 2024 · 5 comments
Assignees
Labels
*as-designed What is the designed behavior needs more info Need user to provide more info no recent activity The issue labeled needs more info gets no reply from issue owner in time TA:Compute Team Area: Compute

Comments

@BobGerman
Copy link

Describe the bug
When I create a new API ME project, TTK correctly creates local.settings.json. This file is in gitignore, so when I try to run it from having cloned my project repo, this file is missing.
When I manually re-created the file everything started working.

To Reproduce
Steps to reproduce the behavior:

  1. Create an API ME project with a new API within a git repository
  2. Commit the project to github
  3. In another folder or machine, clone the project from github
  4. Project will not run; backend console will log this error:
    [2024-07-10T19:02:54.779Z] The 'FUNCTIONS_WORKER_RUNTIME' setting is required. Please
    specify a valid value. See https://go.microsoft.com/fwlink/?linkid=2257963 for more information. The application will continue to run, but may throw an exception in a future release.
    [2024-07-10T19:02:54.886Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your
    startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

Work-around is to manually re-create \local.settings.json with this content:

{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "node",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}

Expected behavior
Project should start after saving and cloning to github just the same as if it was a new project.

VS Code Extension Information (please complete the following information):

  • OS: Windows
  • Version 10 or 11

Additional context
VS Code version 1.91.0 (user setup)
TTK version 5.8.1

Copy link
Contributor

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Jul 10, 2024
@blackchoey blackchoey assigned blackchoey and huimiu and unassigned blackchoey Jul 11, 2024
@blackchoey blackchoey added the TA:Compute Team Area: Compute label Jul 11, 2024
@huimiu
Copy link
Member

huimiu commented Jul 15, 2024

Hi @BobGerman, thanks for your feedback! I'll update our template to fix this issue.

@huimiu huimiu added investigating and removed needs attention This issue needs the attention of a contributor. labels Jul 15, 2024
@huimiu
Copy link
Member

huimiu commented Jul 16, 2024

Hi @BobGerman, from my investigation, it seems like ignoring the local.settings.json file is a standard and safe practice. Many users tend to store keys in there, which can be risky if we commit it by default.

There's been a similar issue raised by developers in the Azure Functions repo, but Azure Functions still defaults to ignoring local.settings.json. They've expressed their concerns about it. Therefore, I think it makes sense for the Teams Toolkit template to follow this convention too. What do you think, @MuyangAmigo?

As for your workaround for the issue you're facing, maybe you could try manually removing local.settings.json from the .gitignore file and then commit it.

@huimiu huimiu added needs more info Need user to provide more info *as-designed What is the designed behavior and removed investigating labels Jul 16, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the no recent activity The issue labeled needs more info gets no reply from issue owner in time label Jul 24, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

Copy link
Contributor

Due to lack of details for further investigation, we will archive the issue for now. In case you still have following-up questions on this issue, please always feel free to reopen the issue by clicking ‘reopen issue’ button below the comment box. We will get back to you as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*as-designed What is the designed behavior needs more info Need user to provide more info no recent activity The issue labeled needs more info gets no reply from issue owner in time TA:Compute Team Area: Compute
Projects
None yet
Development

No branches or pull requests

3 participants