Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AzureStack] Add help md files for new fabric admin cmdlet #7931

Closed
wants to merge 161 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
2a4acc9
support byos for Windows containers
Sep 13, 2018
cbb5a49
Add Azure storage accounts to slots + Tests
Sep 14, 2018
caf7a4a
Help for support bring your own storage for Windows containers
Sep 19, 2018
3648204
Updating change log
Sep 19, 2018
6eed2a0
merging from preview
Oct 1, 2018
e1b9d0c
removing AzureRM.psm1 from PR added by mistake
Oct 1, 2018
8143019
Updating slot tests
Oct 1, 2018
84d0ac4
Fixing Changelog entries
Oct 1, 2018
fb91e63
Fixing static analysis and design review comments
Oct 1, 2018
1e90be6
Solving merge conflicts and getting latest from preview
Oct 2, 2018
0f8fa79
Supporting Azure Storage Accounts (a.k.a. "bring your own storage")
Oct 9, 2018
9877475
Getting latest from preview
Oct 9, 2018
057cd15
Fixing Static Analysis issues
Oct 9, 2018
69100f9
Fixing Az alias
Oct 9, 2018
2112ad7
Adding comments to specify why the slot test is skipped for now
Oct 9, 2018
6cda3b4
Merge remote-tracking branch 'main/preview' into latest
Oct 10, 2018
d919632
fixing changelog and markup file
Oct 11, 2018
3be3982
Merge remote-tracking branch 'main/preview' into latest
Oct 12, 2018
951770d
Removing unused validation class and updating chengelog
Oct 12, 2018
f896cb4
undoing AzureRM.ps1 deletion
Oct 12, 2018
98b4298
re-ignoring /tools/AzureRM/AzureRM.psm1
Oct 12, 2018
034499e
Updated Aks #if statement.
MiYanni Oct 24, 2018
4d54d6f
Updated AnalysisServices.Dataplane #if statements.
MiYanni Oct 24, 2018
1ac3790
Updated Batch and ContainerInstance #if statements.
MiYanni Oct 24, 2018
049e9a3
Updated DataFactories and DataLakeAnalytics #if statements.
MiYanni Oct 24, 2018
f707802
Updated KeyVault #if statements.
MiYanni Oct 26, 2018
0c0196e
Updated Network, Profile, and RecoveryServices #if statements.
MiYanni Oct 27, 2018
4b009e2
Updated Resources and Sql #if statements.
MiYanni Oct 29, 2018
9ff3032
Updated Websites #if statements.
MiYanni Oct 30, 2018
d090e28
Copied the necessary ServiceManagement Compute files to ResourceManag…
MiYanni Oct 30, 2018
58ea9bb
Updated Stack #if statements.
MiYanni Oct 30, 2018
e43ceb4
Updated Storage #if statements.
MiYanni Oct 31, 2018
12c3504
Updated StaticAnalysis and Tools.Common #if statements.
MiYanni Oct 31, 2018
a53c620
Merge branch 'preview' into ifdef-tagging
MiYanni Oct 31, 2018
7c3bbb3
Fixed net452 build issue with minor variable renames.
MiYanni Oct 31, 2018
abe7123
Updated appropriate changelogs.
MiYanni Oct 31, 2018
017b0cd
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 5, 2018
c8337dd
Add code changes to support gallery images and ultraSSD in the simple
praries880 Nov 6, 2018
dfc8485
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
praries880 Nov 6, 2018
2d0e4d1
Add changelog entry
praries880 Nov 6, 2018
1682d70
Add and update cmdlet scripts
zyxyoshine Nov 6, 2018
3c3da94
Add and update tests
zyxyoshine Nov 6, 2018
8087870
Update SessionRecords
zyxyoshine Nov 6, 2018
f8dab80
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 6, 2018
ffcfa9b
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 6, 2018
61f6b14
Merge branch 'preview' into Oct2018FRP
zyxyoshine Nov 7, 2018
c544ff5
fix comments
zyxyoshine Nov 8, 2018
6b1188b
Add negative tests
zyxyoshine Nov 8, 2018
17cf1c1
Update SessionRecords
zyxyoshine Nov 8, 2018
c5b0167
Merge branch 'Oct2018FRP' of https://github.com/zyxyoshine/azure-powe…
zyxyoshine Nov 8, 2018
f40cee5
Checking Subdomain, Tabular Formatting
cle5eland Nov 8, 2018
04cc0e8
Added test execution
cle5eland Nov 8, 2018
25a05eb
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
praries880 Nov 8, 2018
25e326d
Add test changes and fix the code
praries880 Nov 8, 2018
bad9bc4
updated version and changelog
cle5eland Nov 8, 2018
a45900f
Fix ultraSSD tests for new-vm case
praries880 Nov 8, 2018
5ee5b96
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 8, 2018
de0f0ab
Add test file for new ultrassd test
praries880 Nov 8, 2018
d273b81
Update change log
zyxyoshine Nov 9, 2018
db73da9
Add ultrassd tests for vmss as well
praries880 Nov 9, 2018
04d1154
Add missing test file and update logic in image.cs
praries880 Nov 12, 2018
ce62142
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 12, 2018
134dc84
Removed storage depedency when inferring storageBlobContainerName
yaakoviyun Nov 14, 2018
186b73c
Removed storage depedency when inferring storageBlobContainerName
yaakoviyun Nov 14, 2018
1e953a1
Update changelog
yaakoviyun Nov 14, 2018
ba13e84
[Storage] Support hdfs
blueww Jun 25, 2018
6191d1a
Merge branch 'preview' into 6499_UltraSSD_SIG_Compute
Nov 14, 2018
8f2c890
Add tests for creating vm/vmss from SIG images
praries880 Nov 15, 2018
3ba73f1
Addressed Review -- Renamed methods, reverted version
cle5eland Nov 15, 2018
de2cabd
Merge branch '6499_UltraSSD_SIG_Compute' of https://github.com/prarie…
praries880 Nov 15, 2018
2b48162
[Stroage] breaking chagne notice
blueww Nov 15, 2018
eeaac2d
Add alias support for Get- AzsInfrastructureVolume cmdlet
zyxyoshine Nov 15, 2018
44b2140
Resolve issue https://github.com/Azure/azure-powershell/issues/6161
zhangyd2015 Nov 15, 2018
57e48bd
updated test record
cle5eland Nov 15, 2018
00329a9
Merge pull request #7843 from Azure/release-2018-11-20
Nov 15, 2018
3a18da0
Merge branch 'preview' into locationwarn
Nov 15, 2018
309181f
Merge branch 'preview' into preview
Nov 15, 2018
38daeb2
Merge branch 'preview' into Oct2018FRP
Nov 15, 2018
477ec6a
Merge pull request #7834 from wastoresh/locationwarn
Nov 15, 2018
622034f
Merge pull request #7762 from zyxyoshine/Oct2018FRP
Nov 16, 2018
c3e9508
Merge branch 'preview' into clthomps/iotcentral-backlog
Nov 16, 2018
0874d36
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
praries880 Nov 16, 2018
fe47e9a
Update help files
praries880 Nov 16, 2018
0ae470b
Took care of review comments
praries880 Nov 16, 2018
658a82a
Merge pull request #7853 from Azure/release-2018-11-20
Nov 16, 2018
511d57b
Merge branch 'preview' into 6499_UltraSSD_SIG_Compute
Nov 16, 2018
42220a6
Update ChangeLog.md
Nov 17, 2018
87ffded
Merge branch 'preview' into preview
Nov 17, 2018
07ea15e
Merge pull request #7821 from wastoresh/hdfs
Nov 17, 2018
a9d0f28
Merge pull request #7820 from yaakoviyun/preview
Nov 17, 2018
e320294
Update WindowsAzure.Storage to 9.3.0 and remove warning suppress, upd…
zhangyd2015 Nov 17, 2018
4f953cf
Merge branch 'preview' of https://github.com/zhangyd2015/azure-powers…
zhangyd2015 Nov 17, 2018
090403a
Merge pull request #7754 from praries880/6499_UltraSSD_SIG_Compute
Nov 19, 2018
96196cf
Merge branch 'preview' into clthomps/iotcentral-backlog
cormacpayne Nov 19, 2018
a6f5611
Add required assemblies System.IO.FileSystem.AccessControl.dll and Mi…
zhangyd2015 Nov 20, 2018
b80295b
Update Set-AzureRmSqlDatabase.md
FonsecaSergio Nov 20, 2018
f461c1c
Update Enable-AzureRmActivityLogAlert.md
SwayTex Nov 20, 2018
5830816
Merge pull request #7870 from FonsecaSergio/patch-2
cormacpayne Nov 20, 2018
d7dc565
Merge pull request #7871 from SwayTex/patch-1
Nov 20, 2018
ea79a0b
Merge pull request #7779 from cle5eland/clthomps/iotcentral-backlog
Nov 20, 2018
95f7837
Merge pull request #7839 from zhangyd2015/preview
MiYanni Nov 20, 2018
31d6ce4
Adding support to "Bring your own storage" for Windows Containers web…
Nov 21, 2018
646b92a
Enabling Slot test
Nov 21, 2018
bb3da11
add powershell module and test for alert repair SDK
sumitabarahmand Nov 1, 2018
f8249f0
[Storage] Support Static Web blob service configuration
blueww Nov 21, 2018
71a04b8
Modify documentation in help files.
bashahee Nov 21, 2018
245f9a3
Update AuditingHelpMessages.cs
bashahee Nov 21, 2018
1aef174
Reset all commits to 1
thomasyip-msft Nov 21, 2018
dfd03dc
Including test recording
Nov 21, 2018
ef54a33
Merge pull request #9 from Azure/preview
bashahee Nov 21, 2018
347643c
Update ChangeLog.md
bashahee Nov 21, 2018
04c30fd
Updating Azs.Fabric.Admin version to 0.3.0 resolving the conflicts
bganapa Nov 21, 2018
4ad9497
Merge pull request #7803 from thomasyip-msft/AutomationTests
MiYanni Nov 21, 2018
899f229
Merge pull request #7882 from bashahee/preview
cormacpayne Nov 21, 2018
72f99e8
[Storage] Fix the FileCopy
blueww Nov 21, 2018
e34cb51
added client side validations for AFS restore
siddharth7 Nov 23, 2018
aefa6df
[RS] Added deprecation message for Set-AzureRmRecoveryServicesVaultCo…
Nov 23, 2018
3c2f375
Update New-AzureRmOperationalInsightsWorkspace.md
theheatDK Nov 25, 2018
48ded99
Update New-AzureRmLoadBalancerOutboundRuleConfig.md
khannarhea Nov 26, 2018
f7b8705
Add a sample script to calculate storage account billable size.
EmmaZhu Oct 8, 2018
51a01e9
Refine the script to calculate billable blob size.
EmmaZhu Oct 19, 2018
f3fd2e7
Update New-AzureRmOperationalInsightsWorkspace.md
cormacpayne Nov 26, 2018
b1412aa
Merge pull request #7888 from MabOneSdk/users/sisi/afs-restore-update…
cormacpayne Nov 26, 2018
e9c7a65
Merge pull request #7893 from Azure/khannarhea-patch-1
cormacpayne Nov 26, 2018
ac17aaf
Merge pull request #7891 from theheatDK/patch-1
cormacpayne Nov 26, 2018
667dea5
Merge pull request #7889 from MabOneSdk/deprecate-vaultcontext
cormacpayne Nov 26, 2018
eef7401
making storage account and rg name optional for afs restore
siddharth7 Nov 22, 2018
2cb2c72
Merge pull request #7879 from wastoresh/staticweb
cormacpayne Nov 26, 2018
c24ba1f
Merge branch 'preview' into filcopycontext
cormacpayne Nov 26, 2018
707f5f9
Merge pull request #7877 from EmmaZhu/preview
cormacpayne Nov 26, 2018
60d1133
Merge pull request #7878 from wastoresh/filcopycontext
cormacpayne Nov 26, 2018
e9a0d4d
Bug 3231969: Minor typo in Invoke-AzureRmStorageSyncCompatibilityChec…
Nov 26, 2018
43a221f
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
Nov 26, 2018
2dc784e
Merge pull request #7906 from afedyashov/preview
cormacpayne Nov 26, 2018
f086c2f
Adding missing license headers and other review comments
Nov 26, 2018
dd84cdd
Merge pull request #7742 from sumitabarahmand/feature/repairswagger
Nov 27, 2018
4dadd10
Re-generated Help Files for new cmdlet.
Nov 27, 2018
8888950
Added module description back
Nov 27, 2018
8311a66
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 27, 2018
d93028d
Merge branch 'ifdef-tagging' of https://github.com/MiYanni/azure-powe…
MiYanni Nov 27, 2018
606520b
Fix the trailing slash of the domain of adls account
rahuldutta90 Nov 27, 2018
fe75838
Update Add-AzureRmApplicationGatewayHttpListenerCustomError.md
chayanbaner Nov 27, 2018
2f028fe
Update Microsoft.DataTransfer.Gateway.Encryption to 3.11.6898.1 to co…
zhangyd2015 Nov 27, 2018
65e3429
Fix code to use Get-AnalysisServicesLocation
Nov 27, 2018
3bfcbcb
Update New-AzureRmTag.md
DexterPOSH Nov 27, 2018
d3e979f
Update ChangeLog.md
cormacpayne Nov 27, 2018
76579c0
Merge pull request #7918 from minghan/miteh-fix-2018-11
cormacpayne Nov 27, 2018
911dc90
Merge pull request #7911 from deathly809/preview
cormacpayne Nov 27, 2018
7e02bcd
Merge pull request #7886 from MabOneSdk/users/sisi/afs-restore-update
cormacpayne Nov 27, 2018
7828a7e
Merge pull request #7922 from DexterPOSH/patch-1
cormacpayne Nov 27, 2018
5caee0b
Update WebAppAzureStoragePath.cs
cormacpayne Nov 27, 2018
32d0a3f
Merge pull request #7917 from chayanbaner/patch-1
cormacpayne Nov 27, 2018
821f8f2
Merge pull request #7919 from zhangyd2015/preview
cormacpayne Nov 27, 2018
0644e1f
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 27, 2018
83ebf6b
Addressing PR review comments.
MiYanni Nov 27, 2018
b0f1c49
Merge branch 'ifdef-tagging' of https://github.com/MiYanni/azure-powe…
MiYanni Nov 27, 2018
4d8e174
Merge pull request #7885 from vinisoto/nov_latest
cormacpayne Nov 27, 2018
55900e5
Merge branch 'preview' into ifdef-tagging
MiYanni Nov 27, 2018
40ab3ed
Merge pull request #7916 from Azure/task-fix-domaintrailingslash
cormacpayne Nov 27, 2018
3471c65
Merge pull request #7712 from MiYanni/ifdef-tagging
MiYanni Nov 28, 2018
aadced5
add help md file for new cmdlet
zyxyoshine Nov 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions src/ResourceManager/Aks/Commands.Aks/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* Minor changes for upcoming AzureRM to Az transition

