deploy azure function with github url

Rotem ben hemo 6 Reputation points
2023-06-11T06:45:38.9066667+00:00

hello,

i am trying to deploy azure function from azure PowerShell using this command:

az functionapp deployment source config --branch master --manual-integration --name rotemAzureFunction --repo-url https://github.com/myrepo.git --resource-group rotemAzureRG --repository-type github

the command run and then i get the msg:

"Operation returned an invalid status 'OK'"

where can i see the logs for this PowerShell command ?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,787 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Sina Salam 21,066 Reputation points Moderator
    2023-06-11T16:00:28.9766667+00:00

    @Rotem ben hemo

    Welcome to Microsoft Q&A again and thank you for posting your here!

    To understand your question, you were asking where you can see the logs for this PowerShell command.

    If you are using Windows PowerShell:

    PowerShell logs can be viewed using the Windows Event Viewer. The event log is located in the Application and Services Logs group and is named Microsoft-Windows-PowerShell.

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logging?view=powershell-5.1

    You can use the Get-EventLog cmdlet to get events and event logs from local and remote computers. By default, Get-EventLog gets logs from the local computer. To get logs from remote computers, use the ComputerName parameter.

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1

    You can also check Windows event logs with PowerShell using Get-EventLog. Event logs are stored in %SystemRoot%\System32\winevt\Logs, which usually translates into C:\Windows\System32\winevt\Logs. At least, that’s their default location, which can be easily changed by going to Action > Properties in the Event Viewer.

    https://www.codetwo.com/admins-blog/how-to-check-event-logs-with-powershell-get-eventlog/

    If you want to capture error messages thrown by a command in PowerShell script, you can use the $Error variable. The $Error variable contains an array of error objects that represent the most recent errors. The most recent error is at index 0.

    https://stackoverflow.com/questions/17420474/how-to-capture-error-messages-thrown-by-a-command

    If you are using Azure PowerShell:

    Go to Azure Portal > the target Resource Group > Activity Log From the error message output, copy the OperationID and paste into the search box Click Apply Click on the resulting log item Click on JSON tab, search within text by the operation ID.

    https://roykim.ca/2017/12/09/debugging-azure-powershell-with-activity-log/

    You can use the Get-AzLog cmdlet to retrieve Activity Log events. The events can be associated with the current subscription ID, correlation ID, resource group, resource ID, or resource provider. You can also use the Get-EventLog cmdlet to get logs from the local computer or remote computers.

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1

    If you want to handle and log PowerShell errors, you can identify which commands need error handling in your function, CmdLet or script. You can set the ErrorAction parameter to value Stop for the command that needs error handling. This will stop executing the command when an error occurs and it will show the error message. The command that has ErrorAction parameter set to value Stop is wrapped in Try { } block.

    https://www.improvescripting.com/how-to-log-powershell-errors-and-much-more/

    I hope this helps! If this answer solves your issue, please vote for it so other community members know that this is a quality answer. PS: Do not hesitate to let me know if you have any other questions.

    Best Regards,

    Sina

    0 comments No comments

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.