问题描述
如何为Azure表存储的插槽启用诊断?
How to enable diagnostics for a slot to Azure Table Storage?
我尝试:
> Enable-AzureWebsiteApplicationDiagnostic -Name mysite `
-LogLevel Verbose -Slot myslot -TableStorage `
-StorageAccountName 'mystorageaccountname'
失败:
但是它存在.
当我这样做时:
> Set-AzureRmCurrentStorageAccount –ResourceGroupName mygroup `
–StorageAccountName mystorageaccountname
> Enable-AzureWebsiteApplicationDiagnostic -Name mysite `
-LogLevel Verbose -Slot myslot -TableStorage
失败:
文档说:
指定要在其中存储日志的存储帐户的名称.默认值为当前存储帐户.
Specifies the name of a storage account in which to store logs. The default value is the current storage account.
> gcm Enable-AzureWebsiteApplicationDiagnostic
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Enable-AzureWebsiteApplicationDiagnostic 5.3.0 azure
> get-module azure*
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 5.3.0 azure {Add-AzureAccount, Add-AzureApplicationGatewaySslCertif...
Script 4.3.2 Azure.Storage {Disable-AzureStorageDeleteRetentionPolicy, Enable-Azur...
Script 5.3.3 AzureRM.Profile {Add-AzureRmEnvironment, Clear-AzureRmContext, Clear-Az...
Script 5.0.0 AzureRM.Storage
更新.该网站也遇到了同样的问题.
Update. The same issue for the site.
> Enable-AzureWebsiteApplicationDiagnostic -Name mysite `
-LogLevel Verbose -BlobStorage -StorageBlobContainerName appslogs `
-StorageAccountName 'mystorageaccountname'
推荐答案
我没有找到使Enable-AzureWebsiteApplicationDiagnostic
工作的方法.而且似乎可以删除此Cmdlet.但是Set-AzureRmResource
用于使用Azure模板设置网站的诊断.请在 https://stackoverflow.com/a/51617949/511144
I didn't find how to make Enable-AzureWebsiteApplicationDiagnostic
work. And it seems that this Cmdlet can be removed. But Set-AzureRmResource
was used to set the diagnostic for the site using Azure template. Please see full script at https://stackoverflow.com/a/51617949/511144
这篇关于Enable-AzureWebsiteApplicationDiagnostic:指定存储帐户名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!