Вы также можете назвать его самостоятельно:
#function to Enable static website for the Azure Storage account.
Function Enable-AzureRmStorageStaticWebsite(
[Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext] [Parameter(Mandatory = $true)] $Context,
[string] [Parameter(Mandatory = $true)] $IndexDocument,
[string] [Parameter(Mandatory = $true)] $ErrorDocument404Path
) {
$sasToken = New-AzureStorageAccountSASToken -Context $Context `
-Service Blob -ResourceType Service -Protocol HttpsOnly -Permission wla `
-StartTime (Get-Date).AddHours(-1) -ExpiryTime (Get-Date).AddHours(4)
$body = (@'
<?xml version="1.0" encoding="utf-8"?>
<StorageServiceProperties>
<StaticWebsite>
<Enabled>true</Enabled>
<IndexDocument>{0}</IndexDocument>
<ErrorDocument404Path>{1}</ErrorDocument404Path>
</StaticWebsite>
</StorageServiceProperties>
'@ -f $IndexDocument, $ErrorDocument404Path)
$headers = @{"x-ms-version" = "2018-03-28"; "x-ms-date" = (Get-Date -Format R); "Content-Type" = "application/xml"; "Content-Length" = [string]$body.length }
$apiUrl = ("{0}{1}&restype=service&comp=properties" -f $Context.BlobEndPoint, $sasToken)
Write-Verbose ('Enable-AzureRmStorageStaticWebsite -IndexDocument {0} -ErrorDocument404Path {1}' -f $IndexDocument, $ErrorDocument404Path)
Invoke-RestMethod -Method Put -Uri $apiUrl -Headers $headers -Body $body
}
Пожалуйста, убедитесь, что у вас установлен модуль Azure.Storage , поддерживающий api-версию хранилища '2018-03-28' (я считаю,Версия powershell: 4.4.1 или выше)