question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extending existing resource with custom fields

See original GitHub issue

I’ve looked at Convert from JSON to an F# anonymous record and Migrating to IArmResource, and (correct me if I am wrong) it looks like it does not allow adding fields/properties to existing resources (but rather only creating new resources from scratch). Is there a way to just add custom JSON or anonymous record to e.g. a webApp?

More specifically I am looking to mount Azure Storage as a local share in a container app in App Service by adding the following under “properties” (next to e.g. siteConfig that is already generated by Farmer):

"azureStorageAccounts": {
    "my-storage-mount": {
        "type": "AzureFiles",
        "accountName": "storageAccountName",
        "shareName": "sharename",
        "mountPath": "/data",
        "accessKey": "..."
    }
}

Would I have to recreate the whole webApp or Microsoft.Web/sites/config JSON manually in order to add this section, or is there a way to just “jack in” a custom field for azureStorageAccounts?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
isaacabrahamcommented, Aug 13, 2021

@Yakimych exactly right. We’d have to have some way of splicing the JSON together. A crude option would be that we give you access to the final JSON as a JObject (or whatever the System Text JSON equivalent of that is) and it’s your responsibility to return back some valid JSON.

1reaction
isaacabrahamcommented, Jul 26, 2021

@Yakimych great question. For the moment, it’s unfortunately the former - you can only add in entirely new resources, rather than modifying an object. I’ve been thinking about ways of letting you “plug in” to the very bottom of the pipeline though to modify the JSON that is output as well, but unfortunately nothing that’s ready for testing out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Custom Fields to find Available Resources based ...
Add your own Custom Fields to your Resources and Projects to Quickly Match and Find Available Resources against your Project Requirements.
Read more >
Extending the profile resource with a new field
Choose the Extend an existing resource option. Select the Profile (profile) resource. Click Create. In the Fields category of the Data ...
Read more >
Extend the Kubernetes API with CustomResourceDefinitions
This page shows how to install a custom resource into the Kubernetes API by creating a CustomResourceDefinition. Before you begin You need ...
Read more >
Custom Structures - HAPI FHIR Documentation
The most elegant way of adding extensions to a resource is through the use of custom fields. The following example shows a custom...
Read more >
Add custom data to resources using extensions
In this article, we'll discuss how Microsoft Graph supports extending its resources, the options available to add custom properties and when to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found