Score:0

Azure Policy Geographic Logic

cn flag

We're using Azure Policy to push out diagnostic settings for various PaaS solutions and running into some issues where we'd love to have one policy for 10+ regions and have them send logs to the regional log analytic workspace.

I know we could create 10+ policies and scope it to the specific regions, but I really don't want to have to maintain that many policies, therefore I'm hoping to add conditional logic to one policy and do it.

I've already done this for deploying the DCR rules by pulling variables from the VMs and then having logic within the policy. Therefore I assume it would be the same concept for diagnostic settings but I'm slightly concerned about the logic below and when it would check for that value vs. when my conditional logic would kick in.

{
            "anyOf": [
              {
                "value": "[parameters('matchWorkspace')]",
                "equals": false
              },
              {
                "field": "Microsoft.Insights/diagnosticSettings/workspaceId",
                "equals": "[parameters('logAnalytics')]"
              }
            ]
          }

The logic I'm using in my DCR rule is:

"variables": {
              "dcrResourceType": "Microsoft.Insights/dataCollectionRules",
              "workspaceLocale": {
                "eastus": {
                  "dataCollectionRuleId": "/subscriptions/XXXXXX/resourceGroups/XXXXXX/providers/Microsoft.Insights/dataCollectionRules/LinuxCommonEventsEastUS",
                  "dcrassociationName": "LinuxCommonEventsEastUS"
                },
                "germanywestcentral": {
                  "dataCollectionRuleId": "/subscriptions/XXXXXX/resourceGroups/XXXXXX/providers/Microsoft.Insights/dataCollectionRules/LinuxCommonEventsGermany",
                  "dcrassociationName": "LinuxCommonEventsGermany"
                }
              }

Was just curious how other people are handling issues like this. I don't feel like MS does a very good job of supporting companies that are multi-region.

Thanks!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.