简体   繁体   中英

how to create folder and add file in azure web app using powershell

I am trying to do a simple task of creating a folder in an azure web app and add a file in it. Here is what I've achieved so far and need some help with the right commands

Add-AzureAccount 
Select-AzureRmSubscription -SubscriptionName 'Demo' 
$webApp = Get-AzureRmWebApp -Name 'test--app' -ResourceGroupName 'TEST-POC-AUTOMATION'

$webApp.<CANT FIGURE OUT WHICH COMMAND>

$root = 'D:\home\site\wwwroot\webapps\ROOT'
if (!(Test-Path $root)) 
{
md $root
} 

I am trying to wonder if this is possible or i've to use KUDU API to achieve this. Appreciate any inputs.

You could use Kudu API to do this, check this link .

PUT /api/vfs/{path}/
Creates a directory at path. The path can be nested, e.g. `folder1/folder2`.

If you want to use Power Shell to call the API, you could check this example .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM