-
Notifications
You must be signed in to change notification settings - Fork 27
Natalia issue6 temp #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Natalia issue6 temp #61
Conversation
… the API method called, url parameters entered and database query result
…ql query for GET method, passed in url parameters
…in, task title and description hardcoded
… encapsuled db connection block in its own function
…LETE not yet fully functional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still unable to run the function on Azure. locally I get a response, but I am not sure how to test it. Natalia's documentation on her PR is pretty detailed and it makes sense. It seems like she is able to run the deployed function on her own resource group. I am not sure why I am unable to add a test after deployment on azure. I would still approve this PR, but in the next sprint, we will have to address this issue and fix it in the next sprint.
I tested the API endpoints differently and was only focused to receive JSON data from a GET response.
NOTE: this is a sanitized PR that stems from a closed unresolved conflicts PR containing all appropriate dates for the commits (unavailable in this PR) |
Note: this PR repurposed a branch on a forked repo where all commit dates are retained.
Sprint1 Task4
This feature implements the API endpoint for getting, creating, updating and deleting a task when a userId and a taskId are passed in by the client.
Testing instructions:
preview
navigate to nsc-functionsapp-team1HttpTriggerAPIUsersIdTaskId
functionuserId 1
taskId 18
Note: GET and UDPATE are further along than POST and DELETE. You will therefore see different response messages
GET input/output








UPDATE input/output
POST input/output
DELETE input/output
Steps taken to complete this task:
If you choose to test the function code on your local machine /deploy to cloud:
ensure you have access to Azure
clone the repository
ensure that code for the other API functions is present as there are some shared modules across the functions *
install python 3.6-3.8
-set up the environ (venv and vscode files are not part of the available code)
-update
yourlocal.settings.jason
file to include these values, which will permit connecting to the database deployed to the cloud:{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "python",
"ENV_DATABASE_USERNAME": "username",
"ENV_DATABASE_PASSWORD": "xyz",
"ENV_DATABASE_NAME": "xyz",
"ENV_DATABASE_SERVER": "xyz"
}
}
-run your code with the appropriate venv Python interpreter
when testing in Postman, input same params as recommended above (userId =1, taskId =18)
note that some values such as userId =1, taskId =1 are not available in the database
To deploy in the cloud, create a resource group, a functions app, add records in the functions app configuration file to contain
same information as above, for
"ENV_DATABASE_SERVER"
"ENV_DATABASE_NAME"
"ENV_DATABASE_USERNAME"
"ENV_DATABASE_PASSWORD"
Deploy the function directly from VSCode via the Azure extension
For additional troubleshooting, see documentation for other API endpoints within the project, e.g. here