Issue with Cmdlet in Azure function apps.

Son Cao Thanh 41 Reputation points
2020-11-06T16:53:03.277+00:00

Hi support team,

I have an issue related to Cmdlet in Azure function apps.

With command: Set-AzOperationalInsightsSavedSearch.
When run Set-AzOperationalInsightsSavedSearch, the error: A parameter cannot be found that matches parameter name 'FunctionAlias'.
The problem when I try to run in Azure function apps.
But when I try run in Cmdlet powershell, the issue not happen.
Please check and let me know what's issue here?
Thanks.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,016 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,461 Reputation points
    2020-11-09T10:36:15.877+00:00

    Hi @Son Cao Thanh

    Can you please verify requirements.psd1 file and verify what az module version is defined?
    As per the error message the Set-AzOperationalInsightsSavedSearch was found but the command doesn't expect the parameter name as 'FunctionAlias'.

    Looking into the document for Set-AzOperationalInsightsSavedSearch the parameter FunctionAlias was added in the az module 4.8 and above. The latest Az module is 5.0.0 so the requirements.psd1 should have 4.8 or above module to run the Set-AzOperationalInsightsSavedSearch with FunctionAlias parameter.

    requirements.psd1

    @{  
        'Az' = '5.*'  
    }  
    

    Feel free to get back to me if you are still facing the issue.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.