4

I'm trying to push source code that contains an IoT orchestration (and context etc.) to a (new, empty) scratch org. My scratch org is created with the following project-scratch-def.json (I've also tried IoT instead of IOT since the documentation is a bit unclear on the capitalization):

{
    "orgName": "meckert Company",
    "edition": "Developer",
    "language": "en_US",
    "features": ["IOT"],
    "settings": {
        "orgPreferenceSettings": {
            "s1DesktopEnabled": true
        }
    }
}

However, when I try, I can't push:

$ sfdx force:org:create -a scratch-iot-6 -f config/project-scratch-def.json
Successfully created scratch org: 00D7XXXXXXXXXXXXXX, username: test-  
[email protected]
$ sfdx force:source:push -u scratch-iot-6
=== Pushed Source
<...>
=== Push Errors
force-app/main/default/iot/Food_Container_Temperature_Orchestration.orchestration-meta.xml  Not available for deploy for this organization
force-app/main/default/iot/Food_Container_Temperature_Orchestration.orchestration           Not available for deploy for this organization
N/A                                                                                         Not available for deploy for this organization
N/A                                                                                         Not available for deploy for this organization
N/A                                                                                         Not available for deploy for this organization
force-app/main/default/iot/Food_Container_Context.orchestrationContext-meta.xml             Not available for deploy for this organization

When I log into the scratch org (via sfdx force:org:open), IoT is not activated in the Setup menu (Feature Settings -> Salesforce IoT -> Getting Started). After activating it manually by flicking the enable switch, the deployment works fine.

Is there any way I can avoid this manual activation in the scratch org and automate this / create the scratch org so that IoT is already activated?

2

1 Answer 1

2

The documentation has been updated with the new release: you can control the activation through IoTSettings as described here: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_iotsettings.htm

Here an example what the resulting project-scratch-def.json would contain:

"features": ["IOT"],
"settings": {
    "ioTSettings": {
        "enableIoT": true,
        "iotInsights": true
    }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .