Skip to content

Commit c52c604

Browse files
committed
resolve merge conflict
2 parents b1bbbb4 + afe4928 commit c52c604

File tree

757 files changed

+688995
-223318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

757 files changed

+688995
-223318
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
*.cs text eol=crlf
66
*.csproj text eol=crlf
77
*.ps1 text eol=crlf
8+
*.psd1 text eol=crlf
9+
*.psm1 text eol=crlf
10+
*.ps1xml text eol=crlf
811
build.proj text eol=crlf

TestMappings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,8 @@
173173
],
174174
"src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering.Test/": [
175175
".\\src\\ResourceManager\\MarketplaceOrdering\\Commands.MarketplaceOrdering.Test\\bin\\Debug\\Microsoft.Azure.Commands.MarketplaceOrdering.Test.dll"
176-
]
176+
],
177+
"src/ResourceManager/ApplicationInsights/": [
178+
".\\src\\ResourceManager\\ApplicationInsights\\Commands.ApplicationInsights.Test\\bin\\Debug\\Microsoft.Azure.Commands.ApplicationInsights.Test.dll"
179+
]
177180
}

setup/azurecmdfiles.wxi

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,72 @@
238238
<File Id="fil087657CB273F57C2B1D1A0D6C9DB2AAC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApiManagement\System.Spatial.dll" />
239239
</Component>
240240
</Directory>
241+
<Directory Id="dir20CB1A80CDFE9122E56ECAC691BE1645" Name="AzureRM.ApplicationInsights">
242+
<Component Id="cmp8C55810390E8F28E93B56F1884AD9454" Guid="*">
243+
<File Id="fil483CB450C649EBE923E613AF89DAB598" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\AzureRM.ApplicationInsights.psd1" />
244+
</Component>
245+
<Component Id="cmp538CC349E2758CF89712A01813EA0CA3" Guid="*">
246+
<File Id="fil1AD1B0AA7DC2E05AB964F14720ACB712" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Hyak.Common.dll" />
247+
</Component>
248+
<Component Id="cmp3BBCDF40370DA61F3F23DE95A63CC1A6" Guid="*">
249+
<File Id="fil22517B41198F1C94A49420033FC09F4A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.ApplicationInsights.dll" />
250+
</Component>
251+
<Component Id="cmpD7B7A9AB0C63378189A25C68D41EB41D" Guid="*">
252+
<File Id="fil5D2991EE25C0DC7E484A6F630A28B91F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.Commands.ApplicationInsights.dll" />
253+
</Component>
254+
<Component Id="cmp0E8147BB73347D552FF52ECA0972975C" Guid="*">
255+
<File Id="fil47302078A2D62752E378902D6BBA2DFC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.Commands.ApplicationInsights.format.ps1xml" />
256+
</Component>
257+
<Component Id="cmp6DE0337272AFC21124E05BCF340D56A8" Guid="*">
258+
<File Id="filEC4AEA6515E204149E75ED6E47F74FB9" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.Commands.Common.Authentication.Abstractions.dll" />
259+
</Component>
260+
<Component Id="cmpE077F87641DA6604C4631E209FC5B53A" Guid="*">
261+
<File Id="fil99BE332281DE043089AEFFCEEEE0A187" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.Commands.ResourceManager.Common.dll" />
262+
</Component>
263+
<Component Id="cmpEF3BFBC0AB7F09F05FE0B42D8350C0A8" Guid="*">
264+
<File Id="fil1C50DB56A144086B8068B1259C4BDE05" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.Common.dll" />
265+
</Component>
266+
<Component Id="cmpB79B8CCA3B4055F11395C074926DD665" Guid="*">
267+
<File Id="fil0B23F0AC610CE872320A7B484E9F9F3E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.Common.NetFramework.dll" />
268+
</Component>
269+
<Component Id="cmp244B8C00CA11DDD6D774BABB4A6691DB" Guid="*">
270+
<File Id="filED251E8EDF9D35AD165BB2BF26B13D7E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.KeyVault.Core.dll" />
271+
</Component>
272+
<Component Id="cmpEC5F27A85A9CB1EA1797332909D3C9BC" Guid="*">
273+
<File Id="fil0FB8E91175929B1923DE5995253C5A55" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Azure.Management.ApplicationInsights.dll" />
274+
</Component>
275+
<Component Id="cmp12C1DCBBB450C51FB5769C66449C0107" Guid="*">
276+
<File Id="fil2E26550001D62A1D6520AD14EC43E005" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Rest.ClientRuntime.Azure.dll" />
277+
</Component>
278+
<Component Id="cmpEEAC1F092FA3CC4B0E745EA9CC1116FB" Guid="*">
279+
<File Id="fil6EEB3159CEF1627414B82EE444116F49" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Rest.ClientRuntime.dll" />
280+
</Component>
281+
<Component Id="cmpBBE5EE811E5F1092261A0C11A79744E5" Guid="*">
282+
<File Id="fil1DB5F2B006C062F6F3117CD7BA2E0760" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Threading.Tasks.dll" />
283+
</Component>
284+
<Component Id="cmp1D66A9A3184533BA9C77F41D099F3F8A" Guid="*">
285+
<File Id="fil4F8E6C53EA6470923964F0B0AD111E5F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Threading.Tasks.Extensions.Desktop.dll" />
286+
</Component>
287+
<Component Id="cmp20A0C14656B9EDA21264A5C92CDBCA37" Guid="*">
288+
<File Id="fil44166CBDDC7A38DC94CB3BEA75D81158" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.Threading.Tasks.Extensions.dll" />
289+
</Component>
290+
<Component Id="cmp5C1BE524EFCCE40D37143AE4971EDB52" Guid="*">
291+
<File Id="filD3017A04DA3314F7C7DF89A9B3E6CC02" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.WindowsAzure.Commands.Common.dll" />
292+
</Component>
293+
<Component Id="cmp97880E3DE25F3C71B3DBEB6022AB34CD" Guid="*">
294+
<File Id="filC7B0201D7B50848FB7D7A7EB7FA16B52" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Microsoft.WindowsAzure.Management.dll" />
295+
</Component>
296+
<Component Id="cmp805E3AD4F18ED09177B0B3C5B23F68D4" Guid="*">
297+
<File Id="fil35B833A12B1C70E2397F3AF84B8B94B2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\Newtonsoft.Json.dll" />
298+
</Component>
299+
<Component Id="cmpF4CA603DC2DDF67FEA95003D704A42A1" Guid="*">
300+
<File Id="filF8D4DADB58D8CA61127034A03E0A0F7B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\System.Net.Http.Extensions.dll" />
301+
</Component>
302+
<Component Id="cmp1EBF9ED596A8BC170720F787104379F2" Guid="*">
303+
<File Id="fil76F711BFF53DE0F0E56699C0D8E90C27" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ApplicationInsights\System.Net.Http.Primitives.dll" />
304+
</Component>
305+
</Directory>
306+
241307
<Directory Id="dirC9565C26936EFCC1E289F1FDC5331E16" Name="AzureRM.Automation">
242308
<Component Id="cmpE48A93B0493B28E942E948BA2D821B91" Guid="*">
243309
<File Id="fil6502A76962642CDBF1F41647817A0DF2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Automation\AzureRM.Automation.psd1" />
@@ -5941,6 +6007,27 @@
59416007
<ComponentRef Id="cmp905F9DF7496ED79C29FFDF87BA6CC145" />
59426008
<ComponentRef Id="cmpA341B5B54A0B03448E139EDB9A586B96" />
59436009
<ComponentRef Id="cmpCACCECAB9F530A76B2AD3660C5BF8E74" />
6010+
<ComponentRef Id="cmp8C55810390E8F28E93B56F1884AD9454" />
6011+
<ComponentRef Id="cmp538CC349E2758CF89712A01813EA0CA3" />
6012+
<ComponentRef Id="cmp3BBCDF40370DA61F3F23DE95A63CC1A6" />
6013+
<ComponentRef Id="cmpD7B7A9AB0C63378189A25C68D41EB41D" />
6014+
<ComponentRef Id="cmp0E8147BB73347D552FF52ECA0972975C" />
6015+
<ComponentRef Id="cmp6DE0337272AFC21124E05BCF340D56A8" />
6016+
<ComponentRef Id="cmpE077F87641DA6604C4631E209FC5B53A" />
6017+
<ComponentRef Id="cmpEF3BFBC0AB7F09F05FE0B42D8350C0A8" />
6018+
<ComponentRef Id="cmpB79B8CCA3B4055F11395C074926DD665" />
6019+
<ComponentRef Id="cmp244B8C00CA11DDD6D774BABB4A6691DB" />
6020+
<ComponentRef Id="cmpEC5F27A85A9CB1EA1797332909D3C9BC" />
6021+
<ComponentRef Id="cmp12C1DCBBB450C51FB5769C66449C0107" />
6022+
<ComponentRef Id="cmpEEAC1F092FA3CC4B0E745EA9CC1116FB" />
6023+
<ComponentRef Id="cmpBBE5EE811E5F1092261A0C11A79744E5" />
6024+
<ComponentRef Id="cmp1D66A9A3184533BA9C77F41D099F3F8A" />
6025+
<ComponentRef Id="cmp20A0C14656B9EDA21264A5C92CDBCA37" />
6026+
<ComponentRef Id="cmp5C1BE524EFCCE40D37143AE4971EDB52" />
6027+
<ComponentRef Id="cmp97880E3DE25F3C71B3DBEB6022AB34CD" />
6028+
<ComponentRef Id="cmp805E3AD4F18ED09177B0B3C5B23F68D4" />
6029+
<ComponentRef Id="cmpF4CA603DC2DDF67FEA95003D704A42A1" />
6030+
<ComponentRef Id="cmp1EBF9ED596A8BC170720F787104379F2" />
59446031
<ComponentRef Id="cmpE48A93B0493B28E942E948BA2D821B91" />
59456032
<ComponentRef Id="cmpAAE3D8C3D799370A38C04E499C10CEAD" />
59466033
<ComponentRef Id="cmp41036154EE783BC3DEFB1A4C67DC0771" />

