艾辉 发表于 2017-6-30 22:40:43

[Azure][PowerShell][ASM][03]Cloud Service

  $mySubscriptionName=“订阅名称"
  Select-AzureSubscription -SubscriptionName $mySubscriptionName 
  $myLocation = "China North" 
  $myServiceName = ""   
  New-AzureService -Location $myLocation -ServiceName $myServiceName 
  $myLocation = "China East" 
  $myServiceName = ""   
  New-AzureService -Location $myLocation -ServiceName $myServiceName  
  # Get-AzureService | Format-List ServiceName, Label, Location 
  # Remove-AzureService -ServiceName $myServiceName -Force -Verbose 
  .  浏览云服务
  Get-AzureService | Select-Object -Property ServiceName, Location,`
  @{Name='ProdIP';Expression={(Get-AzureDeployment -Slot Production `
  -ServiceName $_.ServiceName).VirtualIPs.Address}} | Format-Table -AutoSize
  If ((Test-AzureName -Name $ServiceName -Service)) {  
  Write-Host "Create Cloud Service ..." $ServiceName  -ForegroundColor Green  
  # New-AzureService -Location $myLocation -ServiceName $ServiceName 
  }Else {Write-Host "The specified DNS name is already taken or invalid. Try another ServiceName" -ForegroundColor Red} 
  # Cleanup  
  # Get-AzureService |Format-List ServiceName, Label, Location 
  # Remove-AzureService -ServiceName $ServiceName -Force -Verbose 
  Get-AzureService | Select-Object -Property ServiceName, Location,`
  @{Name='ProdIP';Expression={(Get-AzureDeployment -Slot Production `
  -ServiceName $_.ServiceName).VirtualIPs.Address}} | Format-Table -AutoSize
页: [1]
查看完整版本: [Azure][PowerShell][ASM][03]Cloud Service