Skip to content

Commit

Permalink
Merge branch 'preview' into preview_localEH
Browse files Browse the repository at this point in the history
  • Loading branch information
markcowl committed Aug 20, 2018
2 parents 2f54e45 + 5c259d3 commit 2a90e62
Show file tree
Hide file tree
Showing 177 changed files with 27,102 additions and 17,226 deletions.
1 change: 1 addition & 0 deletions src/ResourceManager/Compute/Commands.Compute/ChangeLog.md
Expand Up @@ -20,6 +20,7 @@
-->
## Current Release
* Fixed issue with default resource groups not being set.
* Fix AEM Extension cmdlets for other environments, for example Azure China

## Version 5.5.0
* Updated to the latest version of the Azure ClientRuntime.
Expand Down
Expand Up @@ -46,16 +46,18 @@ internal class AEMHelper
private Dictionary<string, string> _StorageKeyCache = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
private StorageManagementClient _StorageClient;
private IAzureSubscription _Subscription;
private string _StorageEndpoint;

public AEMHelper(Action<ErrorRecord> errorAction, Action<string> verboseAction, Action<string> warningAction,
PSHostUserInterface ui, StorageManagementClient storageClient, IAzureSubscription subscription)
PSHostUserInterface ui, StorageManagementClient storageClient, IAzureSubscription subscription, String storageEndpoint)
{
this._ErrorAction = errorAction;
this._VerboseAction = verboseAction;
this._WarningAction = warningAction;
this._UI = ui;
this._StorageClient = storageClient;
this._Subscription = subscription;
this._StorageEndpoint = storageEndpoint;
}

internal string GetStorageAccountFromUri(string uri)
Expand Down Expand Up @@ -140,7 +142,7 @@ internal bool IsPremiumStorageAccount(string accountName)
StorageCredentialsFactory storageCredentialsFactory = new StorageCredentialsFactory(resGroupName,
this._StorageClient, this._Subscription);
StorageCredentials sc = storageCredentialsFactory.Create(blobUri);
CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(sc, true);
CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(sc, this._StorageEndpoint, true);
CloudBlobClient blobClient = cloudStorageAccount.CreateCloudBlobClient();
CloudBlobContainer blobContainer = blobClient.GetContainerReference(blobUri.BlobContainerName);
var cloudBlob = blobContainer.GetPageBlobReference(blobUri.BlobName);
Expand Down Expand Up @@ -729,7 +731,7 @@ internal ServiceProperties GetStorageAnalytics(string storageAccountName)
{
var key = this.GetAzureStorageKeyFromCache(storageAccountName);
var credentials = new StorageCredentials(storageAccountName, key);
var cloudStorageAccount = new CloudStorageAccount(credentials, true);
var cloudStorageAccount = new CloudStorageAccount(credentials, this._StorageEndpoint, true);
return cloudStorageAccount.CreateCloudBlobClient().GetServicePropertiesAsync().ConfigureAwait(false).GetAwaiter().GetResult();
}

Expand Down
Expand Up @@ -74,7 +74,8 @@ public override void ExecuteCmdlet()
this._Helper = new AEMHelper((err) => this.WriteError(err), (msg) => this.WriteVerbose(msg), (msg) => this.WriteWarning(msg),
this.CommandRuntime.Host.UI,
AzureSession.Instance.ClientFactory.CreateArmClient<StorageManagementClient>(DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
this.DefaultContext.Subscription);
this.DefaultContext.Subscription,
this.DefaultContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.StorageEndpointSuffix));

base.ExecuteCmdlet();