src/ResourceManager/AnalysisServices/AzureRM.AnalysisServices.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
# Module manifest for module 'PSGet_AzureRM.AnalysisServices'
33
#
44
# Generated by: Microsoft Corporation
@@ -27,7 +27,7 @@ Author = 'Microsoft Corporation'
2727
CompanyName = 'Microsoft Corporation'
2828

2929
# Copyright statement for this module
30-
Copyright = '© Microsoft Corporation. All rights reserved.'
30+
Copyright = '© Microsoft Corporation. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
3333
Description = 'Microsoft Azure PowerShell - Analysis Services'

src/ResourceManager/AnalysisServices/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Fixed Synchronize-AzureAsInstance command to work with new AsAzure REST API for sync
2122

2223
## Version 0.4.7
2324

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands/Synchronize-AzureASInstance.cs

Lines changed: 62 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ public override void ExecuteCmdlet()
142142
AsAzureClientSession.Instance.Login(context);
143143
WriteProgress(new ProgressRecord(0, "Sync-AzureAnalysisServicesInstance.", string.Format("Authenticating user for '{0}' environment.", context.Environment.Name)));
144144
var clusterResolveResult = ClusterResolve(context, serverName);
145-
if (!clusterResolveResult.CoreServerName.Equals(serverName) || !clusterResolveResult.CoreServerName.EndsWith(":rw"))
145+
var virtualServerName = clusterResolveResult.CoreServerName.Split(":".ToCharArray())[0];
146+
if (!serverName.Equals(virtualServerName) && !clusterResolveResult.CoreServerName.EndsWith(":rw"))
146147
{
147148
throw new SynchronizationFailedException("Sync request can only be sent to the management endpoint");
148149
}
@@ -245,6 +246,7 @@ protected override void InitializeQosEvent()
245246
{
246247
// No data collection for this commandlet
247248
}
249+
248250
protected override string DataCollectionWarning
249251
{
250252
get
@@ -275,8 +277,7 @@ private async Task<ScaleOutServerDatabaseSyncDetails> SynchronizeDatabaseAsync(
275277
{
276278
try
277279
{
278-
// pollingUrlAndRetryAfter = await PostSyncRequestAsync(context, syncBaseUri, databaseName, accessToken);
279-
var synchronize = string.Format((string)context.Environment.Endpoints[AsAzureEnvironment.AsRolloutEndpoints.SyncEndpoint], this.clusterResolveResult.CoreServerName, databaseName);
280+
var synchronize = string.Format((string)context.Environment.Endpoints[AsAzureEnvironment.AsRolloutEndpoints.SyncEndpoint], this.serverName, databaseName);
280281
this.AsAzureHttpClient.resetHttpClient();
281282
using (var message = await AsAzureHttpClient.CallPostAsync(
282283
syncBaseUri,
@@ -381,70 +382,81 @@ private async Task<ScaleOutServerDatabaseSyncResult> PollSyncStatusWithRetryAsyn
381382
{
382383
ScaleOutServerDatabaseSyncResult response = null;
383384
var syncCompleted = false;
384-
do
385+
var retryCount = 0;
386+
387+
while (!syncCompleted && retryCount < maxNumberOfAttempts)
385388
{
386-
var retryCount = 0;
387-
while (retryCount < maxNumberOfAttempts)
389+
// Wait for specified polling interval other than retries.
390+
if (retryCount == 0)
388391
{
389-
// Wait for specified polling interval other than retries.
390-
if (retryCount == 0)
391-
{
392-
// WriteInformation(new InformationRecord(string.Format("Synchronize database {0}. Attempt #{1}. Waiting for {2} seconds to get sync results...", databaseName, retryCount, pollingInterval.TotalSeconds), string.Empty));
393-
await Task.Delay(pollingInterval);
394-
}
395-
else
396-
{
397-
await Task.Delay(DefaultRetryIntervalForPolling);
398-
}
392+
await Task.Delay(pollingInterval);
393+
}
394+
else
395+
{
396+
await Task.Delay(DefaultRetryIntervalForPolling);
397+
}
399398

400-
this.AsAzureHttpClient.resetHttpClient();
401-
using (HttpResponseMessage message = await AsAzureHttpClient.CallGetAsync(
402-
pollingUrl,
403-
string.Empty,
404-
accessToken,
405-
correlationId))
399+
this.AsAzureHttpClient.resetHttpClient();
400+
using (HttpResponseMessage message = await AsAzureHttpClient.CallGetAsync(
401+
pollingUrl,
402+
string.Empty,
403+
accessToken,
404+
correlationId))
405+
{
406+
bool shouldRetry = false;
407+
if (message.IsSuccessStatusCode && message.Content != null)
406408
{
407-
syncCompleted = !message.StatusCode.Equals(HttpStatusCode.SeeOther);
408-
if (syncCompleted)
409+
var responseString = await message.Content.ReadAsStringAsync();
410+
response = JsonConvert.DeserializeObject<ScaleOutServerDatabaseSyncResult>(responseString);
411+
412+
if (response != null)
409413
{
410-
if (message.IsSuccessStatusCode)
414+
var state = response.SyncState;
415+
if (state == DatabaseSyncState.Completed || state == DatabaseSyncState.Failed)
411416
{
412-
var responseString = await message.Content.ReadAsStringAsync();
413-
response = JsonConvert.DeserializeObject<ScaleOutServerDatabaseSyncResult>(responseString);
414-
break;
417+
syncCompleted = true;
415418
}
416419
else
417420
{
418-
retryCount++;
419-
if (response == null)
420-
{
421-
response = new ScaleOutServerDatabaseSyncResult()
422-
{
423-
Database = databaseName,
424-
SyncState = DatabaseSyncState.Invalid
425-
};
426-
427-
response.Details = string.Format(
428-
"Http Error code: {0}. {1}",
429-
message.StatusCode.ToString(),
430-
message.Content != null ? await message.Content.ReadAsStringAsync() : string.Empty);
431-
}
432-
433-
if (message.StatusCode >= (HttpStatusCode)400 && message.StatusCode <= (HttpStatusCode)499)
434-
{
435-
break;
436-
}
421+
pollingUrl = message.Headers.Location ?? pollingUrl;
422+
pollingInterval = message.Headers.RetryAfter.Delta ?? pollingInterval;
437423
}
438424
}
439425
else
440426
{
441-
pollingUrl = message.Headers.Location;
442-
pollingInterval = message.Headers.RetryAfter.Delta ?? pollingInterval;
427+
shouldRetry = true;
443428
}
444429
}
430+
else
431+
{
432+
shouldRetry = true;
433+
}
434+
435+
if(shouldRetry)
436+
{
437+
retryCount++;
438+
response = new ScaleOutServerDatabaseSyncResult()
439+
{
440+
Database = databaseName,
441+
SyncState = DatabaseSyncState.Invalid
442+
};
443+
444+
response.Details = string.Format(
445+
"Http Error code: {0}. Message: {1}",
446+
message.StatusCode.ToString(),
447+
message.Content != null ? await message.Content.ReadAsStringAsync() : string.Empty);
448+
449+
if (message.StatusCode >= (HttpStatusCode)400 && message.StatusCode <= (HttpStatusCode)499)
450+
{
451+
break;
452+
}
453+
}
454+
else
455+
{
456+
retryCount = 0;
457+
}
445458
}
446459
}
447-
while (!syncCompleted);
448460

449461
return response;
450462
});

0 commit comments

Comments
 (0)