CompositionalIT / farmer

Repeatable Azure deployments with ARM templates - made easy!
https://compositionalit.github.io/farmer
MIT License
523 stars 157 forks source link

Link to identity #979

Closed ahmed-ebaid closed 1 year ago

ahmed-ebaid commented 1 year ago

This PR closes # 978

The changes in this PR are as follows:

I have read the contributing guidelines and have completed the following:

If I haven't completed any of the tasks above, I include the reasons why here:

Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:

let resourceId =
    ResourceId.create (ManagedIdentity.userAssignedIdentities, ResourceName "user", "resourceGroup")

let userAssignedIdentity =  resourceId |> UserAssignedIdentity

let managedIdentity =
    { ManagedIdentity.Empty with
        UserAssigned = [ userAssignedIdentity ]
    }

let group =
    containerGroup {
        add_instances [ nginx ]
         link_to_identity resourceId
         add_managed_identity_registry_credentials [ registry "my-registry.azurecr.io" "user" managedIdentity ]
    }
    |> asAzureResource