I am configuring Diagnostics & IIS Logs for Azure Websites. Azure Manage Portal shows options to store Application Diagnostics to Azure Table Storage:
And pops up a dialog on clicking 'manage table storage' to provide Azure Table details:
Site Diagnostics to Blob Storage:
I am searching for Azure Cmdlet to enable these using PowerShell at deployment time.
Here is the Cmdlet i could find but it doesnt have any option to provide table details:
Enable-AzureWebsiteApplicationDiagnostic
C:\PS>Enable-AzureWebsiteApplicationDiagnostic -Name MyWebsite -Storage -LogLevel Information -StorageAccountName myaccount
Is there any otherway to do this?
After you enable the table diagnostics, try setting this app_setting for the SAS URL to your table:
DIAGNOSTICS_AZURETABLESASURL
Example:
You can find out more about the SAS URLs here: http://msdn.microsoft.com/en-us/library/azure/dn140255.aspx
You can't just set the table name because it needs more information for security purposes to access the table as fully as it needs to for writing data.
This is apparently fixed in the latest (as of 3/21/2016) release of the Azure PowerShell cmdlets. You can now specify the table/container name, e.g.
Enable-AzureWebsiteApplicationDiagnostic -Name <mysite> -Slot production -StorageAccountName <storageAccountName> -BlobStorage -StorageBlobContainerName <containerName> -LogLevel Verbose
Enable-AzureWebsiteApplicationDiagnostic -Name <mysite> -Slot production -StorageAccountName <storageAccountName> -TableStorage -StorageTableName <tableName> -LogLevel Verbose
Now
Enable-AzureWebsiteApplicationDiagnostic
does not work. See Enable-AzureWebsiteApplicationDiagnostic: specify storage account name?This was used (thanks to this: Is there a way to enable application logging to blob for azure app service using PowerShell or ARM template?)
Also one can find very useful to use https://resources.azure.com and Powershell tab there.