You can directly execute Windows or MacOS code locally after add
.env
file.
You must have Chrome browser first!
Before you start using it, clone this repository and choose what OS you use.
For Example (MacOS):
git clone https://github.com/MarsWangyang/LogicApp_APIConnection_Authorization.git
cd MacOS/
python3 -m venv .venv # create a virtual environment
source .venv/bin/activate # launch your virtual environment
pip install -r requirements.txt
Service Principal
An Azure service principal is an identity created for use with applications, hosted services, and automated tools to access Azure resources. This access is restricted by the roles assigned to the service principal, giving you control over which resources can be accessed and at which level
Before using it, I choose Service Principal to implement this authentication. How to create a service principal? Check here
- copy the information of the service principal you just created.
- add file
.env
- revise
.env
file to changet to your service princial info and save itTENANT_ID=XXXXXXXX CLIENT_ID=XXXXXXXX CLIENT_SECRET=XXXXXXXX SUBSCRIPTION_ID=XXXXXXXX OBJECT_ID=XXXXXXX
- open
main.py
and press F5 to run the code. - Enter the information of your API connection.
- Done!
Service Principal
- add file
Windows Executable Folder/.env
- revise
.env
file to changet to your service princial info and save itTENANT_ID=XXXXXXXX CLIENT_ID=XXXXXXXX CLIENT_SECRET=XXXXXXXX SUBSCRIPTION_ID=XXXXXXXX OBJECT_ID=XXXXXXX
- Double click to open
/Windows Executable Folder/main.exe
to run your app
For MacOS version:
please go to /MacOS
, adding .env
file include your service prinicpal credential, and pip install py2app
in your environment and run script below
$ python setup.py py2app -A # rebuild your application
or follow this reference: https://zhuanlan.zhihu.com/p/454550005 from zhihu by @风影忍着