## Version 0.0.7
* Update dependencies for type mapping issue
Expand Down
1 change: 1 addition & 0 deletions src/ResourceManager/Aks/Commands.Aks/Commands.Aks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,34 +178,27 @@ public override void ExecuteCmdlet()

private void PopBrowser(string uri)
{
#if NETSTANDARD

var browserProcess = new Process
{
StartInfo = new ProcessStartInfo
{
UseShellExecute = true,
Arguments = uri
}
StartInfo = new ProcessStartInfo { Arguments = uri }
};

var verboseMessage = Resources.StartingOnDefault;
// TODO: Remove IfDef
#if NETSTANDARD
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
WriteVerbose("Starting on OSX with open");
verboseMessage = "Starting on OSX with open";
browserProcess.StartInfo.FileName = "open";
browserProcess.Start();
return;
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
WriteVerbose("Starting on Unix with xdg-open");
verboseMessage = "Starting on Unix with xdg-open";
browserProcess.StartInfo.FileName = "xdg-open";
browserProcess.Start();
return;
}
#endif
WriteVerbose(Resources.StartingOnDefault);
Process.Start(uri);

WriteVerbose(verboseMessage);
browserProcess.Start();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected override IAzureContext DefaultContext
{
get
{
// Nothing to do with Azure Resource Managment context
// Nothing to do with Azure Resource Management context
return null;
}
}
Expand Down Expand Up @@ -141,8 +141,10 @@ protected override void TearDownHttpClientPipeline()