Expand Down
Expand Up @@ -38,6 +38,7 @@ namespace Microsoft.Azure.Commands.Compute
[OutputType(typeof(PSAzureOperationResponse))]
public class SetAzureRmVMAEMExtension : VirtualMachineExtensionBaseCmdlet
{
private string _StorageEndpoint;
private AEMHelper _Helper = null;

[Parameter(
Expand Down Expand Up @@ -91,8 +92,13 @@ public SetAzureRmVMAEMExtension()

public override void ExecuteCmdlet()
{
this._StorageEndpoint = this.DefaultContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.StorageEndpointSuffix);
this._Helper = new AEMHelper((err) => this.WriteError(err), (msg) => this.WriteVerbose(msg), (msg) => this.WriteWarning(msg),
this.CommandRuntime.Host.UI, AzureSession.Instance.ClientFactory.CreateArmClient<StorageManagementClient>(DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.ResourceManager), this.DefaultContext.Subscription);
this.CommandRuntime.Host.UI,
AzureSession.Instance.ClientFactory.CreateArmClient<StorageManagementClient>(
DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
this.DefaultContext.Subscription,
this._StorageEndpoint);

base.ExecuteCmdlet();

Expand Down Expand Up @@ -521,7 +527,7 @@ private void SetStorageAnalytics(string storageAccountName)

var key = this._Helper.GetAzureStorageKeyFromCache(storageAccountName);
var credentials = new StorageCredentials(storageAccountName, key);
var cloudStorageAccount = new CloudStorageAccount(credentials, true);
var cloudStorageAccount = new CloudStorageAccount(credentials, this._StorageEndpoint, true);

cloudStorageAccount.CreateCloudBlobClient().SetServicePropertiesAsync(props)
.ConfigureAwait(false).GetAwaiter().GetResult();
Expand Down
Expand Up @@ -89,7 +89,8 @@ public override void ExecuteCmdlet()
this._Helper = new AEMHelper((err) => this.WriteError(err), (msg) => this.WriteVerbose(msg), (msg) => this.WriteWarning(msg),
this.CommandRuntime.Host.UI,
AzureSession.Instance.ClientFactory.CreateArmClient<StorageManagementClient>(DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.ResourceManager),
this.DefaultContext.Subscription);
this.DefaultContext.Subscription,
this.DefaultContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.StorageEndpointSuffix));

this._Helper.WriteVerbose("Starting TestAzureRmVMAEMExtension");

Expand Down
7 changes: 7 additions & 0 deletions src/ResourceManager/Compute/Compute.sln
Expand Up @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Storage", "..\..\S
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Management.Storage", "..\Storage\Commands.Management.Storage\Commands.Management.Storage.csproj", "{A50AB133-5C04-4A17-9054-F8343683EC23}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.KeyVault", "..\KeyVault\Commands.KeyVault\Commands.KeyVault.csproj", "{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,6 +53,10 @@ Global
{A50AB133-5C04-4A17-9054-F8343683EC23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A50AB133-5C04-4A17-9054-F8343683EC23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A50AB133-5C04-4A17-9054-F8343683EC23}.Release|Any CPU.Build.0 = Release|Any CPU
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -60,6 +66,7 @@ Global
{98CFD96B-A6BC-4F15-AE2C-603FC2B58981} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{08CF7DA7-0392-4A19-B79B-E1FF67CDB81A} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{A50AB133-5C04-4A17-9054-F8343683EC23} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {54E53EE0-76A1-4911-8FED-63555F09459F}
Expand Down
Expand Up @@ -27,11 +27,11 @@ The **Set-AzureRmPublicIpAddress** cmdlet sets the goal state for a public IP ad
```
PS C:\> $publicIp = Get-AzureRmPublicIpAddress -Name $publicIpName -ResourceGroupName $rgName
PS C:\> $publicIp.PublicIpAllocationMethod = "Dynamic"
PS C:\> $publicIp.PublicIpAllocationMethod = "Static"
PS C:\> Set-AzureRmPublicIpAddress -PublicIpAddress $publicIp
PS C:\> $publicIp = Get-AzureRmPublicIpAddress -Name $publicIpName -ResourceGroupName $rgName
PS C:\> Get-AzureRmPublicIpAddress -Name $publicIpName -ResourceGroupName $rgName
```

First command gets the public IP address resource with name $publicIPName in the resource
Expand Down
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* Fix failure in Update-AzureRmPowerBIEmbeddedCapacity when trying to scale paused capacity
* Fixed issue with default resource groups not being set.

## Version 4.1.8
Expand Down
Expand Up @@ -24,7 +24,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.PowerBIDedicated" Version="0.9.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.PowerBIDedicated" Version="0.10.0-preview" />
<PackageReference Include="Moq" Version="4.2.1510.2205" />
</ItemGroup>

Expand Down
Expand Up @@ -44,8 +44,8 @@
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.Management.PowerBIDedicated, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.PowerBIDedicated.0.9.0-preview\lib\net452\Microsoft.Azure.Management.PowerBIDedicated.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.PowerBIDedicated">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.PowerBIDedicated.0.10.0-preview\lib\net452\Microsoft.Azure.Management.PowerBIDedicated.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
Expand Up @@ -28,21 +28,21 @@ public PowerBITests(Xunit.Abstractions.ITestOutputHelper output)
XunitTracingInterceptor.AddToContext(_logger);
}

[Fact(Skip = "Now using Internal.Resources.ResourceManagerClient, needs re-recorded")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestPBIECapacity()
{
NewInstance.RunPsTest(_logger, "Test-PowerBIEmbeddedCapacity");
}

[Fact(Skip = "Now using Internal.Resources.ResourceManagerClient, needs re-recorded")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestPBIECapacityScale()
{
NewInstance.RunPsTest(_logger, "Test-PowerBIEmbeddedCapacityScale");
}

[Fact(Skip = "Now using Internal.Resources.ResourceManagerClient, needs re-recorded")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNegativePBIECapacity()
{
Expand Down
Expand Up @@ -157,6 +157,10 @@ function Test-PowerBIEmbeddedCapacityScale
$capacityUpdated = Update-AzureRmPowerBIEmbeddedCapacity -Name $capacityName -Sku A2 -PassThru
Assert-AreEqual A2 $capacityUpdated.Sku

$capacityGetItem = Suspend-AzureRmPowerBIEmbeddedCapacity -ResourceGroupName $resourceGroupName -Name $capacityName -PassThru
# this is to ensure backward compatibility compatibility. The servie side would make change to differenciate state and provisioningState in future
Assert-True {$capacityGetItem.State -like "Paused"}

# Scale down A2 -> A1
$capacityUpdated = Update-AzureRmPowerBIEmbeddedCapacity -Name $capacityName -Sku A1 -PassThru
Assert-AreEqual A1 $capacityUpdated.Sku
Expand Down

0 comments on commit 2a90e62

Please sign in to comment.