Skip to content

Commit

Permalink
Merge master into release-2020-12-29 (#13842)
Browse files Browse the repository at this point in the history
* Delete the useless case for costmanagement (#13810)

* delete useless test

* delete useless file

* add liveonly test case for secret management extension (#13809)

* Update the Warning message (#13821)

* Update New-AzHostGroup.md (#13814)

* Fix the test framework for test. (#13803)

* Fix cases and utils script for 'BotService' (#13813)

* Fix cases and utils script for 'BotService'

* update env file

* Add SubscriptionId in cmdlet ’New-AzBotService‘

* update the cmdlet 'New-AzBotservice'

* Update custome file

* Change Get-AzAlertHistory title and description (#13816)

* change alert history title and description

* add release note to change log

* remove changelog

as only doc was changed

Co-authored-by: Yeming Liu <[email protected]>

* [KubernetesConfiguration] Upgrade API version from 2019-11-01-preview to 2020-10-01-preview. (#13829)

* [KubernetesConfiguration] Upgrade API version from 2019-11-01-preview to 2020-10-01-preview.

* [KubernetesConfiguration] Updated ChangeLog.md

* [KubernetesConfiguration] update help doc.

* Update example (#13837)

Updated the example to match the correct cmdlet and removed duplicated parameter.

Co-authored-by: Youri970410 <[email protected]>
Co-authored-by: Beisi Zhou <[email protected]>
Co-authored-by: Theodore Chang <[email protected]>
Co-authored-by: kceiw <[email protected]>
Co-authored-by: hutzleo <[email protected]>
Co-authored-by: Yeming Liu <[email protected]>
Co-authored-by: LucasYao93 <[email protected]>
Co-authored-by: javiermarasco <[email protected]>
  • Loading branch information
9 people authored Dec 25, 2020
1 parent ef65c5d commit 27c59a1
Show file tree
Hide file tree
Showing 139 changed files with 3,603 additions and 1,790 deletions.
3 changes: 3 additions & 0 deletions src/BotService/custom/New-AzBotService.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ function New-AzBotService {
Write-Error $NameAvailabilityResponse.Message
throw
}
if ($PSBoundParameters.ContainsKey('SubscriptionId')) {
$EnvPSBoundParameters['SubscriptionId'] = [System.String]$SubscriptionId
}
if ($BotKind -eq $Kind)
{
if (-not $PSBoundParameters.ContainsKey('DisplayName'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ while(-not $mockingPath) {
. ($mockingPath | Select-Object -First 1).FullName

Describe 'Initialize-AzBotServicePrepareDeploy' {
It '__AllParameterSets' -skip {
# Join-Path $PSScriptRoot 'resources\MyEchoBot'
It '__AllParameterSets' -Skip {
Initialize-AzBotServicePrepareDeploy -CodeDir $env.NewBotService2 -ProjFileName EchoBot.csproj
$IsExit = Test-Path "$($env.NewBotService2)\.deployment"
$IsExit | Should -Be $True
Expand Down
46 changes: 40 additions & 6 deletions src/BotService/test/New-AzBotService.Recording.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"New-AzBotService+[NoContext]+WebApp+$POST+https://management.azure.com/providers/Microsoft.BotService/checkNameAvailability?api-version=2018-07-12+1": {
"New-AzBotService+[NoContext]+Registration+$POST+https://management.azure.com/providers/Microsoft.BotService/checkNameAvailability?api-version=2018-07-12+1": {
"Request": {
"Method": "POST",
"RequestUri": "https://management.azure.com/providers/Microsoft.BotService/checkNameAvailability?api-version=2018-07-12",
"Content": "{\r\n \"name\": \"BotService-v5kgny\",\r\n \"type\": \"sdk\"\r\n}",
"Content": "{\r\n \"name\": \"BotService-02le6b\",\r\n \"type\": \"bot\"\r\n}",
"Headers": {
},
"ContentHeaders": {
Expand All @@ -19,11 +19,11 @@
"Vary": [ "Accept-Encoding" ],
"x-ms-ratelimit-remaining-tenant-writes": [ "1199" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-request-id": [ "c1582637-c843-4584-b09b-d7df1984c07d" ],
"x-ms-correlation-request-id": [ "c1582637-c843-4584-b09b-d7df1984c07d" ],
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20201216T123323Z:c1582637-c843-4584-b09b-d7df1984c07d" ],
"x-ms-request-id": [ "196a3fb6-347e-4f44-8b02-ace52a682398" ],
"x-ms-correlation-request-id": [ "196a3fb6-347e-4f44-8b02-ace52a682398" ],
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20201222T065124Z:196a3fb6-347e-4f44-8b02-ace52a682398" ],
"X-Content-Type-Options": [ "nosniff" ],
"Date": [ "Wed, 16 Dec 2020 12:33:23 GMT" ]
"Date": [ "Tue, 22 Dec 2020 06:51:24 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "42" ],
Expand All @@ -32,5 +32,39 @@
},
"Content": "{\"valid\":true,\"message\":\"\",\"absCode\":null}"
}
},
"New-AzBotService+[NoContext]+Registration+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/youriBotService-rg-g0j9s3/providers/Microsoft.BotService/botServices/BotService-02le6b?api-version=2018-07-12+2": {
"Request": {
"Method": "PUT",
"RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/youriBotService-rg-g0j9s3/providers/Microsoft.BotService/botServices/BotService-02le6b?api-version=2018-07-12",
"Content": "{\r\n \"sku\": {\r\n \"name\": \"F0\"\r\n },\r\n \"location\": \"global\",\r\n \"kind\": \"bot\",\r\n \"properties\": {\r\n \"displayName\": \"BotService-02le6b\",\r\n \"endpoint\": \"\",\r\n \"msaAppId\": \"2d00693f-17b0-4b43-b850-1d3fb485272e\"\r\n }\r\n}",
"Headers": {
},
"ContentHeaders": {
"Content-Type": [ "application/json" ],
"Content-Length": [ "225" ]
}
},
"Response": {
"StatusCode": 201,
"Headers": {
"Cache-Control": [ "no-cache" ],
"Pragma": [ "no-cache" ],
"ETag": [ "\"0100ff99-0000-1800-0000-5fe197720000\"" ],
"x-ms-request-id": [ "5746c342-bc8e-4d3f-9e96-4f1088dd16bd" ],
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
"x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
"x-ms-correlation-request-id": [ "164fe878-e220-4eba-989a-8a6508d75069" ],
"x-ms-routing-request-id": [ "SOUTHEASTASIA:20201222T065132Z:164fe878-e220-4eba-989a-8a6508d75069" ],
"X-Content-Type-Options": [ "nosniff" ],
"Date": [ "Tue, 22 Dec 2020 06:51:32 GMT" ]
},
"ContentHeaders": {
"Content-Length": [ "1069" ],
"Content-Type": [ "application/json; charset=utf-8" ],
"Expires": [ "-1" ]
},
"Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/youriBotService-rg-g0j9s3/providers/Microsoft.BotService/botServices/BotService-02le6b\",\"name\":\"BotService-02le6b\",\"type\":\"Microsoft.BotService/botServices\",\"etag\":\"\\\"0100ff99-0000-1800-0000-5fe197720000\\\"\",\"location\":\"global\",\"sku\":{\"name\":\"F0\"},\"kind\":\"bot\",\"tags\":{},\"properties\":{\"displayName\":\"BotService-02le6b\",\"description\":null,\"iconUrl\":\"https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png\",\"endpoint\":\"\",\"msaAppId\":\"2d00693f-17b0-4b43-b850-1d3fb485272e\",\"developerAppInsightKey\":null,\"developerAppInsightsApplicationId\":null,\"luisAppIds\":[],\"endpointVersion\":\"3.0\",\"configuredChannels\":[\"webchat\"],\"enabledChannels\":[\"webchat\",\"directline\"],\"isDeveloperAppInsightsApiKeySet\":false,\"isStreamingSupported\":false,\"publishingCredentials\":null,\"parameters\":null,\"allSettings\":null,\"manifestUrl\":null,\"storageResourceId\":null,\"migrationToken\":null,\"isCmekEnabled\":false,\"cmekKeyVaultUrl\":null,\"cmekEncryptionStatus\":\"Off\",\"provisioningState\":\"Succeeded\"}}"
}
}
}
8 changes: 3 additions & 5 deletions src/BotService/test/New-AzBotService.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ while(-not $mockingPath) {
. ($mockingPath | Select-Object -First 1).FullName

Describe 'New-AzBotService' {
It 'Registration' -skip {
$NewApplication = New-AzApplicationInsights -ResourceGroupName $env.ResourceGroupName -Name $env.WebApplicationName1 -Location $env.Location
$NewAzBot = New-AzBotService -ResourceGroupName $env.ResourceGroupName -Name $env.NewBotService1 -ApplicationId $NewApplication.AppId -Location $env.Location -Sku F0 -Description "description" -Registration
It 'Registration' {
$NewAzBot = New-AzBotService -ResourceGroupName $env.ResourceGroupName -Name $env.NewBotService1 -ApplicationId $env.WebApplication1 -Location $env.Location -Sku F0 -Description "description" -Registration
$NewAzBot.Name | Should -Be $env.NewBotService1
}

#this case use the cmdlet 'New-AzResourceGroupDeployment' and it is can not be recorded.
It 'WebApp' -Skip {
$NewApplication = New-AzApplicationInsights -ResourceGroupName $env.ResourceGroupName -Name $env.WebApplicationName2 -Location $env.Location
$ApplicationSecret = ConvertTo-SecureString -String $env.Secret -Force -AsPlainText
write-host $ApplicationSecret
$NewAzBot = New-AzBotService -ResourceGroupName $env.ResourceGroupName -Name $env.NewBotService2 -ApplicationId $NewApplication.AppId -Location $env.Location -Sku F0 -Description "description" -ApplicationSecret $ApplicationSecret -Webapp
$NewAzBot = New-AzBotService -ResourceGroupName $env.ResourceGroupName -Name $env.NewBotService2 -ApplicationId $env.WebApplication2 -Location $env.Location -Sku F0 -Description "description" -ApplicationSecret $ApplicationSecret -Webapp
$NewAzBot.Name | Should -Be $env.NewBotService2
}
}
2 changes: 1 addition & 1 deletion src/BotService/test/Publish-AzBotServiceApp.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ while(-not $mockingPath) {
. ($mockingPath | Select-Object -First 1).FullName

Describe 'Publish-AzBotServiceApp' {
It '__AllParameterSets' -skip {
It '__AllParameterSets' -Skip {
$PublishService = Publish-AzBotServiceApp -ResourceGroupName $env.ResourceGroupName -Name $env.NewBotService2 -CodeDir "./$($env.NewBotService2)"
$PublishService.Name | Should -Be $env.NewBotService2
}
Expand Down
4 changes: 2 additions & 2 deletions src/BotService/test/env.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"WebApplicationName2": "WebApplication-r5tseq",
"WebApplicationName1": "WebApplication-prq7cs",
"WebApplication2": "88527e5d-3cc9-4c64-905e-f6d4f59a45f3",
"WebApplication1": "2d00693f-17b0-4b43-b850-1d3fb485272e",
"NewBotService1": "BotService-02le6b",
"SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f",
"ResourceGroupName": "youriBotService-rg-g0j9s3",
Expand Down
8 changes: 4 additions & 4 deletions src/BotService/test/utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ function setupEnv() {
Import-Module Az.Resources
Import-Module Az.Websites
# For any resources you created for test, you should add it to $env here.
$WebApplicationName1 = 'WebApplication-' + (RandomString -allChars $false -len 6)
$WebApplicationName2 = 'WebApplication-' + (RandomString -allChars $false -len 6)
$WebApplication1 = '2d00693f-17b0-4b43-b850-1d3fb485272e'
$WebApplication2 = '88527e5d-3cc9-4c64-905e-f6d4f59a45f3'
$NewBotService1 = 'BotService-' + (RandomString -allChars $false -len 6)
$NewBotService2 = 'BotService-' + (RandomString -allChars $false -len 6)

$Secret = "youriSecret"
$null = $env.Add('WebApplicationName1', $WebApplicationName1)
$null = $env.Add('WebApplicationName2', $WebApplicationName2)
$null = $env.Add('WebApplication1', $WebApplication1)
$null = $env.Add('WebApplication2', $WebApplication2)
$null = $env.Add('NewBotService1', $NewBotService1)
$null = $env.Add('NewBotService2', $NewBotService2)
$null = $env.Add('Secret', $Secret)
Expand Down
2 changes: 1 addition & 1 deletion src/Compute/Compute/help/New-AzHostGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Accept wildcard characters: False
### -SupportAutomaticPlacement
Specifies if HostGroup will enable automatic placement of vm's.
Automatic placement means these VMs are placed on dedicated hosts, chosen by Azure, under the dedicated host group.
If not specified, default value will be true.
If not specified, default value will be false.
```yaml
Type: bool
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,26 @@ function Test-SecretManagementExtension

Get-SecretInfo -Vault AzKeyVault

Get-Secret -Vault AzKeyVault -Name secret1
[byte[]]$Arr = 1, 2, 3
Set-Secret -Name byteArraySecret -Secret $Arr -Vault AzKeyVault #ByteArray

$secure = ConvertTo-SecureString -String "test" -AsPlainText -Force
Set-Secret -Vault AzKeyVault -Name secret3 -SecureStringSecret $secure
Set-Secret -Name stringSecret -Secret 'test' -Vault AzKeyVault # String value

Get-SecretInfo -Vault AzKeyVault
Remove-Secret -Vault AzKeyVault -Name secret3
$credential = [System.Management.Automation.PSCredential]::new('<user>', ('<pwd>' | ConvertTo-SecureString -AsPlainText -Force))
Set-Secret -Name credentialSecret -Secret $credential -Vault AzKeyVault # PSCredential

$hashtable = @{'<key>'='<value>'}
Set-Secret -Name hashtableSecret -Secret $hashtable -Vault AzKeyVault # Hashtable

$secure = ConvertTo-SecureString -String "<text1>" -AsPlainText -Force
Set-Secret -Name secureSecret -SecureStringSecret $secure -Vault AzKeyVault

$secureString = ConvertTo-SecureString -String "<text2>" -AsPlainText -Force
Set-Secret -Name secureStringSecret -SecureStringSecret $secureString -Vault AzKeyVault

Get-SecretInfo -Vault AzKeyVault

Get-Secret -Vault AzKeyVault -Name secureSecret

Get-SecretInfo -Vault AzKeyVault | Remove-Secret -Vault AzKeyVault
}
Loading

0 comments on commit 27c59a1

Please sign in to comment.