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

Receiving execution policy error with Azure Functions Core Tools (2) #52772

Closed
usgvja opened this issue Apr 19, 2020 · 5 comments
Closed

Receiving execution policy error with Azure Functions Core Tools (2) #52772

usgvja opened this issue Apr 19, 2020 · 5 comments

Comments

@usgvja
Copy link

usgvja commented Apr 19, 2020

Hi,

Same issue as #41771
following https://docs.microsoft.com/bs-latn-ba/azure/azure-functions/functions-create-first-function-vs-code?view=azurermps-4.2.0&pivots=programming-language-python from scratch.

The doc doesn't work from this step
image

Visual Studio Code installs automatically func core and I get the same issue.
"func : Impossible de charger le fichier C:\Users\USER\AppData\Roaming\npm\func.ps1. Le fichier
C:\Users\USER\AppData\Roaming\npm\func.ps1 n’est pas signé numériquement. Vous ne pouvez pas exécuter ce script sur le système actuel. Pour plus d’informations sur l’exécution de scripts et la définition de stratégies d’exécution, voir la rubrique about_Execution_Policies à l’adresse https://go.microsoft.com/fwlink/?LinkID=135170"

As suggested by @1scscott it is possible to npm uninstall the package from the terminal but not possible to install the V3 package with choco since this version doesnt exists https://chocolatey.org/packages?q=functions+core+tools&moderatorQueue=&moderationStatus=all-statuses&prerelease=true&sortOrder=relevance

I think you can update the doc if you have a workaround or update your packages if it solves the issue.

Thank you, best regards
JA

Originally posted by @KetanChawda-MSFT in #41771 (comment)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@usgvja
Copy link
Author

usgvja commented Apr 19, 2020

Actually, the package v3 exists on choco but is currently unmoderated.
Then you need to hard code the last version to install it with choco, after this install it works.

Please retrieve the version number from https://chocolatey.org/packages/azure-functions-core-tools-3
then in the case where VERSION = 3.0.2358, run this command in PowerShell (admin) :
choco install azure-functions-core-tools-3 --version 3.0.2358

Please update the azure docs with the correct method to use (even if there is a temporary method to use).

Thank you,
Best regards,
JA

@PramodValavala-MSFT
Copy link
Member

@usgvja Apologies for the experience but looks like this is an issue that cascades up to npm itself. This issue, Azure/azure-functions-core-tools#1821, covers the same and mentions the npm issue, npm/cli#470 causing this.

Since the issue seems to be specific to the powershell script, I believe changing the default shell in VS Code to CMD should do the trick, though I haven't tried this out.

As for the official v3 version of the core tools in chocolatey, there is another issue that tracks this - Azure/azure-functions-core-tools#1859

Another workaround in the meantime could be to manually install the CLI by downloading the latest version from its GitHub Releases Page. And while I believe not official maintained, the main bucket for scoop seems to have it available as well, which essentially fetches the release from github releases and sets it up for you.

@PramodValavala-MSFT
Copy link
Member

@usgvja Just following up here... Hope my previous comment clears things up.

@usgvja
Copy link
Author

usgvja commented Apr 23, 2020

Hi, thank you for your comment and reminder.

This proposal did not do the trick:

Since the issue seems to be specific to the powershell script, I believe changing the default shell in VS Code to CMD should do the trick, though I haven't tried this out.

These options actually didn't work neither:

  • Install from vs code package manager
  • Install/remove with npm inside a console of vs code and in a windows cmd console outside vs code (cmd regular login and admin cmd)

This option worked:

  • open powershell (I can't remember if I was admin or not)
  • install v3 from choco hardcoding in the command the detailled version of the package.
    choco install azure-functions-core-tools-3 --version 3.0.2358

As you have said I guess the problem comes from the npm package (and not from the fact you use CMD or Powershell, even if I have not tested all the combinations).

@PramodValavala-MSFT
Copy link
Member

@usgvja Thanks for confirming that! Once the issue linked is fixed, I believe it should work as expected.

I had thought the CMD solution should work since I see that calling func from a CMD window ends up using a func/func.cmd instead of the func.ps1, all of which are scripts that npm create on windows.

And yes, the fix in npm should resolve this issue and will have to use the workaround that works for you in the meantime.

The issues linked in my previous comment are better places to track this and since there is no doc update required here, we will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants