John Yassa's Blog

Home » Microsoft Azure

Category Archives: Microsoft Azure

Office 365 Achieved 99.99% Availability in Q3 2016

If anyone still care about Microsoft online services SLA, Microsoft just announced it SLA for Q3 2016

sla

But did you ever ask yourself how Microsoft calculate the SLA for its online services

Microsoft is calculating the SLA based on the below formula

sla-calc

Where Downtime is Any period of time when users are unable to send or receive email with Outlook Web Access. There is no Scheduled Downtime for this service.

You Can refer to this document for more clarification about SLA for Microsoft Online services onlinesvcsconsolidatedslawwenglishnovember212016cr

References: Microsoft Products

 

 

Microsoft to drop Azure RemoteApp after partnership with Citrix

Microsoft has announced on 12th August,2016 next step in their broad partnership with Citrix in the remote desktop and applications space, they will start to “wind down” its Azure RemoteApp technology in favor of application virtualization software and services from its partner Citrix.

Microsoft plans to continue supporting existing Azure RemoteApp customers through August 31, 2017, after which time the service will be discontinued. New purchases of Azure RemoteApp will end October 1, 2016,

Microsoft has explained this step as below:

“Customers have provided us consistent feedback that they want a comprehensive, end-to-end, cloud-based solution for delivering Windows apps. The best way for us to deliver this is with Citrix through XenApp “express”, currently under development. XenApp “express” combines the simplicity of application remoting and the scalability of Azure with the security, management, and performance benefits of XenApp, to deliver Windows applications to any employee on any device. We will have much more to share on this offering through the coming months.”

Citrix officials described the situation a bit differently, saying Microsoft will be assisting Citrix in developing a next-generation Citrix XenApp and associated XenDesktop service.

Citrix officials added: “In many ways, you can look at this XenApp “express” service as Azure RemoteApp v2.0.”

 

Source: Microsoft Blogs , ZDnet

Announcing ExpressRoute for Office 365

Azure ExpressRoute for Office 365 enables organizations to establish a private, managed network connection to Office 365 as an alternative to connecting over the Internet. This direct connection offers customers more predictable network performance, an SLA for guaranteed availability and additional data privacy. As more organizations depend on Office 365 for document collaboration and communications, they will come to depend more and more on the network connectivity they have between their users and Office 365.

Depending on your network configuration, here’s how you can work with network operators offering ExpressRoute for Office 365 to establish a connection between your network and Office 365:

  • If your organization already uses Azure ExpressRoute, your network operator can simply turn on the connectivity for you. Since use of Office 365 generates additional network traffic, you should discuss the requirements for additional bandwidth with your network operator.
  • Organizations using IP VPN technology for a WAN provided by a network operator can ask the network operator to add Office 365 as a node on your WAN. Once Office 365 connectivity is added, Office 365 services appear as if they are on your WAN—like an offsite datacenter.
  • ExpressRoute can also support large or point-to-point network connections. If you have a large broad network, then you may already have a network connection in a co-location facility where Azure ExpressRoute is available. You should work with your network provider to identify the best way to connect to Azure ExpressRoute.

For More Clarification

Users can connect from anywhere in the world that your network operator provides access. Each network operator connects to the Microsoft network at specific locations. They can provide networking from the user location to the Microsoft network connection. You should discuss the options with your network operator. The locations where they will connect to Microsoft’s network are listed here.

Organizations interested in purchasing ExpressRoute for Office 365 should have an Azure subscription and should discuss details of the connectivity with an Azure ExpressRoute partner.

 

Source: Office Blogs

New activity logging and reporting capabilities for Office 365

Microsoft is pleased to announce the roll out of new activity logging and reporting capabilities for Office 365, including the Office 365 activity report, comprehensive logging capability, PowerShell command or cmdlet and a preview of the Office 365 Management Activity API.

Office 365 activity report

