mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 14:47:17 -07:00
Merge pull request #305 from Fudgedotdotdot/master
azrte-Fudgedotdotdot
This commit is contained in:
+32
-4
@@ -357,12 +357,40 @@ Then, you can access with these **basic auth credentials to the SCM URL** of you
|
|||||||
curl -u '<username>:<password>' \
|
curl -u '<username>:<password>' \
|
||||||
https://<app-name>.scm.azurewebsites.net/api/settings -v
|
https://<app-name>.scm.azurewebsites.net/api/settings -v
|
||||||
|
|
||||||
# Deploy code to the funciton
|
|
||||||
zip function_app.zip function_app.py # Your code in function_app.py
|
|
||||||
curl -u '<username>:<password>' -X POST --data-binary "@<zip_file_path>" \
|
|
||||||
https://<app-name>.scm.azurewebsites.net/api/zipdeploy
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can download, modify and upload new function code :
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# download
|
||||||
|
curl -u '<username>:<password>' -X GET \
|
||||||
|
https://<app-name>.scm.azurewebsites.net/api/zip/site/wwwroot/ \
|
||||||
|
-o current_function_code.zip
|
||||||
|
|
||||||
|
unzip current_function_code.zip -d updated_code/
|
||||||
|
cd updated_code/
|
||||||
|
#... modify the function code
|
||||||
|
zip -r ../updated_function_app.zip .
|
||||||
|
cd ../
|
||||||
|
|
||||||
|
# upload
|
||||||
|
curl -u '<username>:<password>' https://<app-name>.scm.azurewebsites.net/api/zipdeploy -X POST --data-binary @updated_function_app.zip -v
|
||||||
|
```
|
||||||
|
|
||||||
|
You can even upload a specific file :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -u '<username>:<password>' \
|
||||||
|
-X PUT \
|
||||||
|
-H "Content-Type: application/javascript" \
|
||||||
|
-H "If-Match: *" \
|
||||||
|
--data-binary "@./my_local_payload.js" \
|
||||||
|
"https://<app-name>.scm.azurewebsites.net/api/vfs/site/wwwroot/hello-world/index.js" # example NodeJS file
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_Note that the **SCM username** is usually the char "$" followed by the name of the app, so: `$<app-name>`._
|
_Note that the **SCM username** is usually the char "$" followed by the name of the app, so: `$<app-name>`._
|
||||||
|
|
||||||
You can also access the web page from `https://<app-name>.scm.azurewebsites.net/BasicAuth`
|
You can also access the web page from `https://<app-name>.scm.azurewebsites.net/BasicAuth`
|
||||||
|
|||||||
Reference in New Issue
Block a user