[英]How to assign a reserved IP address to a cloud service on Azure using Powershell 7?
[英]Set Azure Reserved IP on cloud service via powershell
如標題中所述,我無法為我的雲服務分配IP。
我已經關注了很多論壇和StackOverflow的文章/帖子,但仍然是問題所在。
當我嘗試跑步
Set-AzureReservedIPAssociation -ReservedIPName primosguardo365reservedip -ServiceName primosguardo365
我得到這個錯誤
Set-AzureReservedIPAssociation : ResourceNotFound: No deployments were found.
At line:1 char:1
+ Set-AzureReservedIPAssociation -ReservedIPName primosguardo365reserve ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureReservedIPAssociation], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.SetAzureReservedIPAssociationCmdlet
但是如果我嘗試使用相同的名稱獲取資源
λ Get-AzureReservedIP
ReservedIPName : Group Primosguardo365 primosguardo365reservedip
Address : **.**.**.**
Id : ******************
Label :
Location : West Europe
State : Created
InUse : False
ServiceName :
DeploymentName :
VirtualIPName :
OperationDescription : Get-AzureReservedIP
OperationId : ************************
OperationStatus : Succeeded
λ Get-AzureService "primosguardo365"
ServiceName : primosguardo365
Url : https://management.core.windows.net.................
Label : primosguardo365
Description : primosguardo365
Location : West Europe
AffinityGroup :
Status : Created
ExtendedProperties : {[ResourceGroup, Primosguardo365], [ResourceLocation, westeurope], [ProvisioningSource,
AzureResourceManager]}
DateModified : 28/03/2017 12:13:20
DateCreated : 28/03/2017 11:26:03
ReverseDnsFqdn :
WebWorkerRoleSizes : {}
VirtualMachineRoleSizes : {}
OperationDescription : Get-AzureService
OperationId : ****************************
OperationStatus : Succeeded
有人有什么建議嗎?
提前致謝!
編輯:
VIP只能分配給已部署的PRODUCTION實例。
但這沒有用,因為CloudServices已經具有靜態IP。
謝謝大家!
在測試中,我會重現您的錯誤,我只是通過新門戶創建了一個雲服務,然后將保留的IP地址與該服務相關聯,從而發生了錯誤。
PS C:\Users> Set-AzureReservedIPAssociation -ReservedIPName my9 -ServiceName "jasontest323"
Set-AzureReservedIPAssociation : ResourceNotFound: No deployments were found.
At line:1 char:1
+ Set-AzureReservedIPAssociation -ReservedIPName my9 -ServiceName "jaso ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureReservedIPAssociation], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.SetAzureReservedIPAssociationCmdlet
之后,我創建了另一個雲服務和一個VM,然后將保留的IP地址分配給該雲服務,它就可以工作。
PS C:\Users> Set-AzureReservedIPAssociation -ReservedIPName my9 -ServiceName "jasonvm3659"
OperationDescription OperationId OperationStatus
-------------------- ----------- ---------------
Set-AzureReservedIPAssociation 05ccff35-5642-7cc6-9c6b-b5dfe2d1603d Succeeded
因此,我檢查了兩個雲服務的狀態,發現生產運行時,該命令將起作用。
我們可以使用PowerShell檢查部署:
PS C:\Users> Get-AzureDeployment -ServiceName jasontest323
Get-AzureDeployment : ResourceNotFound: No deployments were found.
OperationID : '27da300bc3c67a5bbdbc954c1c19e3e7'
At line:1 char:1
+ Get-AzureDeployment -ServiceName jasontest323
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzureDeployment], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand
PS C:\Users> Get-AzureDeployment -ServiceName jasonvm3659
SdkVersion :
RollbackAllowed : False
Slot : Production
Name : jasonvm3659
DeploymentName : jasonvm3659
Url : http://jasonvm3659.cloudapp.net/
Status : Running
CurrentUpgradeDomain : 0
CurrentUpgradeDomainState :
UpgradeType :
RoleInstanceList : {jasonvm}
Configuration : <ServiceConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
<Role name="jasonvm">
<Instances count="1" />
</Role>
</ServiceConfiguration>
DeploymentId : fc627acb502a4a979b08c42f69cccf72
Label : jasonvm3659
VNetName : Group jasontest321 jasontest321
DnsSettings :
OSVersion :
RolesConfiguration : {[jasonvm, Microsoft.WindowsAzure.Commands.ServiceManagement.Model.RoleConfiguration]}
VirtualIPs : {jasonvm3659ContractContract}
ReservedIPName : my9
CreatedTime : 3/29/2017 1:10:28 PM
LastModifiedTime : 3/29/2017 1:27:42 PM
Locked : False
InternalLoadBalancerName :
LoadBalancers : {}
ExtensionConfiguration :
ServiceName : jasonvm3659
OperationDescription : Get-AzureDeployment
OperationId : f8b8xxxx-xxxx-xxxx-xxxx-xxxx2cdc1daa
OperationStatus : Succeeded
保留的IP用於經典模塊,僅用於通過VIP公開的VM和雲服務實例角色 。
因此,我們應該首先使用powershell Get-AzureDeployment -ServiceName primosguardo365
檢查部署。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.