The Office 365 activity report enables you to investigate a user’s activity by searching for a user, file or other resource across SharePoint Online, One Drive for Business, Exchange Online and Azure Active Directory, and then download the activities to a CSV (comma separate values) file. You can filter by date range, user, file/folder and activity type. This feature is especially useful for compliance reporting purposes for companies that are in highly regulated industries such as pharmaceuticals and financial institutions

You can use the Office 365 activity report in the Office 365 Compliance Center to view user and admin activity in your Office 365 organization. The report contains entries for the following types of events:

  • Admin activity (admin audit logging) in Exchange Online.
  • Access to mailboxes by someone other than the owner (mailbox audit logging) in Exchange Online.
  • User activity in SharePoint Online and OneDrive for Business.
  • Admin activity in SharePoint Online and OneDrive for Business.
  • Admin activity in Azure Active Directory (the directory service for Office 365).
  • User sign-in activity in Azure Active Directory.

Announcing-new-activity-logging-and-reporting-capabilities-for-Office-365-1-v2

Comprehensive logging capability

User and admin activity events are logged across SharePoint Online, One Drive for Business, Exchange Online and Azure Active Directory. This is useful for helping to see what types of files a user has been sharing with others in the organization.

Today, you can search on over 150 events (with more coming soon), including file views, mailbox owner activity, Azure Active Directory log ins and many more. In the future, we plan to expand these capabilities to include activities in other Office 365 services, such as Yammer and Skype for Business.

Search PowerShell cmdlet

Another new way to search activity logs is with PowerShell, using the Search-UnifiedAuditLog cmdlet, which enables you to run scoped queries against the audit storage log, such as by date, record type, operation and file extension. This cmdlet also lets you export those logs to a file. For example you could run the following cmdlet to search user activity logs for all events from May 1, 2015 to June 26, 2015:

Search-UnifiedAuditLog -StartDate May 1, 2015 -EndDate June 26, 2015

These capabilities started to roll out last month. 

 

Sources: Office Blogs

Finally granular administrative roles are now available in Office 365

Since Microsoft lunched Office 365 , granular administrative roles was a request from most of their clients

Lets assume that i have an E3 plan , and i have an outsource company to develop my Intranet based on SharePoint Online , the only way to give them permission to do that is to provide them Global administrator permission , which is impossible.

Now Microsoft has fixed this issue by providing new administrative roles ( Exchange administrator – SharePoint administrator – Skype for business administrator)

Enter granular administrative roles to provide Office 365 tenants with a method of assigning control over different parts of Office 365 to specific users. Tenant administrators remain all-powerful, but now they have a chance to share their power with others.

The source of authority for granular management roles lies in groups held in Azure Active Directory (AAD). You can’t see these groups through the AAD console and have to work with them using the Office 365 Admin console or PowerShell. You can see the available roles by running the Get-MsOlRole cmdlet. This command lists the available roles – the ObjectId property is important because you will use it to interact with roles in other places.

2

To assign a user account one of these roles, go to the Office 365 Admin Center, select the account in the Users section, and edit it. Go to Roles and select “Limited admin access” as shown in the screen shot below

You can assign Multiple roles to one user

1

You can also use PowerShell to add user accounts to administrative roles. For instance, here’s how t add a new Exchange Online administrator:

Add-MsOlRoleMember –RoleName ‘Exchange Service Administrator’ –RoleMemberEmailAddress ‘John.yassa@johnyassa.com’

After you assign the user the granular permission , allow him a couple of minutes , he should be able to log-on and see the administrative interfaces as below:

3

 

Sources:  Granular administrative roles appear in Office 365

 

 

 

 

Unable to Sync Hash of users’ password with Azure AD using AAD Sync service

After downloading the new Microsoft Azure Active Directory Sync Services (AADSync tool) from the URL Download, i faced a very wired issue, all functions was working properly syncing to the cloud from on premise and also write back password was working fine except the Password synchronization to the cloud , it was not working at all  even after the full initial sync

