-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Log Analytics with Solutions and Diagnostics Settings Sample #607
Add Log Analytics with Solutions and Diagnostics Settings Sample #607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Can you take a look at the comments and let us know if you have questions about the changes we are requesting?
} | ||
|
||
resource solutionsVMInsights 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' = { | ||
name: '${vmInsights.name}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need the string interpolation here. You can simply do:
name: vmInsights.name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to name: vmInsights.name
docs/examples/201/log-analytics-with-solutions-and-diagnostics/main.bicep
Outdated
Show resolved
Hide resolved
docs/examples/201/log-analytics-with-solutions-and-diagnostics/main.bicep
Outdated
Show resolved
Hide resolved
param logAnalyticsWorkspaceName string = 'la-${uniqueString(resourceGroup().id)}' | ||
|
||
var vmInsights = { | ||
name: 'VMInsights(${logAnalyticsWorkspaceName})' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to have the parens ()
as part of the string here? In other words, the parens are going to be in the final calculated name and will show up in the resource names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did intend to have the parens ()
as part of the string. In referencing the documentation on enabling Azure Monitor for VMs and Azure Monitor for Containers, that syntax is used. You can view the sample ARM Template at this link: https://docs.microsoft.com/en-us/azure/azure-monitor/insights/vminsights-enable-resource-manager
"apiVersion": "2015-11-01-preview", "type": "Microsoft.OperationsManagement/solutions", "location": "[parameters('WorkspaceLocation')]", "name": "[concat('VMInsights', '(', split(parameters('WorkspaceResourceId'),'/')[8], ')')]",
I tried using name: 'VMInsights-${logAnalyticsWorkspaceName}'
as well as some other options, and the deployment errored out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. Looks good to me then.
Thanks for making the updates! We will wait until #580 is merged and see if the tests start passing. You may need to regenerate the bicep files with the new bicep CLI at that time. |
Question: For the BICEP CLI, should that be the latest download, or will I need to compile a new version of the CLI? |
We aren't generating nightly builds, so you need to pull the latest from here: https://github.com/Azure/bicep/actions/runs/297578556 That being said, we are in a bit of a mixed state having just introduced type validation of resources, and we are still working out the kinks. If you are alright with it, we will edit this PR to get the tests passing then merge it in. Does that sound ok? |
Closing this since these files were also in #620, which have been merged to master |
Created a sample BICEP file that deploys the following:
Naming convention for the resources based on ${uniqueString(resourceGroup().id)}