public override void ExecuteCmdlet()
{
AsAzureAccount azureAccount = new AsAzureAccount();
azureAccount.Type = ServicePrincipal ? AsAzureAccount.AccountType.ServicePrincipal : AsAzureAccount.AccountType.User;
var azureAccount = new AsAzureAccount
{
Type = ServicePrincipal ? AsAzureAccount.AccountType.ServicePrincipal : AsAzureAccount.AccountType.User
};

SecureString password = null;
if (Credential != null)
Expand Down Expand Up @@ -183,6 +185,7 @@ public override void ExecuteCmdlet()
{
AsAzureClientSession.Instance.SetCurrentContext(azureAccount, AsEnvironment);
}
// TODO: Remove IfDef
#if NETSTANDARD
var asAzureProfile = AsAzureClientSession.Instance.Login(currentProfile.Context, password, WriteWarning);
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

namespace Microsoft.Azure.Commands.AnalysisServices.Dataplane
{

/// <summary>
/// Cmdlet to export an Analysis Services server log to file
/// </summary>
Expand All @@ -35,7 +34,7 @@ namespace Microsoft.Azure.Commands.AnalysisServices.Dataplane
[OutputType(typeof(void))]
public class ExportAzureAnalysisServerLog : AzurePSCmdlet
{
private string serverName;
private string _serverName;

[Parameter(Mandatory = true, HelpMessage = "Name of the Azure Analysis Services which log will be fetched")]
[ValidateNotNullOrEmpty]
Expand All @@ -55,21 +54,21 @@ public class ExportAzureAnalysisServerLog : AzurePSCmdlet

public ExportAzureAnalysisServerLog()
{
this.AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient());
this.TokenCacheItemProvider = new TokenCacheItemProvider();
AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient());
TokenCacheItemProvider = new TokenCacheItemProvider();
}

public ExportAzureAnalysisServerLog(IAsAzureHttpClient AsAzureHttpClient, ITokenCacheItemProvider TokenCacheItemProvider)
public ExportAzureAnalysisServerLog(IAsAzureHttpClient asAzureHttpClient, ITokenCacheItemProvider tokenCacheItemProvider)
{
this.AsAzureHttpClient = AsAzureHttpClient;
this.TokenCacheItemProvider = TokenCacheItemProvider;
AsAzureHttpClient = asAzureHttpClient;
TokenCacheItemProvider = tokenCacheItemProvider;
}

protected override IAzureContext DefaultContext
{
get
{
// Nothing to do with Azure Resource Managment context
// Nothing to do with Azure Resource Management context
return null;
}
}
Expand All @@ -91,14 +90,14 @@ protected override void BeginProcessing()
throw new PSInvalidOperationException(string.Format(Resources.NotLoggedInMessage, ""));
}

