Frank Liu
Frank Liu

Reputation: 1586

Unable to link storage account to Log analytics workspace

We are using fluentbit to output application logs to a Azure log analytics workspace. The application log does appear in the workspace as a table under the Logs blade, Custom Logs category. So far so good.

Due to the maximum retention period of the Log analytic workspace limited to 730 days, I thought linking a storage account to type Custom logs & IIS logs under the Linked storage accounts would solve the problem for me. My understanding is once a storage account is linked to type Custom logs & IIS logs, all Custom Logs will be written into the nominated storage account instead of the default storage account that comes with the creation of the Log analytics workspace. Is this understanding correct?

Secondly, after clicking on the Custom logs & IIS logs item, and selecting a storage account from the Pop-up blade on the left hand side, Azure Portal reported a message Successfully linked storage account . However, the Linked storage accounts view still reports No linked storage accounts.enter image description here

Browsing the target storage account, no log seems to be written to the storage account.

Updates 1

Storage account network configuration. enter image description here

Updates 2 The answer is accepted as it is technically correct. However, a few steps/details are missing in the documentation. In order to, map a customer storage account to a LA Workspace, one must build resources to match the following diagram. enter image description here

  1. Create a AMPLS resource.
  2. Link the AMPLS resource to your LA workspace.
  3. Create private endpoint on the target vnet for the AMPLS resource
  4. Create storage account.
  5. Create print endpoints (blob type) on the target vnet
  6. Link the storage account to the LA workspace.

Upvotes: 2

Views: 2162

Answers (1)

SaiKarri-MT
SaiKarri-MT

Reputation: 1301

We need to follow few prerequisites before linking the storage account to the workspace.

  1. Storage account should be in the same region as log analytics workspace.

  2. Need to give permissions for other services to allow accessing the storage account. enter image description here

  3. Allow Azure Monitor to access the storage account. If you chose to allow only select networks to access your storage account, you should select the exception: “Allow trusted Microsoft services to access this storage account”

For rest of the configuration information refer to MS Docs.

By following the above documentation, I can link the storage account successfully as below: enter image description here

Upvotes: 1

Related Questions