Skip to content

Commit 127395f

Browse files
authored
Merge pull request Azure#4606 from markcowl/webandcompute
Web and Compute experiments
2 parents cb572aa + d9527e5 commit 127395f

29 files changed

+4731
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,5 @@ FakesAssemblies/
207207
/tools/*.dll
208208
*.GhostDoc.xml
209209
pingme.txt
210-
groupMapping*.json
210+
groupMapping*.json
211+
.vscode/

build.proj

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
Condition=" '$(Scope)' == 'ServiceManagement'"/>
6262
<CmdletSolutionsToBuild Include=".\src\Storage\Storage.sln"
6363
Condition=" '$(Scope)' == 'AzureStorage' "/>
64+
<ExperimentalCmdletSolutionsToBuild Include=".\experiments\Websites.Experiments\Microsoft.Azure.Commands.Websites.Experiments.sln"/>
6465
<SetupSln Include=".\setup\azurepowershell.sln" />
6566
<StaticAnalysis Include=".\tools\StaticAnalysis\StaticAnalysis.sln" />
6667
<LocalBuildTasks Include="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" />
@@ -140,8 +141,8 @@
140141
<NuGetRestoreConfigFile>$(MSBuildProjectDirectory)\restore.config</NuGetRestoreConfigFile>
141142
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
142143
<NuGetRestorePackageSetting>-PackagesDirectory $(LibraryNugetPackageFolder)</NuGetRestorePackageSetting>
144+
<NuGetExperimentalCmdletPackages>-PackagesDirectory ".\experiments\Websites.Experiments\packages" </NuGetExperimentalCmdletPackages>
143145
<NuGetLocalBuildTaskPackages>-PackagesDirectory $(LibraryToolsFolder)\BuildPackagesTask\packages</NuGetLocalBuildTaskPackages>
144-
145146
<PowerShellCommand Condition=" '$(PowerShellCommand)' == '' ">C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
146147
</PropertyGroup>
147148

@@ -171,6 +172,8 @@
171172
<!-- Restore packages for static analysis-->
172173
<Exec Command="$(NuGetCommand) restore %(StaticAnalysis.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
173174
ContinueOnError="false" />
175+
<Exec Command="$(NuGetCommand) restore %(ExperimentalCmdletSolutionsToBuild.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetExperimentalCmdletPackages)"
176+
ContinueOnError="false" />
174177
<!-- Restore packages for local build tasks-->
175178
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)"
176179
ContinueOnError="false" />
@@ -196,7 +199,17 @@
196199
Targets="Build"
197200
Properties="Configuration=$(Configuration);Platform=Any CPU"
198201
BuildInParallel="$(BuildInParallel)"
199-
ContinueOnError="false" />
202+
ContinueOnError="false" />
203+
204+
<MSBuild
205+
Projects="@(ExperimentalCmdletSolutionsToBuild)"
206+
Targets="Build"
207+
Properties="Configuration=$(Configuration);Platform=Any CPU"
208+
BuildInParallel="$(BuildInParallel)"
209+
ContinueOnError="false" />
210+
211+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; $(LibraryRoot)\experiments\Compute.Experiments\copy-dev.ps1 -Config $(Configuration) &quot;"
212+
ContinueOnError="ErrorAndContinue" />
200213

201214
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
202215
ContinueOnError="false"
@@ -322,7 +335,7 @@
322335
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) $(Scope) &quot;"/>
323336
<!-- Copying shortcut to be signed -->
324337
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1"
325-
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition= " '$(NetCore)' == 'false' "/>
338+
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition= " '$(NetCore)' == 'false' "/>
326339
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
327340
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition= " '$(NetCore)' == 'false' "/>
328341
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM.Netcore\AzureRM.Netcore.psd1"
@@ -397,6 +410,7 @@
397410
DestinationFolder="$(LibraryRoot)tools\AzureRM" Condition= " '$(NetCore)' == 'false' "/>
398411
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.Netcore.psd1"
399412
DestinationFolder="$(LibraryRoot)tools\AzureRM" Condition= " '$(NetCore)' == 'true' "/>
413+
400414
</Target>
401415

402416
<Target Name="CodeSignInstaller">
@@ -460,6 +474,9 @@
460474
<!-- Run checkin tests for each pull request -->
461475
<Target Name="Test" DependsOnTargets="BeforeRunTests">
462476
<Message Importance="high" Text="Running check in tests..." />
477+
<!-- Run unit tests for AppService experimental cmdlets -->
478+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Profile\AzureRM.Profile.psd1; Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Resources\AzureRM.Resources.psd1; Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Websites\AzureRM.Websites.psd1; Import-Module $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Websites.Experiments\AzureRM.Websites.Experiments.psd1; $(MSBuildProjectDirectory)\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Websites.Experiments\Run-UnitTests.ps1&quot;"
479+
ContinueOnError="false"/>
463480
<CallTarget Targets="InvokeXUnit"/>
464481
</Target>
465482

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Profile\AzureRM.Profile.psd1
2+
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Resources\AzureRM.Resources.psd1
3+
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\AzureRM.Network.psd1
4+
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Compute\AzureRM.Compute.psd1
5+
Import-Module .\..\..\experiments\Compute.Experiments\AzureRM.Compute.Experiments.psd1
6+
7+
# Login
8+
$credentials = Get-Content -Path "C:\Users\sergey\Desktop\php-test.json" | ConvertFrom-Json
9+
$clientSecret = ConvertTo-SecureString $credentials.clientSecret -AsPlainText -Force
10+
$pscredentials = New-Object System.Management.Automation.PSCredential($credentials.applicationId, $clientSecret)
11+
Login-AzureRmAccount -ServicePrincipal -Credential $pscredentials -TenantId $credentials.tenantId | Out-Null
12+
13+
$vmComputerPassword = $credentials.vmPassword;
14+
$vmComputerUser = $credentials.vmUser;
15+
$password = ConvertTo-SecureString $vmComputerPassword -AsPlainText -Force;
16+
$vmCredential = New-Object System.Management.Automation.PSCredential ($vmComputerUser, $password);
17+
18+
New-AzVm -Name MyVM -Credential $vmCredential -WhatIf
19+
20+
# $vm = New-AzVm
21+
# $vm = New-AzVm -Credential $vmCredential
22+
$vm = New-AzVm -Name MyVM -Credential $vmCredential
23+
24+
$vm
25+
26+
# clean-up
27+
Remove-AzureRmResourceGroup -ResourceId $vm.ResourceGroupId
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#
2+
# Module manifest for module 'AzureRM.Compute.Experiments'
3+
#
4+
# Generated by: Microsoft
5+
#
6+
# Generated on: 9/1/2017
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = ".\AzureRM.Compute.Experiments.psm1"
13+
14+
# Version number of this module.
15+
ModuleVersion = '1.0.7'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'b5a94030-df85-43fa-b581-54069f88428f'
22+
23+
# Author of this module
24+
Author = 'Microsoft'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Azure Compute experiments for VM creation'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '5.0'
37+
38+
# Name of the Windows PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the Windows PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
# DotNetFrameworkVersion = ''
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# CLRVersion = ''
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(
55+
@{ ModuleName = "AzureRM.Resources"; ModuleVersion = "4.3.1"; },
56+
@{ ModuleName = "AzureRM.Network"; ModuleVersion = "4.3.1"; },
57+
@{ ModuleName = "AzureRM.Compute"; ModuleVersion = "3.3.1"; }
58+
)
59+
60+
# Assemblies that must be loaded prior to importing this module
61+
# RequiredAssemblies = @()
62+
63+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
64+
# ScriptsToProcess = @()
65+
66+
# Type files (.ps1xml) to be loaded when importing this module
67+
# TypesToProcess = @()
68+
69+
# Format files (.ps1xml) to be loaded when importing this module
70+
# FormatsToProcess = @()
71+
72+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
73+
# NestedModules = @()
74+
75+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
76+
FunctionsToExport = 'New-AzVm'
77+
78+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
79+
# CmdletsToExport =
80+
81+
# Variables to export from this module
82+
VariablesToExport = '*'
83+
84+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
85+
AliasesToExport = @()
86+
87+
# DSC resources to export from this module
88+
# DscResourcesToExport = @()
89+
90+
# List of all modules packaged with this module
91+
# ModuleList = @()
92+
93+
# List of all files packaged with this module
94+
# FileList = @()
95+
96+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
97+
PrivateData = @{
98+
99+
PSData = @{
100+
101+
# Tags applied to this module. These help with module discovery in online galleries.
102+
# Tags = @()
103+
104+
# A URL to the license for this module.
105+
# LicenseUri = ''
106+
107+
# A URL to the main website for this project.
108+
# ProjectUri = ''
109+
110+
# A URL to an icon representing this module.
111+
# IconUri = ''
112+
113+
# ReleaseNotes of this module
114+
# ReleaseNotes = ''
115+
116+
} # End of PSData hashtable
117+
118+
} # End of PrivateData hashtable
119+
120+
# HelpInfo URI of this module
121+
# HelpInfoURI = ''
122+
123+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
124+
# DefaultCommandPrefix = ''
125+
126+
}

0 commit comments

Comments
 (0)