serverName = Instance;
_serverName = Instance;
Uri uriResult;

// if the user specifies the FQN of the server, then extract the servername out of that.
// if the user specifies the FQN of the server, then extract the server name out of that.
// and set the current context
if (Uri.TryCreate(Instance, UriKind.Absolute, out uriResult) && uriResult.Scheme == "asazure")
{
serverName = uriResult.PathAndQuery.Trim('/');
_serverName = uriResult.PathAndQuery.Trim('/');
if (string.Compare(AsAzureClientSession.Instance.Profile.Context.Environment.Name, uriResult.DnsSafeHost, StringComparison.InvariantCultureIgnoreCase) != 0)
{
AsAzureClientSession.Instance.SetCurrentContext(
Expand All @@ -112,21 +111,18 @@ protected override void BeginProcessing()
if (currentContext != null
&& AsAzureClientSession.AsAzureRolloutEnvironmentMapping.ContainsKey(currentContext.Environment.Name))
{
throw new PSInvalidOperationException(string.Format(Resources.InvalidServerName, serverName));
throw new PSInvalidOperationException(string.Format(Resources.InvalidServerName, _serverName));
}
}

if (this.AsAzureHttpClient == null)
if (AsAzureHttpClient == null)
{
this.AsAzureHttpClient = new AsAzureHttpClient(() =>
{
return new HttpClient();
});
AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient());
}

if (this.TokenCacheItemProvider == null)
if (TokenCacheItemProvider == null)
{
this.TokenCacheItemProvider = new TokenCacheItemProvider();
TokenCacheItemProvider = new TokenCacheItemProvider();
}
}

