The Internet of Things (IoT) offers new services in the context of smart cities through digital devices embedded with sensing, computation, and communication capabilities. The IoT devices enhance the smart city vision by employing advanced communication and computation technologies for smart city administrations. The IoT-based smart city applications require many IoT devices and gateways to be deployed at different city points. Heterogeneous sensing devices, placing smart devices in a constrained or physically inaccessible area, and large urban areas to monitor together make IoT node deployment and sensing management tasks difficult, time-consuming, and expensive. Additionally, certain tasks may require smart devices to be deployed for a very short period of time to sense and report contextual information, making it economically infeasible to purchase the devices. In this regard, we propose a drone-based IoT as a Service (IoTaaS) framework that enables the dynamic provisioning or deployment of IoT devices using drones. IoTaaS allows IoT devices and gateways to be mounted on drones and provides a distributed cloud service by placing the IoT devices in an area according to the requirements specified by a user. We also provide an economic analysis for operating such drone-based IoT services. A proof-of-concept implementation of IoTaaS for smart agriculture and air pollution monitoring applications shows that IoTaaS can reduce setup costs and increase the usage of IoT devices.