I am trying to build a system to get ios udid like https://get.udid.io site. In the process of creating the system, we are creating a server that provides mobileconfig. There is a problem making python3 and Azure function. As per Apple's guide, I added 'application/x-apple-appen-config' to the header and include the signed mobileconfig file in the body to deliver the response. The file is received but it is 0byte.
If I print it using readlines in the middle, I think I can read the file properly, so what's the problem?
import logging
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
f = open("signed.mobileconfig", 'rb')
lines = f.readlines()
for line in lines:
print(line)
data = f.read()
f.close()
header = {'Content-Type' : 'application/x-apple-aspen-config'}
return func.HttpResponse(data, status_code=200, headers=header)