generic error when trying to enable flow logs
Enabling the flow logs via the gui works just fine. I am using azure-cli (2.0.43) on a RHEL7.5 box $ az network watcher flow-log configure --resource-group test-group --enabled true --retention 365 --storage-account flwea000000000000001 --nsg test-sg --debug
end of the debug file msrest.http_logger : 'x-ms-routing-request-id': 'SOUTHCENTRALUS:20180810T060856Z:' msrest.http_logger : 'X-Content-Type-Options': 'nosniff' msrest.http_logger : 'Date': 'Fri, 10 Aug 2018 06:08:56 GMT' msrest.http_logger : 'Cache-Control': 'no-cache, proxy-revalidate' msrest.http_logger : 'Connection': 'Keep-Alive' msrest.http_logger : 'Age': '0' msrest.http_logger : Response content: msrest.http_logger : { "error": { "code": "InternalServerError", "message": "An error occurred.", "details": [] } } msrest.exceptions : An error occurred. An error occurred.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 132ba089-fae4-ddf8-1119-4e83c6be94f5
- Version Independent ID: 31f4477d-92a5-7126-89df-44d9ea397e81
- Content: az network watcher flow-log
- Content Source: src/command_modules/azure-cli-network/azure/cli/command_modules/network/_help.py
- Service: virtual-network
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Hi @j-rat I just tried the command using the same parameters as you and ran into no issues. "InternalServerError" might be the result of some intermittent service issue. Is it still occurring? If so, some questions:
- Are your NSG and storage account all in the same resource group? What about location?
- Do you have network watcher enabled for the location your resources are in? When you enabled network watcher, did you use the same resource group as your resources?
@tjprescott hello and thank you for your response.
I have tried from my corporate environment and from an AWS EC2 instance and get the same error.
- The NSG and the Storage Account are both in the "East US" but are in different Resource Groups.
- I validated that I have Network Watcher enabled in the "East US" location. When enabling the Network Watcher, I had it use the default Resource Group "NetworkWatcherRG"
The other interesting thing is that, I can enable flow logs via the GUI with no problem.
The problem is that you have the NSG and storage account in different resource groups but are specifying both by name. Thus the CLI is assuming that both resources are in test-group which isn't the case. If you specify the full ARM ID of the storage account, your command will succeed.
I will keep this issue open because the error from the service should indicate that the storage account referenced does not exist, rather than giving an Internal Server Error.
@tjprescott thank you so much! That solved the problem perfectly. we greatly appreciate the help!
No problem, @j-rat. Glad I was able to help. :)
Hi @tjprescott I'm running into a similar issue, where I'm using the full id for both the NSG and the storage account:
az network watcher flow-log configure --nsg /subscriptions/<sub_id>/resourceGroups/test-rg/providers/Microsoft.Network/networkSecurityGroups/testnsg --enabled true --storage-account /subscriptions/<sub_id>/resourceGroups/testLogging-rg/providers/Microsoft.Storage/storageAccounts/testflowlogsa
@erickgalinkin Hi could you provide the following information:
- CorrelationRequestID
- region
- subscriptionid, in your request, you request id is "<sub_id"
Apologies - this is no longer an issue for me. I discovered that some of the automation created the storage accounts in a different region, even though they were in the same resource group. A less generic error message would be really helpful.
@erickgalinkin Thanks for let know. NetworkWatcher team already checked in a fix to return better error information. The fix should be deployed in 1 or 2 months.
@zwswim thanks for the update. Since this fix has been checked in to the service, I will close this issue.
The problem is that you have the NSG and storage account in different resource groups but are specifying both by name. Thus the CLI is assuming that both resources are in
test-groupwhich isn't the case. If you specify the full ARM ID of the storage account, your command will succeed.I will keep this issue open because the error from the service should indicate that the storage account referenced does not exist, rather than giving an Internal Server Error.
I was able to get around this by specifying the full resource ID for the storage account as recommended. I assume this is only a workaround though and look forward to a full solution.