I found the below event log in the application log

Log Name: Application
Source: Directory Synchronization
Date: 5/5/2015 12:50:50 PM
Event ID: 611
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Computer: AADsyncserver1.xxxxxxx.com
Description:
Password synchronization failed for domain: xxxxxxx.com. Details:
Microsoft.Online.PasswordSynchronization.SynchronizationManagerException: Unable to open connection to domain: xxxxxxx.com. Error: There was an error creating the connection context. —> Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsException: There was an error creating the connection context. —> System.MissingMethodException: Method not found: ‘IntPtr System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(!!0)’.
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnectionContext.CreateDrsHandle(Void* rpcBindingHandle, SafePointer<_SEC_WINNT_AUTH_IDENTITY_W> authHandle)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.EstablishConnection()
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.Connect()
at Microsoft.Online.PasswordSynchronization.RetryUtility.<>c__DisplayClass1.<ExecuteWithRetry>b__0()
at Microsoft.Online.PasswordSynchronization.RetryUtility.ExecuteWithRetry[T](Func`1 operation, Func`1 shouldAbort, RetryPolicyHandler retryPolicy)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.CreateConnection()
at Microsoft.Online.PasswordSynchronization.RecoveryTask.SynchronizeCredentialsToCloud()
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.SynchronizeSecrets()
at Microsoft.Online.PasswordSynchronization.SynchronizationExecutionContext.SynchronizeDomain()
at Microsoft.Online.PasswordSynchronization.SynchronizationManager.SynchronizeDomain(SynchronizationExecutionContext syncExecutionContext)
Microsoft.Online.PasswordSynchronization.SynchronizationManagerException: Unable to open connection to domain: xxxxxxx.com. Error: There was an error creating the connection context. —> Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsException: There was an error creating the connection context. —> System.MissingMethodException: Method not found: ‘IntPtr System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(!!0)’.
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnectionContext.CreateDrsHandle(Void* rpcBindingHandle, SafePointer<_SEC_WINNT_AUTH_IDENTITY_W> authHandle)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.EstablishConnection()
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.Connect()
at Microsoft.Online.PasswordSynchronization.RetryUtility.<>c__DisplayClass1.<ExecuteWithRetry>b__0()
at Microsoft.Online.PasswordSynchronization.RetryUtility.ExecuteWithRetry[T](Func`1 operation, Func`1 shouldAbort, RetryPolicyHandler retryPolicy)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.CreateConnection()
at Microsoft.Online.PasswordSynchronization.RecoveryTask.SynchronizeCredentialsToCloud()
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.SynchronizeSecrets()
at Microsoft.Online.PasswordSynchronization.SynchronizationExecutionContext.SynchronizeDomain()
at Microsoft.Online.PasswordSynchronization.SynchronizationManager.SynchronizeDomain(SynchronizationExecutionContext syncExecutionContext)
Microsoft.Online.PasswordSynchronization.SynchronizationManagerException: Unable to open connection to domain: xxxxxxx.com. Error: There was an error creating the connection context. —> Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsException: There was an error creating the connection context. —> System.MissingMethodException: Method not found: ‘IntPtr System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(!!0)’.
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnectionContext.CreateDrsHandle(Void* rpcBindingHandle, SafePointer<_SEC_WINNT_AUTH_IDENTITY_W> authHandle)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.EstablishConnection()
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.Connect()
at Microsoft.Online.PasswordSynchronization.RetryUtility.<>c__DisplayClass1.<ExecuteWithRetry>b__0()
at Microsoft.Online.PasswordSynchronization.RetryUtility.ExecuteWithRetry[T](Func`1 operation, Func`1 shouldAbort, RetryPolicyHandler retryPolicy)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.CreateConnection()
at Microsoft.Online.PasswordSynchronization.RecoveryTask.SynchronizeCredentialsToCloud()
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.SynchronizeSecrets()
at Microsoft.Online.PasswordSynchronization.SynchronizationExecutionContext.SynchronizeDomain()
at Microsoft.Online.PasswordSynchronization.SynchronizationManager.SynchronizeDomain(SynchronizationExecutionContext syncExecutionContext)
.