Expand All @@ -140,48 +136,46 @@ public override void ExecuteCmdlet()
if (ShouldProcess(Instance, Resources.ExportingLogFromAnalysisServicesServer))
{
var context = AsAzureClientSession.Instance.Profile.Context;
#if NETSTANDARD
AsAzureClientSession.Instance.Login(context, null, null);
#else
AsAzureClientSession.Instance.Login(context, null);
#endif
string accessToken = this.TokenCacheItemProvider.GetTokenFromTokenCache(

var accessToken = TokenCacheItemProvider.GetTokenFromTokenCache(
AsAzureClientSession.TokenCache, context.Account.UniqueId);

Uri logfileBaseUri =
new Uri(string.Format("{0}{1}{2}", Uri.UriSchemeHttps, Uri.SchemeDelimiter, context.Environment.Name));
var logfileBaseUri = new Uri($"{Uri.UriSchemeHttps}{Uri.SchemeDelimiter}{context.Environment.Name}");

UriBuilder resolvedUriBuilder = new UriBuilder(logfileBaseUri);
resolvedUriBuilder.Host = ClusterResolve(logfileBaseUri, accessToken, serverName);
var resolvedUriBuilder = new UriBuilder(logfileBaseUri)
{
Host = ClusterResolve(logfileBaseUri, accessToken, _serverName)
};

var logfileEndpoint = string.Format(
(string) context.Environment.Endpoints[AsAzureEnvironment.AsRolloutEndpoints.LogfileEndpointFormat],
serverName);
_serverName);

this.AsAzureHttpClient.resetHttpClient();
using (HttpResponseMessage message = AsAzureHttpClient.CallGetAsync(
AsAzureHttpClient.resetHttpClient();
using (var message = AsAzureHttpClient.CallGetAsync(
resolvedUriBuilder.Uri,
logfileEndpoint,
accessToken).ConfigureAwait(false).GetAwaiter().GetResult())
{
message.EnsureSuccessStatusCode();
string actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.ExportingLogOverwriteWarning, this.OutputPath);
if (AzureSession.Instance.DataStore.FileExists(this.OutputPath) && !this.Force.IsPresent && !ShouldContinue(actionWarning, Resources.Confirm))
var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.ExportingLogOverwriteWarning, OutputPath);
if (AzureSession.Instance.DataStore.FileExists(OutputPath) && !Force.IsPresent && !ShouldContinue(actionWarning, Resources.Confirm))
{
return;
}
AzureSession.Instance.DataStore.WriteFile(this.OutputPath, message.Content.ReadAsStringAsync().Result);
AzureSession.Instance.DataStore.WriteFile(OutputPath, message.Content.ReadAsStringAsync().Result);
}
}
}

