나는 클라우드 서비스의 새 인스턴스를 만들기 위해 Azure에서 자동화 할 수있는 스크립트를 작성하려고합니다. New-AzureDeployment cmdlet을 작동시키는 데 문제가 있습니다.Azure 자동화를 사용하여 Powershell을 사용하여 클라우드 서비스 인스턴스 만들기
CSPKG 및 CSCFG 파일은 모두 Azure의 동일한 저장소 계정에 있지만 다른 컨테이너에 저장됩니다. CloudBerry를 사용하여 업로드했습니다.
param(
[parameter(Mandatory=$False)]
[string] $StorageAccount = 'storageaccount',
[parameter(Mandatory=$False)]
[string] $ServiceName = 'cloudservicesdev',
[parameter(Mandatory=$False)]
[string] $Slot = 'Production',
[parameter(Mandatory=$False)]
[string] $Label = 'BASE'
)
Write-Output "Start of workflow"
$cert = Get-AutomationCertificate -Name 'Credential'
$subID = 'subId'
Set-AzureSubscription -SubscriptionName "SubName" -CurrentStorageAccountName $StorageAccount -Certificate $cert -SubscriptionId $subID
Select-AzureSubscription "SubName"
$package = (Get-AzureStorageBlob -blob "package.cspkg" -Container "package").ICloudBlob.uri.AbsoluteUri
$config = (Get-AzureStorageBlob -blob "Config - Dev.cscfg" -Container "config").ICloudBlob.uri.AbsoluteUri
New-AzureDeployment -ServiceName "$ServiceName" -Slot "$Slot" -Package "$package" -Configuration "$config" -Label "$Label"
나는 다음과 같은 오류를 얻을
2014-12-08 05:57:57 PM, Error: New-AzureDeployment : The given path's format is not supported.
At Create_New_Cloud_Service_Instance:40 char:40
+
+ CategoryInfo : NotSpecified: (:) [New-AzureDeployment], NotSupportedException
+ FullyQualifiedErrorId :
System.NotSupportedException,Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.NewAzureDeploymentCommand
I했습니다 확인 모두 $ 패키지와 $ 설정 변수와가 (각각 https://storageaccount.blob.core.windows.net/package/package.cspkg 및 https://storageaccount.blob.core.windows.net/config/Config%20-%20Dev.cscfg) 내가 기대 파일 위치를 가리키는. 저장소의 해당 컨테이너 아래에있는 파일을 탐색 할 때 표시되는 URL과 일치합니다.
이것은 내가 본 예제와 비슷합니다. 나는 무엇을 잘못 했는가?
이 내가
아래 Joe의 답변에 따라 사용되는 새로운 코드가 나는 또한 애저 자동화 샌드 박스
param(
[parameter(Mandatory=$False)]
[string] $StorageAccount = 'storageaccount',
[parameter(Mandatory=$False)]
[string] $ServiceName = 'cloudservicesdev',
[parameter(Mandatory=$False)]
[string] $Slot = 'Production',
[parameter(Mandatory=$False)]
[string] $Label = 'BASE'
)
Write-Output "Start of workflow"
$cert = Get-AutomationCertificate -Name 'Credential'
$subID = 'subId'
Set-AzureSubscription -SubscriptionName "SubName" -CurrentStorageAccountName $StorageAccount -Certificate $cert -SubscriptionId $subID
Select-AzureSubscription "SubName"
$package = (Get-AzureStorageBlob -blob "package.cspkg" -Container "package").ICloudBlob.uri.AbsoluteUri
$TempFileLocation = "C:\temp\Config - Dev.cscfg"
$config = (Get-AzureStorageBlobContent -blob "Config - Dev.cscfg" -Container "config" -Destination $TempFileLocation -Force)
New-AzureDeployment -ServiceName "$ServiceName" -Slot "$Slot" -Package "$package" -Configuration $TempFileLocation -Label "$Label"
왜 구성 경로에 % 20이 포함되어 있습니까? 파일 이름에 공백을 넣지 않으려 고 시도 했습니까? 둘째 - (이것이 필요한지 확실하지 않지만) blob 컨테이너 (package, config)를 공용으로 만들려고 했습니까? –