xxxxxxx.com
Event Xml:
<Event xmlns=”http://schemas.microsoft.com/win/2004/08/events/event”&gt;
<System>
<Provider Name=”Directory Synchronization” />
<EventID Qualifiers=”0″>611</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime=”2015-05-05T09:50:50.000000000Z” />
<EventRecordID>15413</EventRecordID>
<Channel>Application</Channel>
<Computer>QinvestADSYNC01.xxxxxxx.com</Computer>
<Security />
</System>
<EventData>
<Data>Password synchronization failed for domain: xxxxxxx.com. Details:
Microsoft.Online.PasswordSynchronization.SynchronizationManagerException: Unable to open connection to domain: xxxxxxx.com. Error: There was an error creating the connection context. —&gt; Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsException: There was an error creating the connection context. —&gt; System.MissingMethodException: Method not found: ‘IntPtr System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(!!0)’.
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnectionContext.CreateDrsHandle(Void* rpcBindingHandle, SafePointer&lt;_SEC_WINNT_AUTH_IDENTITY_W&gt; authHandle)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.EstablishConnection()
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.Connect()
at Microsoft.Online.PasswordSynchronization.RetryUtility.&lt;&gt;c__DisplayClass1.&lt;ExecuteWithRetry&gt;b__0()
at Microsoft.Online.PasswordSynchronization.RetryUtility.ExecuteWithRetry[T](Func`1 operation, Func`1 shouldAbort, RetryPolicyHandler retryPolicy)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.CreateConnection()
at Microsoft.Online.PasswordSynchronization.RecoveryTask.SynchronizeCredentialsToCloud()
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.SynchronizeSecrets()
at Microsoft.Online.PasswordSynchronization.SynchronizationExecutionContext.SynchronizeDomain()
at Microsoft.Online.PasswordSynchronization.SynchronizationManager.SynchronizeDomain(SynchronizationExecutionContext syncExecutionContext)
Microsoft.Online.PasswordSynchronization.SynchronizationManagerException: Unable to open connection to domain: xxxxxxx.com. Error: There was an error creating the connection context. —&gt; Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsException: There was an error creating the connection context. —&gt; System.MissingMethodException: Method not found: ‘IntPtr System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(!!0)’.
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnectionContext.CreateDrsHandle(Void* rpcBindingHandle, SafePointer&lt;_SEC_WINNT_AUTH_IDENTITY_W&gt; authHandle)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.EstablishConnection()
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.Connect()
at Microsoft.Online.PasswordSynchronization.RetryUtility.&lt;&gt;c__DisplayClass1.&lt;ExecuteWithRetry&gt;b__0()
at Microsoft.Online.PasswordSynchronization.RetryUtility.ExecuteWithRetry[T](Func`1 operation, Func`1 shouldAbort, RetryPolicyHandler retryPolicy)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.CreateConnection()
at Microsoft.Online.PasswordSynchronization.RecoveryTask.SynchronizeCredentialsToCloud()
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.SynchronizeSecrets()
at Microsoft.Online.PasswordSynchronization.SynchronizationExecutionContext.SynchronizeDomain()
at Microsoft.Online.PasswordSynchronization.SynchronizationManager.SynchronizeDomain(SynchronizationExecutionContext syncExecutionContext)
Microsoft.Online.PasswordSynchronization.SynchronizationManagerException: Unable to open connection to domain: xxxxxxx.com. Error: There was an error creating the connection context. —&gt; Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsException: There was an error creating the connection context. —&gt; System.MissingMethodException: Method not found: ‘IntPtr System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(!!0)’.
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnectionContext.CreateDrsHandle(Void* rpcBindingHandle, SafePointer&lt;_SEC_WINNT_AUTH_IDENTITY_W&gt; authHandle)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsRpcConnection.CreateConnectionContext(SourceDomainController sourceDomain)
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.EstablishConnection()
at Microsoft.Online.PasswordSynchronization.DirectoryReplicationServices.DrsConnection.Connect()
at Microsoft.Online.PasswordSynchronization.RetryUtility.&lt;&gt;c__DisplayClass1.&lt;ExecuteWithRetry&gt;b__0()
at Microsoft.Online.PasswordSynchronization.RetryUtility.ExecuteWithRetry[T](Func`1 operation, Func`1 shouldAbort, RetryPolicyHandler retryPolicy)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
— End of inner exception stack trace —
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.OpenConnection(IDrsConnection connection)
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.CreateConnection()
at Microsoft.Online.PasswordSynchronization.RecoveryTask.SynchronizeCredentialsToCloud()
at Microsoft.Online.PasswordSynchronization.PasswordSynchronizationTask.SynchronizeSecrets()
at Microsoft.Online.PasswordSynchronization.SynchronizationExecutionContext.SynchronizeDomain()
at Microsoft.Online.PasswordSynchronization.SynchronizationManager.SynchronizeDomain(SynchronizationExecutionContext syncExecutionContext)
.

