Coder Social home page Coder Social logo

Comments (4)

BrianVallelunga avatar BrianVallelunga commented on August 17, 2024

I've been attempting to fix this issue, but am coming up short. The tricky thing about the EventHub builder is that unlike the ServiceBus builder, the Hub and the Namespace are combined. What I think needs to happen is for the EventHub record to add a Namespace: LinkedResource field that points back to the EventHubNamespace, much like the Queue record for the ServiceBus. This can then be used to generate the correct dependency.

That said, I've been unsuccessful in getting the generation fixed so that the three-part version is output as a dependency. I thought replacing the Create method name with both the namespace name and hub name would work, but I've had no success. This produces the exact same resourceId reference.

// In type EventHub
interface IArmResource with
    member this.ResourceId = eventHubs.resourceId (this.Namespace.Name / this.Name)

    member this.JsonModel =
        {| eventHubs.Create(this.Namespace.Name / this.Name, this.Location, this.Dependencies, this.Tags) with
            properties =

from farmer.

isaacabraham avatar isaacabraham commented on August 17, 2024

Let me take a look at this one.

from farmer.

BrianVallelunga avatar BrianVallelunga commented on August 17, 2024

@isaacabraham Thanks for checking this out.

In an effort to support this properly, I first added a Namespace field to the EventHub type in the Namespaces module.

    type EventHub =
        {
            Name: ResourceName
            Namespace: LinkedResource
            Location: Location
            MessageRetentionDays: int option
            Partitions: int
            Dependencies: ResourceId Set
            CaptureDestination: CaptureDestination option
            Tags: Map<string, string>
        }

Then, in the BuildResources method, I assign it the value:

Namespace = Managed(namespaces.resourceId this.EventHubNamespaceName)

I think this is the correct approach and is modeled after the Service Bus. I believe the problem is in the ARM generation.

from farmer.

BrianVallelunga avatar BrianVallelunga commented on August 17, 2024

Thank you. I'll test it out.

from farmer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.