skip to Main Content

I created azure function with Powershell option 7.2
under app file -> requirements.pds1, decommented ‘8.*
and introduced

Import-Module MsOnline -UseWindowsPowershell
Import-Module Partnerenter -UseWindowsPowershell

in my run.ps1

Despite these changes , I am getting below error

the Term Get-AzSubscription

Please help to fix this issue

Thanks in advance
Ramabadran

2

Answers


  1. Please be informed that if you’re using Azure functions then its installed already.

    You might be having some syntax issue that you may need to check or you might have referenced AzureRM comand let before Az commandlet.
    Please review your code first. The better option would be to enabled verbose logging using -verbose switch.

    You can even import module using command Import-Module but in my opinion this is not required knowing this module is preinstalled on PAAS offering by default.

    Login or Signup to reply.
  2. enter image description here

    1. In VS Code > Create an Azure Function Project in the local workspace with the PowerShell Runtime Stack (7.2 Version)
    2. Run these cmdlets Install-Module Az, Import-Module Az in the project workspace/path of the terminal.
    3. In requirements.psd1, uncomment the line 'Az' = '8.*'.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search