Accessing Logs via Azure PowerShell

To download logs using Azure PowerShell, we first have to install Azure PowerShell from the PowerShell gallery. Run PowerShell from your machine using administrative rights.

Run the following command, which will install the Azure Resource Manager modules from the PowerShell gallery:

Install-Module AzureRM 

Then run another command that installs the Azure Service Management module from the PowerShell gallery, as follows:

Install-Module Azure

Once these modules are installed, you can connect to your Azure account by executing the following command:

Add-AzureAccount

This command asks you to provide your credentials and, once added, you have to set your subscription to where your website is running. Subscription can be set by running the following command:

Select-AzureSubscription '{subscription-name}'

Now, to stream the logs of your web application on the console itself, you can run the following command:

Get-AzureWebsiteLog -Name '{name_of_webapplication}'

To save the logs in a folder, you can run the following command:

Save-AzureWebsiteLog -Output 'C:userslogslogs.zip' -Name '{name_of_webapplication}'
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.31.163