Hello 浩明 島田
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
Yes, you can use a system-assigned managed identity to authenticate with Azure Monitor when using data collection rules in Azure scale set flexible mode. You can do this by ARM template or using the Azure CLI or PowerShell.
-To use a system-assigned managed identity, you need to first enable it for your scale set. This can be done by setting the "identity" property of the scale set to "SystemAssigned".
-Once the managed identity is enabled, you can grant it the necessary permissions to read data from Azure Monitor by assigning it the "Monitoring Reader" role in Azure Active Directory.
-After the managed identity has been granted the appropriate permissions, you can configure your data collection rules to use it for authentication with Azure Monitor. This can be done by setting the "authentication" property of the data collection rule to "ManagedIdentity".
Alternatively, you can also use a user-assigned managed identity instead of a system-assigned managed identity. This requires you to create a managed identity in Azure Active Directory first, then assign it to your scale set and grant it the necessary permissions to access Azure Monitor.
Overall, using a system-assigned or user-assigned managed identity is a secure and recommended way to authenticate with Azure Monitor for data collection in Azure scale set flexible mode.
Hope this helps.