Azure App Services inaruhusu waendelezaji kuunda, kupeleka, na kupanua programu za wavuti, nyuma za programu za simu, na APIs bila shida. Inasaidia lugha nyingi za programu na inajumuisha zana na huduma mbalimbali za Azure kwa ajili ya kuboresha kazi na usimamizi.
Kila programu inafanya kazi ndani ya sandbox lakini kutengwa kunategemea mipango ya App Service
Programu katika ngazi za Bure na Kushiriki zinafanya kazi kwenye VMs zinazoshirikiwa
Programu katika ngazi za Kawaida na Premium zinafanya kazi kwenye VMs zilizotengwa
Kumbuka kwamba hakuna ya kutengwa hizo inaweza kuzuia udhaifu wa kawaida wa wavuti (kama vile kupakia faili, au sindano). Na ikiwa utambulisho wa usimamizi unatumika, inaweza kuwa na uwezo wa kuinua mamlaka kwao.
Azure Function Apps
Kimsingi Azure Function apps ni sehemu ya Azure App Service katika wavuti na ikiwa utaenda kwenye console ya wavuti na kuorodhesha huduma zote za programu au kutekeleza az webapp list katika az cli utaweza kuona programu za Function pia zikiwa zimeorodheshwa hapa.
Kwa kweli baadhi ya vipengele vinavyohusiana na usalama ambavyo huduma za programu zinatumia (webapp katika az cli), pia vinatumika na programu za Function.
Basic Authentication
Wakati wa kuunda programu ya wavuti (na kazi ya Azure kwa kawaida) inawezekana kuashiria ikiwa unataka Uthibitishaji wa Msingi uwekwe. Hii kimsingi inawezesha SCM na FTP kwa programu ili iwezekane kupeleka programu kwa kutumia teknolojia hizo.
Zaidi ya hayo ili kuungana nazo, Azure inatoa API inayoruhusu kupata jina la mtumiaji, nenosiri na URL ya kuungana na seva za SCM na FTP.
Uthibitishaji: az webapp auth show --name lol --resource-group lol_group
SSH
Daima On
Kukarabati
Enumeration
# List webappsazwebapplist## Less informationazwebapplist--query"[].{hostName: defaultHostName, state: state, name: name, resourcegroup: resourceGroup}"# Get info about 1 appazwebappshow--name<name>--resource-group<res-group># Get instances of a webappazwebapplist-instances--name<name>--resource-group<res-group>## If you have enough perm you can go to the "consoleUrl" and access a shell inside the instance form the web# Get configured Auth informationazwebappauthshow--name<app-name>--resource-group<res-group># Get access restrictions of an appazwebappconfigaccess-restrictionshow--name<name>--resource-group<res-group># Remove access restrictionsazwebappconfigaccess-restrictionremove--resource-group<res-group>-n<name>--rule-name<rule-name># Get appsettings of an appazwebappconfigappsettingslist--name<name>--resource-group<res-group># Get backups of a webappazwebappconfigbackuplist--webapp-name<name>--resource-group<res-group># Get backups scheduled for a webappazwebappconfigbackupshow--webapp-name<name>--resource-group<res-group># Get snapshotsazwebappconfigsnapshotlist--resource-group<res-group>-n<name># Restore snapshotazwebappconfigsnapshotrestore-g<res-group>-n<name>--time2018-12-11T23:34:16.8388367# Get connection strings of a webappazwebappconfigconnection-stringlist--name<name>--resource-group<res-group># Get used container by the appazwebappconfigcontainershow--name<name>--resource-group<res-group># Get storage account configurations of a webappazwebappconfigstorage-accountlist--name<name>--resource-gl_group# List all the functionsazfunctionapplist# Get info of 1 funciton (although in the list you already get this info)azfunctionappshow--name<app-name>--resource-group<res-group>## If "linuxFxVersion" has something like: "DOCKER|mcr.microsoft.com/..."## This is using a container# Get details about the source of the function codeazfunctionappdeploymentsourceshow \--name <app-name> \--resource-group <res-group>## If error like "This is currently not supported."## Then, this is probalby using a container# Get more info if a container is being usedazfunctionappconfigcontainershow \--name <name> \--resource-group <res-group># Get settings (and privesc to the sorage account)azfunctionappconfigappsettingslist--name<app-name>--resource-group<res-group># Check if a domain was assigned to a function appazfunctionappconfighostnamelist--webapp-name<app-name>--resource-group<res-group># Get SSL certificatesazfunctionappconfigssllist--resource-group<res-group># Get network restrictionsazfunctionappconfigaccess-restrictionshow--name<app-name>--resource-group<res-group># Get more info about a function (invoke_url_template is the URL to invoke and script_href allows to see the code)azrest--methodGET \--url "https://management.azure.com/subscriptions/<subscription>/resourceGroups/<res-group>/providers/Microsoft.Web/sites/<app-name>/functions?api-version=2024-04-01"# Get source code with Master Key of the functioncurl"<script_href>?code=<master-key>"## Python examplecurl"https://newfuncttest123.azurewebsites.net/admin/vfs/home/site/wwwroot/function_app.py?code=<master-key>"-v# Get source codeazrest--url"https://management.azure.com/<subscription>/resourceGroups/<res-group>/providers/Microsoft.Web/sites/<app-name>/hostruntime/admin/vfs/function_app.py?relativePath=1&api-version=2022-03-01"
# Get App Services and Function AppsGet-AzWebApp# Get only App ServicesGet-AzWebApp|?{$_.Kind-notmatch"functionapp"}
#!/bin/bash# Get all App Service and Function Apps# Define Azure subscription IDazure_subscription="your_subscription_id"# Log in to Azureazlogin# Select Azure subscriptionazaccountset--subscription $azure_subscription# Get all App Services in the specified subscriptionlist_app_services=$(azappservicelist--query"[].{appServiceName: name, group: resourceGroup}"-otsv)# Iterate over each App Serviceecho"$list_app_services"|while IFS=$'\t'read-rappServiceNamegroup; do# Get the type of the App Serviceservice_type=$(azappserviceshow--name $appServiceName --resource-group $group --query"kind"-otsv)# Check if it is a Function App and print its nameif [ "$service_type"=="functionapp" ]; thenecho"Function App Name: $appServiceName"fidone
Pata akreditivu & pata ufikiaji wa msimbo wa wavuti
# Get connection strings that could contain credentials (with DBs for example)azwebappconfigconnection-stringlist--name<name>--resource-group<res-group>## Check how to use the DBs connection strings in the SQL page# Get credentials to access the code and DB credentials if configured.azwebappdeploymentlist-publishing-profiles--resource-group<res-group>-n<name># Get git URL to access the codeazwebappdeploymentsourceconfig-local-git--resource-group<res-group>-n<name># Access/Modify the code via gitgitclone'https://<username>:<password>@name.scm.azurewebsites.net/repo-name.git'## In my case the username was: $nameofthewebapp and the password some random chars## If you change the code and do a push, the app is automatically redeployed