Skip to content

Commit 6694167

Browse files
authored
Merge pull request #23 from Azure/dev
Merge from the Azure-powershell/dev
2 parents 86790b8 + 2851023 commit 6694167

File tree

3,637 files changed

+2116973
-465868
lines changed

Some content is hidden

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

3,637 files changed

+2116973
-465868
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ This checklist is used to make sure that common guidelines for a pull request ar
2626

2727
### [Cmdlet Signature Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#cmdlet-signature-guidelines)
2828
- [ ] New cmdlets that make changes or have side effects should implement `ShouldProcess` and have `SupportShouldProcess=true` specified in the cmdlet attribute. You can find more information on `ShouldProcess` [here](https://gist.github.com/markcowl/338e16fe5c8bbf195aff9f8af0db585d#what-is-the-change).
29-
- [ ] Cmdlet specifies `OutputType` attribute if any output is produced - if the cmdlet produces no output, it should implement a `PassThrough` parameter.
29+
- [ ] Cmdlet specifies `OutputType` attribute if any output is produced - if the cmdlet produces no output, it should implement a `PassThru` parameter.
3030

3131
### [Cmdlet Parameter Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#cmdlet-parameter-guidelines)
3232
- [ ] Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
3333
- [ ] Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
34-
- [ ] Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.
34+
- [ ] Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

AzurePowershell.Test.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<XUnitTests Include=".\src\ResourceManager\Dns\Commands.Dns.Test\bin\Debug\Microsoft.Azure.Commands.Dns.Test.dll"/>
8686
<XUnitTests Include=".\src\ResourceManager\HDInsight\Commands.HDInsight.Test\bin\Debug\Commands.HDInsight.Test.dll"/>
8787
<XUnitTests Include=".\src\ResourceManager\Insights\Commands.Insights.Test\bin\Debug\Microsoft.Azure.Commands.Insights.Test.dll"/>
88+
<XUnitTests Include=".\src\ResourceManager\IotHub\Commands.IotHub.Test\bin\Debug\Microsoft.Azure.Commands.IotHub.Test.dll"/>
8889
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
8990
<XUnitTests Include=".\src\ResourceManager\LogicApp\Commands.LogicApp.Test\bin\Debug\Microsoft.Azure.Commands.LogicApp.Test.dll"/>
9091
<XUnitTests Include=".\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll"/>
@@ -106,6 +107,8 @@
106107
<XUnitTests Include=".\src\ResourceManager\UsageAggregates\Commands.UsageAggregates.Test\bin\Debug\Microsoft.Azure.Commands.UsageAggregates.Test.dll"/>
107108
<XUnitTests Include=".\src\ResourceManager\Websites\Commands.Websites.Test\bin\Debug\Microsoft.Azure.Commands.Websites.Test.dll"/>
108109
<XUnitTests Include=".\src\Common\Commands.Common.Authentication.Test\bin\Debug\Microsoft.Azure.Commands.Common.Authentication.Test.dll"/>
110+
<XUnitTests Include=".\src\ResourceManager\ServiceBus\Commands.ServiceBus.Test\bin\Debug\Microsoft.Azure.Commands.ServiceBus.Test.dll"/>
111+
<XUnitTests Include=".\src\ResourceManager\EventHub\Commands.EventHub.Test\bin\Debug\Microsoft.Azure.Commands.EventHubs.Test.dll"/>
109112
<XUnitTests Include="@(AsmXUnitTests)"/>
110113
</ItemGroup>
111114
<ItemGroup Condition=" '$(scope)' == 'ServiceManagement' ">
@@ -526,4 +529,3 @@
526529

527530

528531
</Project>
529-

ChangeLog.md

Lines changed: 454 additions & 1 deletion
Large diffs are not rendered by default.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ This repository contains a set of PowerShell cmdlets for developers and administ
2222
* App Service (Websites)
2323
* SQL Database
2424
* KeyVault
25+
* Data Lake Store
26+
* Data Lake Analytics
2527
* Operational Insights
2628
* Automation
2729
* Batch
@@ -36,7 +38,7 @@ This repository contains a set of PowerShell cmdlets for developers and administ
3638
* Scheduler
3739
* StorSimple
3840
* Redis Cache
39-
41+
4042
* Windows Azure Pack
4143
* Web Site: CRUD web site, deployment, configure and get log, start/stop/restart/show web site
4244
* Service Bus: CRD namespace
@@ -46,7 +48,7 @@ This repository contains a set of PowerShell cmdlets for developers and administ
4648
* Windows Azure Stack
4749
* Azure Stack Administration
4850
* Storage Service Management
49-
51+
5052

5153
For detail descriptions and examples of the cmdlets, type
5254
* ```help azure``` to get all the cmdlets.
@@ -72,7 +74,7 @@ For detail descriptions and examples of the cmdlets, type
7274
You can also find the standalone installers for all the versions at [Downloads](https://github.com/Azure/azure-powershell/releases)
7375

7476
### PowerShell Gallery
75-
1. Install [Windows Management Framework 5 with PowerShellGet cmdlets](https://www.powershellgallery.com/GettingStarted?section=Get%20Started)
77+
1. Install [Windows Management Framework 5 with PowerShellGet cmdlets](https://msdn.microsoft.com/en-us/powershell/gallery/psgallery/psgallery_gettingstarted)
7678
2. In an elevated PowerShell session, run ```Install-Module AzureRM```
7779
3. Run ```Install-AzureRm```
7880
4. To install RDFE cmdlets, run ```Install-Module Azure```
@@ -92,7 +94,7 @@ You can also find the standalone installers for all the versions at [Downloads](
9294

9395
In general, follow these steps to start using Microsoft Azure PowerShell
9496

95-
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](https://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/).
97+
* Get yourself authenticated with Microsoft Azure. For details, please check out [this article](https://docs.microsoft.com/powershell/azureps-cmdlets-docs/).
9698
* Option 1: Login with your Microsoft account or Organizational account directly from PowerShell. Microsoft Azure Active Directory authentication is used in this case. No management certificate is needed.
9799
* Starting from 1.0.0, you can use ```Add-AzureRmAccount -Credential``` to avoid the browser pop up for Organizational account.
98100
* To use RDFE cmdlets, use ```Add-AzureAccount```

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<Scope Condition=" $(Scope) == '' " >all</Scope>
4646
</PropertyGroup>
4747
<ItemGroup>
48-
<CmdletSolutionsToBuild Include=".\src\Storage\Storage.sln;.\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln"
48+
<CmdletSolutionsToBuild Include=".\src\Storage\Storage.sln;.\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln;"
4949
Exclude=".\src\ResourceManager\Intune\*.sln"
5050
Condition=" '$(Scope)' == 'all' "/>
5151
<CmdletSolutionsToBuild Include=".\src\ResourceManager\$(Scope)\*.sln"

documentation/Repo-Tasks-Module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
###### Usage:
44

55
1. Start .\tools\PS-VSPrompt.lnk (shortcut), this will start VS Dev Prompt in powershell
6-
2. Import-Module .\tools\Repo-Tasks.psd1
6+
2. Import-Module .\Repo-Tasks.psd1
77
1. During import, we allow to load additional functions that users might want to use it in their session.
88
2. If you have any userPreference.ps1 file under %userprofile%/psFiles directory, the module will try to load it by dot sourcing it.
99
2. It will also honor environment variable $env:psuserpreferences and load .ps1 files from the location that is pointed by $env:psuserpreferences

documentation/Using-Azure-TestFramework.md

Lines changed: 63 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,23 @@
2222
3. Get-Help <CommandName> to get help on individual commands.
2323

2424
## 2. Accquring TestFramework
25-
Current Version: [1.4.0-preview](https://www.nuget.org/packages/Microsoft.Rest.ClientRuntime.Azure.TestFramework/1.4.0-preview)
2625

27-
Nuget command to install current version
26+
TestFramework is available on NuGet at https://www.nuget.org/packages/Microsoft.Rest.ClientRuntime.Azure.TestFramework/ .
2827

29-
Install-Package Microsoft.Rest.ClientRuntime.Azure.TestFramework -v 1.4.0-preview -Pre
28+
Instructions to manually download it are available on NuGet. However TestFramework will be downloaded automatically as part of the build process, so manually downloading it should generally be unnecessary.
3029

3130
## 3. Setup prior to Record/Playback of tests
3231
In order to Record/Playback a test, you need to setup a connection string that consists various key/value pairs that provides information to the test environment.
3332

3433
#### 3.1 Environment Variables
34+
3535
> TEST_CSM_ORGID_AUTHENTICATION
3636
37-
> AZURE_TEST_MODE
37+
This is the connection string that determined how to connect to Azure. This includes both your authentiation and the Azure environment to connect to.
3838

39-
e.g.
40-
TEST_CSM_ORGID_AUTHENTICATION=SubscriptionId=<valid SubscriptionId>;ServicePrincipal=<ClientId>;ServicePrincipalSecret=<Client Secret>;AADTenant=<tenantId>;Environment=Prod;BaseUri=https://management.azure.com/;AADAuthEndpoint=https://login.windows.net/;GraphUri=https://graph.windows.net/
39+
> AZURE_TEST_MODE
4140
42-
AZURE_TEST_MODE=Record
41+
This specifies whether test framework will `Record` test sessions or `Playback` previously recorded test sessions.
4342

4443
#### 3.2. Supported Keys in connection string
4544
* ManagementCertificate
@@ -63,24 +62,27 @@ In order to Record/Playback a test, you need to setup a connection string that c
6362
* AADAuthEndpoint
6463
* GraphTokenAudienceUri
6564

66-
#### 3.3. Existing Defaults
67-
Environment.Prod
68-
AADAuthUri = "https://login.microsoftonline.com"
69-
GalleryUri = "https://gallery.azure.com/"
70-
GraphUri = "https://graph.windows.net/"
71-
IbizaPortalUri = "https://portal.azure.com/"
72-
RdfePortalUri = "http://go.microsoft.com/fwlink/?LinkId=254433"
73-
ResourceManagementUri = "https://management.azure.com/"
74-
ServiceManagementUri = "https://management.core.windows.net"
75-
AADTokenAudienceUri = "https://management.core.windows.net"
76-
GraphTokenAudienceUri = "https://graph.windows.net/"
77-
DataLakeStoreServiceUri = "https://azuredatalakestore.net"
78-
DataLakeAnalyticsJobAndCatalogServiceUri = "https://azuredatalakeanalytics.net"
79-
80-
----------
81-
82-
Environment.Dogfood
83-
AADAuthUri = "https://login.windows-ppe.net";
65+
#### 3.3. Environment Defaults
66+
67+
Setting `Environment` in the connection string will result in the following default values:
68+
69+
##### Environment = Prod
70+
71+
AADAuthUri = "https://login.microsoftonline.com"
72+
GalleryUri = "https://gallery.azure.com/"
73+
GraphUri = "https://graph.windows.net/"
74+
IbizaPortalUri = "https://portal.azure.com/"
75+
RdfePortalUri = "http://go.microsoft.com/fwlink/?LinkId=254433"
76+
ResourceManagementUri = "https://management.azure.com/"
77+
ServiceManagementUri = "https://management.core.windows.net"
78+
AADTokenAudienceUri = "https://management.core.windows.net"
79+
GraphTokenAudienceUri = "https://graph.windows.net/"
80+
DataLakeStoreServiceUri = "https://azuredatalakestore.net"
81+
DataLakeAnalyticsJobAndCatalogServiceUri = "https://azuredatalakeanalytics.net"
82+
83+
##### Environment = Dogfood
84+
85+
AADAuthUri = "https://login.windows-ppe.net";
8486
GalleryUri = "https://df.gallery.azure-test.net/";
8587
GraphUri = "https://graph.ppe.windows.net/";
8688
IbizaPortalUri = "http://df.onecloud.azure-test.net";
@@ -92,10 +94,9 @@ In order to Record/Playback a test, you need to setup a connection string that c
9294
DataLakeStoreServiceUri = "https://caboaccountdogfood.net";
9395
DataLakeAnalyticsJobAndCatalogServiceUri = "https://konaaccountdogfood.net";
9496

95-
----------
97+
##### Environment = Next
9698

97-
Environment.Next
98-
AADAuthUri = "https://login.windows-ppe.net"
99+
AADAuthUri = "https://login.windows-ppe.net"
99100
GalleryUri = "https://next.gallery.azure-test.net/"
100101
GraphUri = "https://graph.ppe.windows.net/"
101102
IbizaPortalUri = "http://next.onecloud.azure-test.net"
@@ -107,10 +108,9 @@ In order to Record/Playback a test, you need to setup a connection string that c
107108
DataLakeStoreServiceUri = "https://caboaccountdogfood.net"
108109
DataLakeAnalyticsJobAndCatalogServiceUri = "https://konaaccountdogfood.net"
109110

110-
----------
111+
##### Environment = Current
111112

112-
Environment.Current
113-
AADAuthUri = "https://login.windows-ppe.net"
113+
AADAuthUri = "https://login.windows-ppe.net"
114114
GalleryUri = "https://df.gallery.azure-test.net/"
115115
GraphUri = "https://graph.ppe.windows.net/"
116116
IbizaPortalUri = "http://df.onecloud.azure-test.net"
@@ -123,17 +123,43 @@ In order to Record/Playback a test, you need to setup a connection string that c
123123
DataLakeAnalyticsJoAbndCatalogServiceUri = "https://konaaccountdogfood.net"
124124

125125
## 4. Record/Playback Test
126+
126127
#### Playback Test
127-
1. The default mode is Playback mode, so no setting up of connection string is required.
128+
129+
The default mode is Playback mode, so no setting up of connection string is required.
128130

129131
#### Record Test with Interactive login using OrgId
130-
TEST_CSM_ORGID_AUTHENTICATION=SubsctiptionId={SubId};UserId={orgId};AADTenant={tenantId};Environment={env};HttpRecorderMode=Record;
132+
133+
This is no longer the preferred option because it only works when running on .NET Framework. When running on .NET Core you may get an error like `Interactive Login is supported only in NET45 projects`.
134+
135+
To use this option, set the following environment variable before starting Visual Studio:
136+
137+
TEST_CSM_ORGID_AUTHENTICATION=SubscriptionId={SubId};UserId={orgId};AADTenant={tenantId};Environment={env};HttpRecorderMode=Record;
131138

132139
#### Record Test with ServicePrincipal
133-
TEST_CSM_ORGID_AUTHENTICATION=SubsctiptionId={SubId};ServicePrincipal={clientId};ServicePrincipalSecret={clientSecret};AADTenant={tenantId};Environment={env};HttpRecorderMode=Record;
134140

135-
2. Run the test and make sure that you got a generated .json file that matches the test name in the bin folder under *SessionRecords folder
136-
3. Copy SessionRecords folder inside the test project and add all *.json files in Visual Studio setting "Copy to Output Directory" property to "Copy if newer"
141+
This is the preferred option because it works with both .NET Framework and .NET Core.
142+
143+
To create a service principal, follow the [Azure AD guide to create a Application Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#create-an-active-directory-application). The application type should be `Web app / API` and the sign-on URL value is irrelevant (you can set any value).
144+
145+
After the service principal is created, you will need to give it access to Azure resources. This can be done with the following PowerShell command, with the [Service Principal Application ID](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key) (this is a guid, not the display name of the service principal) substituted in for `{clientId}`.
146+
147+
New-AzureRmRoleAssignment -ServicePrincipalName {clientId} -RoleDefinitionName Contributor
148+
149+
To use this option, set the following environment variable before starting Visual Studio. The following values are substituted into the below connection string:
150+
151+
`clientId`: The [Service Principal Application ID](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key)
152+
153+
`clientSecret`: A [Service Principal Authentication Key](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key)
154+
155+
`tenantId`: The [AAD Tenant ID](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-tenant-id)
156+
157+
158+
TEST_CSM_ORGID_AUTHENTICATION=SubscriptionId={SubId};ServicePrincipal={clientId};ServicePrincipalSecret={clientSecret};AADTenant={tenantId};Environment={env};HttpRecorderMode=Record;
159+
160+
161+
2. Run the test and make sure that you got a generated .json file that matches the test name in the bin folder under *SessionRecords folder
162+
3. Copy SessionRecords folder inside the test project and add all *.json files in Visual Studio setting "Copy to Output Directory" property to "Copy if newer"
137163
4. To assure that the records work fine, delete the connection string (default mode is Playback mode) OR change HttpRecorderMode within the connection string to "Playback"
138164

139165
## 5. Change Test Environment settings at run-time
@@ -149,4 +175,4 @@ In order to Record/Playback a test, you need to setup a connection string that c
149175
TestEnvironment.Endpoints.GraphUri = new Uri("https://newGraphUri.windows.net");
150176

151177
###Note:###
152-
Changing the above properties at run-time has the potential to hard code few things in your tests. Best practice would be to use these properties to change values at run-time from immediate window at run-time and avoid hard-coding certain values.
178+
Changing the above properties at run-time has the potential to hard code few things in your tests. Best practice would be to use these properties to change values at run-time from immediate window at run-time and avoid hard-coding certain values.

documentation/breaking-changes/upcoming-breaking-changes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
2626
-->
2727

28-
# Upcoming Breaking Changes
28+
# Upcoming Breaking Changes
29+

0 commit comments

Comments
 (0)