public CloudBackend(Workspace workspace, IInfrastructureEnvironment environment)
        {
            System = workspace.Model.AddSoftwareSystem(
                Location.Internal,
                "Azure IoT system",
                "Azure cloud based backend for processing data created on sensors / devices");

            SecretStorage       = new SecretStorage(this, environment);
            CloudGateway        = new CloudGateway(this, environment);
            DeviceProvisioning  = new DeviceProvisioning(this, CloudGateway, environment);
            TelemetryStorage    = new TelemetryStorage(this, environment);
            ApplicationInsights = new ApplicationInsights(this, environment);
            MasterDataStorage   = new MasterDataStorage(this, new SqlServer(environment), environment);
            SanitizedMessages   = new SanitizedMessages(this, new EventHubNamespace(environment), environment);
            Ingress             = new Ingress(this, CloudGateway, TelemetryStorage, MasterDataStorage, SanitizedMessages, ApplicationInsights, environment);
            StreamAnalytics     = new StreamAnalytics(this, SanitizedMessages, TelemetryStorage, environment);
            RestApi             = new RestApi(this, TelemetryStorage, MasterDataStorage, ApplicationInsights, environment);
            UserInterface       = new UserInterface(this, RestApi, environment);

            Device = workspace.Model.AddSoftwareSystem(Location.External, "Device", "Sends data into the cloud");
            Device.Uses(CloudGateway, "Send telemetry data and failure events", "MQTT");
            Device.Uses(DeviceProvisioning, "Provision device", "HTTPS");

            User = workspace.Model.AddPerson("User", "Person using the system to view data and take action on it");
            User.Uses(UserInterface, "View devices and their raw and aggregated data");

            StoreSecretsInKeyVault();
        }
Example #2
0
        public UserInterface(CloudBackend cloudBackend, RestApi restApi, IInfrastructureEnvironment environment)
        {
            Container = cloudBackend.System.AddContainer(
                name: "User interface",
                description: "Visualizes the data, dashboarding etc.",
                technology: "Azure App Service");

            Infrastructure = new WebAppService
            {
                Name = "ref-ui-" + environment.Name,
                EnvironmentInvariantName = "ref-ui"
            };

            Uses(restApi).Over <Https>().InOrderTo("Load data");
        }