xxxxxxx.com</Data>
</EventData>
</Event>

 

ِAfter a long time of troubleshooting and contacting Microsoft support here is what we got

Cause: Essential component required by the password sync engine was not installed; The generic version of “GetFunctionPointerForDelegate” only exists in .Net 4.5.1 and later

Resolution: Installing .net 4.5.2 and latest .net live updates.

 

How to monitor availability of your Azure datacenter

It is one of those days when you face connectivity issue with your Azure Virtual machines,  and you don’t know what is the problem

Now you can use the URL : http://azure.microsoft.com/en-in/status/#current

As per the below , you will find :

1- Refresh interval

2- Types of information (Good – Warning – Error – ………)

3- Location of the Datacenter (West Europe – East US – ……………)

4- The service (Storage – VM – …………..)

1

 

 

If you want to check the incident history , just go to History tab

You can check the old incidents related to any service , any data center or any time interval

2

 

Configure a Static Internal IP Address for an Azure VM

By default every VM will automatically receive an internal IP address from a range that you specify

But in some case you need to specify a static IP for your VM like (DNS , Domain controller , …….)

To assign a static IP to the VM , you have first to Install Azure Powershell

Before you specify a static IP address from your address pool, you may want to verify that the IP address has not been already assigned. In the example below, we’re checking to see whether the IP address 192.168.4.7 is available in the TestVNet virtual network.

Test-AzureStaticVNetIP –VNetName TestVNet –IPAddress 192.168.4.7

If you have already created the VM and just want to assign the the static IP

If you already set an IP address for the VM and you want to change it to a different IP address, you’ll need to remove the existing static IP address before running these cmdlets. See the instructions below to remove a static IP.

Get-AzureVM -ServiceName StaticDemo -Name VM2 | Set-AzureStaticVNetIP -IPAddress 192.168.4.7 | Update-AzureVM

If the VM is not yet created and you need to created with the static IP

New-AzureVMConfig -Name $vmname -ImageName $img –InstanceSize Small | Set-AzureSubnet –SubnetNames $sub | Set-AzureStaticVNetIP -IPAddress 192.168.4.7 | New-AzureVM –ServiceName $vmsvc1 –VNetName TestVNet

No how can your remove a static IP from a VM

When you remove a static IP address from a VM, the VM will automatically receive a new DIP after the VM restarts as part of the update process. In the example below, we remove the static IP from VM2, which is located in cloud service StaticDemo.

Get-AzureVM -ServiceName StaticDemo -Name VM2 | Remove-AzureStaticVNetIP | Update-AzureVM

Source: Azure MSDN

%d bloggers like this: