The following command is failing. Looks like a fault with Azure:
New-AzureLocalNetworkGateway -GatewayName "prod-sg-vnet3-ln" -IpAddress 104.215.251.69 -AddressSpace 10.5.8.0/22
Error messages switch between the following:
"New-AzureLocalNetworkGateway : BadRequest: LocalNetworkGateway prod-sg-vnet3-ln AddressSpace cannot be null"
"New-AzureLocalNetworkGateway : InternalError: The server encountered an internal error. Please retry the request."
Debug Output:
PS C:\Users\cgriffiths> New-AzureLocalNetworkGateway -GatewayName "prod-sg-vnet3-ln" -IpAddress '104.215.251.69' -AddressSpace '10.5.8.0/22' -debugDEBUG: 12:08:19 PM - NewAzureLocalNetworkGateway begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 12:08:20 PM - using account id '{adminuser}@{tenant}.onmicrosoft.com'...
DEBUG: [Common.Authentication]: Authenticating using Account: '{adminuser}@{tenant}.onmicrosoft.com', environment: 'AzureCloud', tenant: '{tenant_id}'
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: '{tenant_id}', Endpoint: 'https://login.microsoftonline.com/', ClientId: '{client_id}', ClientRedir
ect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthrity: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/{tenant_id}/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '{tenant_id}', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: '{client_id}', ClientR
edirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 2d51c6e9-dbfc-410c-85f0-6995d3e6dda4 - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/{tenant_id}/
Resource: https://management.core.windows.net/
ClientId: {client_id}
CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (4 items)
Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: - TokenCache: Deserialized 4 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 22/03/2016 2:08:20 AM: 2d51c6e9-dbfc-410c-85f0-6995d3e6dda4 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 2d51c6e9-dbfc-410c-85f0-6995d3e6dda4 - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 22/03/2016 2:08:20 AM: 2d51c6e9-dbfc-410c-85f0-6995d3e6dda4 - TokenCache: 59.8774905266667 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 2d51c6e9-dbfc-410c-85f0-6995d3e6dda4 - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 2d51c6e9-dbfc-410c-85f0-6995d3e6dda4 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
...
DEBUG: [Common.Authentication]: Received token with LoginType 'LiveId', Tenant: '{tenant_id}', UserId: '{adminuser}@{tenant}.onmicrosoft.com'
DEBUG: [Common.Authentication]: Authenticating using Account: '{adminuser}@{tenant}.onmicrosoft.com', environment: 'AzureCloud', tenant: '{tenant_id}'
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: '{tenant_id}', Endpoint: 'https://login.microsoftonline.com/', ClientId: '{client_id}', ClientRedir
ect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthrity: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/{tenant_id}/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '{tenant_id}', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: '{client_id}', ClientR
edirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 630cd974-2ae4-41f0-9802-9ddffec55522 - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/{tenant_id}/
Resource: https://management.core.windows.net/
ClientId: {client_id}
CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (4 items)
Authentication Target: User
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: - TokenCache: Deserialized 4 items to token cache.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 22/03/2016 2:08:20 AM: 630cd974-2ae4-41f0-9802-9ddffec55522 - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 630cd974-2ae4-41f0-9802-9ddffec55522 - TokenCache: An item matching the requested resource was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 22/03/2016 2:08:20 AM: 630cd974-2ae4-41f0-9802-9ddffec55522 - TokenCache: 59.8774905266667 minutes left until token in cache expires
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 630cd974-2ae4-41f0-9802-9ddffec55522 - TokenCache: A matching item (access token or refresh token or both) was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 22/03/2016 2:08:20 AM: 630cd974-2ae4-41f0-9802-9ddffec55522 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
DEBUG: [Common.Authentication]: Received token with LoginType 'LiveId', Tenant: '{tenant_id}', UserId: '{adminuser}@{tenant}.onmicrosoft.com'
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '03/22/2016 03:08:12 +00:00', MultipleResource? 'True', Tenant: '{tenant_id}', UserId: '{adminuser}@{tenant}.onmicrosoft.com'
DEBUG: [Common.Authentication]: User info for token DisplayId: '{adminuser}@{tenant}.onmicrosoft.com', Name: Chris Griffiths, IdProvider: 'https://sts.windows.net/{tenant_id}/', Uid: '30050ac8-8673-439
6-87ca-47cdfef2ddc6'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '03/22/2016 03:08:12 +00:00' Comparing to '03/22/2016 02:08:20 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:59:52.6494316'
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
POST
Absolute Uri:
https://management.core.windows.net/1a1dc07a-107f-49a8-8d20-71b6119dcce8/services/networking/localnetworkgateways?api-version=2015-04-01
Headers:
x-ms-version : 2015-04-01
Body:
<CreateLocalNetworkGatewayParameters xmlns="http://schemas.microsoft.com/windowsazure">
<AddressSpace xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<string>10.5.8.0/22</string>
</AddressSpace>
<GatewayName>prod-sg-vnet3-ln</GatewayName>
<IpAddress>104.215.251.69</IpAddress>
</CreateLocalNetworkGatewayParameters>
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
InternalServerError
Headers:
x-ms-servedbyregion : ussouth3
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-request-id : 6a7f79fe1ac088759674af1ebe3c6d3e
Cache-Control : no-cache
Date : Tue, 22 Mar 2016 02:08:43 GMT
Server : 1.0.6198.340,(rd_rdfe_stable.160317-1539),Microsoft-HTTPAPI/2.0
Body:
<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>InternalError</Code>
<Message>The server encountered an internal error. Please retry the request.</Message>
</Error>
New-AzureLocalNetworkGateway : InternalError: The server encountered an internal error. Please retry the request.
At line:1 char:1
+ New-AzureLocalNetworkGateway -GatewayName "prod-sg-vnet3-ln" -IpAddre ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureLocalNetworkGateway], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.NewAzureLocalNetworkGateway
DEBUG: 12:08:45 PM - NewAzureLocalNetworkGateway end processing.
DEBUG: 12:08:45 PM - NewAzureLocalNetworkGateway end processing.