private static async Task ProvisionAsync(HttpClient httpClient)
        {
            var spaceId = await Spaces.GetOrCreateSpaceAsync("Habitación", "Room", httpClient);

            var resourceId = await Resources.GetOrCreateResourceAsync(spaceId, "IotHub", httpClient);

            bool isProvisioning = true;

            while (isProvisioning)
            {
                var resource = await Resources.GetResourceAsync(resourceId, httpClient);

                if (resource.Status.ToLower() == "provisioning")
                {
                    await Task.Delay(2000);
                }
                else
                {
                    isProvisioning = false;
                }
            }

            var deviceId = await Devices.GetOrCreateDeviceAsync("Dispositivo 1", "ABC123",
                                                                spaceId, httpClient);

            var device = await Devices.GetDeviceAsync(deviceId, httpClient);

            var sensorId = await Sensors.GetOrCreateSensorAsync("Temperature", "TEMP2000", deviceId,
                                                                httpClient);

            var matcherId = await Matchers.GetOrCreateMatcherAsync("Matcher 1", spaceId, "Temperature",
                                                                   httpClient);

            var script = new StreamReader(@"js\udf.js").ReadToEnd();
            var udfId  = await UserDefinedFunctions.GetOrCreateUserDefinedFunctionAsync("Temperature-Udf-1",
                                                                                        spaceId, new[] { matcherId },
                                                                                        script,
                                                                                        httpClient);

            var roleAssignmentId = await RoleAssignments.CreateRoleAssignmentAsync(udfId,
                                                                                   spaceId, httpClient);

            Console.WriteLine($"SpaceId {spaceId}");
            Console.WriteLine($"ResourceId {resourceId}");
            Console.WriteLine($"DeviceId {deviceId}");
            Console.WriteLine($"ConnectionString {device.ConnectionString}");
            Console.WriteLine($"SensorId {sensorId}");
            Console.WriteLine($"MatcherId {matcherId}");
            Console.WriteLine($"UdfId {udfId}");
            Console.WriteLine($"RoleAssignmentId {roleAssignmentId}");
        }