microsoft / azure-container-apps

Roadmap and issues for Azure Container Apps
MIT License
372 stars 29 forks source link

Scale rule for azure service bus with user assigned identity #1344

Open karpikpl opened 1 day ago

karpikpl commented 1 day ago

This issue is a: (mark with an x)

Issue description

Creating container app with bicep does not set managed identity on the scale rule

    scaleRules: [
      {
        // https://keda.sh/docs/2.0/scalers/azure-service-bus/
        name: 'azure-servicebus-topic-rule'
        custom: {
          type: 'azure-servicebus'
          identity: userIdentity.id
          metadata: {
            topicName: serviceBusTopicName
            subscriptionName: serviceBusSubscriptionName
            namespace: serviceBusName
            messageCount: '5'
          }
        }
      }
    ]

bicep: Microsoft.App/containerApps@2024-10-02-preview

Steps to reproduce

  1. Run bicep deployment with scale rule
  2. Verify it was created correctly in azure portal

Expected behavior [What you expected to happen.] Scale rule is created with user assigned managed identity.

Actual behavior [What actually happened.] Managed identity is not set.

Screenshots
Image

Additional context

Scale rule can be updated in the portal and produces exactly the same JSON as the one in the sample: identity: userIdentity.id. Verified in ARM deployments that correct JSON is sent.

perry2of5 commented 20 hours ago

I've encountered a similar issue trying to set the identity with --scale-rule-identity, there it checks the box but doesn't select the identity. Perhaps that is a different issue? Or maybe it has the same root cause.

karpikpl commented 20 hours ago

I use AZD for deployment and it seems first deployment "checks the checkbox" but identity is not selected. Next deployment (AZD does two - one for provision, one for deployment) removes the check.