private string ClusterResolve(Uri clusterUri, string accessToken, string serverName)
{
var resolveEndpoint = "/webapi/clusterResolve";
const string resolveEndpoint = "/webapi/clusterResolve";
var content = new StringContent($"ServerName={serverName}");
content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/x-www-form-urlencoded");

using (HttpResponseMessage message = AsAzureHttpClient.CallPostAsync(
using (var message = AsAzureHttpClient.CallPostAsync(
clusterUri,
resolveEndpoint,
accessToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Microsoft.Azure.Commands.AnalysisServices.Dataplane
[OutputType(typeof(bool))]
public class RestartAzureAnalysisServer : AzurePSCmdlet
{
private string serverName;
private string _serverName;

[Parameter(Mandatory = true, HelpMessage = "Name of the Azure Analysis Services server to restart")]
[ValidateNotNullOrEmpty]
Expand All @@ -45,22 +45,22 @@ public class RestartAzureAnalysisServer : AzurePSCmdlet

public RestartAzureAnalysisServer()
{
this.AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient());
this.TokenCacheItemProvider = new TokenCacheItemProvider();
AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient());
TokenCacheItemProvider = new TokenCacheItemProvider();

}

public RestartAzureAnalysisServer(IAsAzureHttpClient AsAzureHttpClient, ITokenCacheItemProvider TokenCacheItemProvider)
public RestartAzureAnalysisServer(IAsAzureHttpClient asAzureHttpClient, ITokenCacheItemProvider tokenCacheItemProvider)
{
this.AsAzureHttpClient = AsAzureHttpClient;
this.TokenCacheItemProvider = TokenCacheItemProvider;
AsAzureHttpClient = asAzureHttpClient;
TokenCacheItemProvider = tokenCacheItemProvider;
}

protected override IAzureContext DefaultContext
{
get
{
// Nothing to do with Azure Resource Managment context
// Nothing to do with Azure Resource Management context
return null;
}
}
Expand All @@ -82,14 +82,14 @@ protected override void BeginProcessing()
throw new PSInvalidOperationException(string.Format(Resources.NotLoggedInMessage, ""));
}

serverName = Instance;
_serverName = Instance;
Uri uriResult;

// if the user specifies the FQN of the server, then extract the servername out of that.
// if the user specifies the FQN of the server, then extract the server name out of that.
// and set the current context
if (Uri.TryCreate(Instance, UriKind.Absolute, out uriResult) && uriResult.Scheme == "asazure")
{
serverName = uriResult.PathAndQuery.Trim('/');
_serverName = uriResult.PathAndQuery.Trim('/');
if (string.Compare(AsAzureClientSession.Instance.Profile.Context.Environment.Name, uriResult.DnsSafeHost, StringComparison.InvariantCultureIgnoreCase) != 0)
{
AsAzureClientSession.Instance.SetCurrentContext(
Expand All @@ -103,21 +103,18 @@ protected override void BeginProcessing()
if (currentContext != null
&& AsAzureClientSession.AsAzureRolloutEnvironmentMapping.ContainsKey(currentContext.Environment.Name))
{
throw new PSInvalidOperationException(string.Format(Resources.InvalidServerName, serverName));
throw new PSInvalidOperationException(string.Format(Resources.InvalidServerName, _serverName));
}
}

if (this.AsAzureHttpClient == null)
if (AsAzureHttpClient == null)
{
this.AsAzureHttpClient = new AsAzureHttpClient(() =>
{
return new HttpClient();
});
AsAzureHttpClient = new AsAzureHttpClient(() => new HttpClient());
}

if (this.TokenCacheItemProvider == null)
if (TokenCacheItemProvider == null)
{
this.TokenCacheItemProvider = new TokenCacheItemProvider();
TokenCacheItemProvider = new TokenCacheItemProvider();
}
}

Expand All @@ -131,18 +128,15 @@ public override void ExecuteCmdlet()
if (ShouldProcess(Instance, Resources.RestartingAnalysisServicesServer))
{
var context = AsAzureClientSession.Instance.Profile.Context;
#if NETSTANDARD
AsAzureClientSession.Instance.Login(context, null, null);
#else
AsAzureClientSession.Instance.Login(context, null);
#endif
string accessToken = this.TokenCacheItemProvider.GetTokenFromTokenCache(AsAzureClientSession.TokenCache, context.Account.UniqueId);

Uri restartBaseUri = new Uri(string.Format("{0}{1}{2}", Uri.UriSchemeHttps, Uri.SchemeDelimiter, context.Environment.Name));
var accessToken = TokenCacheItemProvider.GetTokenFromTokenCache(AsAzureClientSession.TokenCache, context.Account.UniqueId);

var restartBaseUri = new Uri($"{Uri.UriSchemeHttps}{Uri.SchemeDelimiter}{context.Environment.Name}");

var restartEndpoint = string.Format((string)context.Environment.Endpoints[AsAzureEnvironment.AsRolloutEndpoints.RestartEndpointFormat], serverName);
var restartEndpoint = string.Format((string)context.Environment.Endpoints[AsAzureEnvironment.AsRolloutEndpoints.RestartEndpointFormat], _serverName);

using (HttpResponseMessage message = AsAzureHttpClient.CallPostAsync(
using (var message = AsAzureHttpClient.CallPostAsync(
restartBaseUri,
restartEndpoint,
accessToken).Result)
Expand Down
Loading